LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with FFT analysis of Analog input

hi
Having setup the USB-6008 card to acquire the data (after lot of confusion) I've started writing the code.

I'm trying to acquire accelerometer data from analog input channel of my DAQ USB-6008.
To acquire the data I'm using DAQmxBASE Read(Analog 1D Nchan 1Samp).vi. The o/p is wired to waveform chart which, when executed diplays the analog wave form. I'm trying to get the FFT of the same waveform using "spectral measurements" whose i/p is wired to the o/p of DAQmxBASE Read(Analog 1D Nchan 1Samp).vi. The problem is I'm unable to see the FFT of the signal! when converted to numeric indicator the field displays >> -Inf <<. what could be the problem. Help me!!

I'm using LabVIEW 7.1, NI-DAQmx base 1.4 & USB-6008 hardware.

Regards
Ajit
0 Kudos
Message 1 of 7
(3,450 Views)
Look at the Help for the VI. For the data terminal it says:

"data returns a 1D array of samples. Each element of the array corresponds to a channel in the task. The order of the channels in the array corresponds to the order in which you add the channels to the task."

Since it produces one point per channel an FFT is meaningless. Try building an array of results using a shift register and moving your FFT outside the loop. If you are going to gather large amounts of data it is better to initialize the array outside the loop and use Replace Array Subset inside the loop.

Lynn
0 Kudos
Message 2 of 7
(3,437 Views)
You are only reading in one sample per channel to perform your FFT. You need to acquire a set of points per channel to do a FFT on each channel.

You need to explain more what you are trying to do. What data do you want to perform a FFT on?
Randall Pursley
0 Kudos
Message 3 of 7
(3,435 Views)
Ajit,

I think if you change your read to "Analog 2D DBL NChan NSamp", then you will be able to read N Samples on the one line and you could then perform an FFT on that data.

Attached is an example that takes the analog input on Channel 0 and does an FFT of the latest data set.
Message 4 of 7
(3,416 Views)
hi

thanks for the help. Let me go back home and try it today. The task is to do FFT on signals acquired from two acclerometers.

Regards
Ajit
0 Kudos
Message 5 of 7
(3,408 Views)
hi

I successfully completed the FFT programming yesterday. I used a signal generator to varify the FFT programme. Its perfect as anticipated.

As told earlier, I'm using two accelerometer(spaced apart) to pickup waves created by an impact on the test specimen (a concrete cube for example). I need to know few parameters like phase difference b/w the accelerometer waves, velocity of wave, attenuation, etc., could someone tell me how can this be done? Secondly, I tried logging the FFT(peak)data using "write LVM" onto a data file... but the logged data contains only the amplitude(y-axis) data whereas, I'm more interested in Frequency (x-axis) data. Is it possible to log frequency data?


regards
Ajit
0 Kudos
Message 6 of 7
(3,393 Views)
Glad to hear that you got things working.

Basically, everything you want to do can be done, but you must decide on how you want to implement the math:

  • Phase: You can measure this using the Spectral Measurements Express VI
  • Velocity: You could base the Velocity off of the Phase relationship and the sampling period
  • Attenuation: Perhaps you could do something based off of the Power Spectrum for one channel versus that of the other. Subtract the two and find the difference in peak power


  • You mentioned you had trouble using the Write LVM File. It's actually pretty easy to use. I went ahead and included a VI that uses the Express VIs to Create, Analyze, Save and Read back the data. I think it is somewhat similar to what you would want. Just keep in mind that for the FFT the X-data is the frequency data.
    0 Kudos
    Message 7 of 7
    (3,375 Views)