LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to do FFT analysis of 6 channel sensor data?

I have been collecting some chemical sensor data. Basically, they are time and voltage. IF you plot the data, the x axis is time, and y axis is voltage. I want to do a FFT , then a filtering, and a invert FFT to get rid of the baseline drifting and some noises. But I couldn't figure out how to use the spectral measurments block from the "analysis subpanel". What should I I put into the "signal" input of the block?

I attached one of my data file. the first column of the data is time, column 2 to 7 is sensor voltage signal, 8 to11 is some other signal.
Also I am wondering if I can do time domine filtering in Labview 7.1 and to get rid of the baseline drifting?

Thank you.
0 Kudos
Message 1 of 9
(4,473 Views)
Hello,

To get started using the Spectral Measurements Express VI, I would suggest taking a look at some of the example programs that demonstrate its use:
• Basic Spectral Measurement VI: (labview\examples\express)
• Spectrum Measurements VI: (labview\examples\express)
• Filter VI: (labview\examples\express)

The Spectral Measurements Express VI takes a time-domain signal as the input and the Filter VI example above shows how a time-domain input signal can be filtered first and then passed through the Spectral Measurements Express VI for analysis.

There’s also a KB online:
KB 2X09RMN1: Using the Spectral Measurements Express VI

Hope this helps. Good luck!

Kileen
Message 2 of 9
(4,451 Views)
ack, bad link. here it is again:
KB 2X09RMN1

Sorry about that!

Kileen
Message 3 of 9
(4,445 Views)
It looks niether FFT/IFFT nor filter is suitable to remove the drifting. I tried using polynormial fitting to remove the trend. Please check the attached VI. Does it work for you?
Message 4 of 9
(4,439 Views)
Thanks guys.

The reason that I want to use FFT is to do a frequency domain filtering. The long time drifting should be a very low freq signal, and the noises should be a relative high freq signal. So by using a bandpass filter, i should be able to remove both drifting and noises. Then do a inverse FFT to get the time domain signal again.

LoveDSP, thanks for your vi. But I think it is not quite waht I want. The baseline drifting is what I really want to remove. A baseline should be below response signals (those pulses you see in the data file). By using polynormial fitting sometimes the baseline is actually higher, so it give you negitive results after substrating data from polynormial fitting curve.
0 Kudos
Message 5 of 9
(4,426 Views)
Hi,

I still don't think that FFT and filter can solve your problem.

The drifting is very slow. When you remove the linear trend, there is a sine-like drifting. But there is only one cycle. So I don't think you can use a filter to remove the baseline. Nor you can use FFT/IFFT to remove the baseline. If you do it in this way, the pulse will be distorted much.

Since the useful signal is pulses, if you use lowpass/bandpass filter to remove the noise, the pulse will be distorted. The better way is to use wavelet-based method.

I tried Hilbert transform to detect the baseline but failed. So I tried the following "add hoc" method.

Step 1: Using linear fitting to remove the linear trend.
Step 2: Using wavelet-based method to detect the valleys (They are the bottom of those pulses).
Step 3: Using spline interpolation to estimate the baseline.
Step 4: Substract the baseline.
Step 5: Using wavelet-based denoising to remove noise.

I do not attach the VI because I used VIs not included in LabVIEW 7.1. They are from the LabVIEW Singal Processing Toolset. But I attach the screenshot. Is that what you want?
Message 6 of 9
(4,421 Views)
LoveDSP, I must say you are genius.
This is very close to what I want. One thing I did not explain to you is that usually when we say a response of a sensor, it is defined as (Vt-Vo)/Vo, here Vt is your signal, and Vo is your baseline. So the final result should be a percentage number.

You use linear fitting to fit the baseline. however, I don't know if this works for other data I have. They have wired baseline drifting, up and down, nothing near a line. I attached one set of this kind of data. Could you try it to see if your vi still works? Or do you think it is better to use your first vi, a polynomial fitting to do the baseline?

I don't have the signal processing kit. But I can check with my collegues, they might have.

Message Edited by bopqod on 03-22-2005 10:52 AM

Message Edited by bopqod on 03-22-2005 10:52 AM

0 Kudos
Message 7 of 9
(4,410 Views)
Hi LoveDSP, I got the signal processing kit. would you mind to send me the vi?

I tried to wrote another vi. Since I know the time that my sensor is giving pulses. So i took the pulese out of the data. and do fitting to the rest of the data to get a baseline. Then divid the original data by this baseline. However, I still have a problem. since the fitting curve has smaller array size than the original data. So the divid operation desn't give me the right answer. Do you have any idea how could I make the baseline have the same array size as the original data?
0 Kudos
Message 8 of 9
(4,371 Views)
Since you know when the pulse occur well, I make the VI simpler. It does not need the peak detection step.
Message 9 of 9
(4,367 Views)