LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform FFT on data coming through accelerometer is correct or not ?

Solved!
Go to solution

Hi, 

I am doing FFT on data coming through accelerometer , but display is not proper ?Can someone help me in resolving this issue.I am using ICP accelerometer and connecting it to NI WSN NODE 3202 .

FFT.png 

FFT graph.png

0 Kudos
Message 1 of 20
(7,229 Views)

Wat do you expect to be displayed? 

Note I see a few things that might be your problem.

- a race condition at the funtion input. I am for now asuming it is seposed to be the dbl inside the for loop. you can just use the output. 

- The shift register is not initalized.  this meens that it is still holding the data from the previus run of the while loop(s). this is the same data that is inside the  double indecator.

 

I hope this helps.


Learning LabVIEW since January 2013
0 Kudos
Message 2 of 20
(7,195 Views)
Solution
Accepted by rita86

What is the purpose of feeding one element of the FFT to a chart on each iteration of the loop? You are getting the spectral components from different FFTs of different data sets. Graph the entire array coming out of the FFT.

 

Lynn

0 Kudos
Message 3 of 20
(7,183 Views)

Thanks a lot sir, yes same data is coming , I modified my vi , now I am storing values in Array and then each time empty the array also.Hope I am doing correctly .

 

fft block.png

Front Pannel 

If the graph is coming correctly?I have taken three display first one FFT Graph, Second is  FFT-(RMS) Spectral Measurement and Third is FFT Chart.

 

FFT Front.png

0 Kudos
Message 4 of 20
(7,159 Views)

Thanks sir, I want to display data in a proper spectrum.Is this FFT is correct or display will be like this only.????

 

 

 

Thanks

0 Kudos
Message 5 of 20
(7,154 Views)

It is difficult to be sure about what is correct. I have not seen the time domain signal (the input to the FFT), so I do not know what the spectrum should be.

 

The FFT Graph appears to be a somewhat reasonable spectrum. Most of the energy is at relatively low frequencies. This is the way many physical systems behave.  The "spikiness" of the first few elements of the spectrum suggest that you do not have enough frequency resolution to get complete information about the signal.

 

The FFT(RMS) Spectral Measurement graph appears to have a logarithmic Y-axis and different scaling on the X-axis but there seems to be some similarity with the other spectrum (as it should have since they are derived from the same signal).

 

Some of the wires are hidden behind the case structure, the False case is not shown, and local variables can lead to race conditions, so it is impossible to say whether the program is correct. Nothing that shows in your image indicates any reason to use local variables. Add a shift register for Numeric and connect the wires to eliminate all the locals.

 

Run the VI until you have some typical data displayed on the indicators. Then Edit >> Make Current Values Default. Save. Post the saved VI. Then we can see what is going on.  

 

What is the sample rate?  It looks like you get one data pont every 100 ms. What are you measuring - continental drift?

 

Lynn

0 Kudos
Message 6 of 20
(7,130 Views)

Thanks sir,

I taken local variables just for looping and storing the values from sensor connecting in AI0 pin of Node 3202  in an ARRAY, if 16 values are stored then when local variable value reached to 16 then all 16 values displayed in Graph.I am attaching my VI ,plz suggest me .

0 Kudos
Message 7 of 20
(7,097 Views)

Here is a cleaned up version which does not use any local variables. The Numeric control is not needed either. 

 

You did not save any data. After you run the VI so that the Input Signals array has data in it, stop the VI. From the Edit menu choose Make Current Values Default. Then save the VI. Post that version. It will contain the data.

 

Lynn

0 Kudos
Message 8 of 20
(7,080 Views)

Hello sir,

I followed the procedure you wrote , but as its 128 point fft upto i=128 it run .After that second condition  i.e 0(Zero) in case structure doesnt run.Output of the program is like this --

 

output.png

 

Please guide me where I am going wrong.

In my previous VI , I taken local variable as after meeting the condition when i=16 it will display the FFT values in graph which is stored in array and again it will start counting from "0" i.e local variable will again be zero.So array after displaying values of FFT on graph will become empty and again it store 16 new values , apply FFT on it and again display.Hope I am able to explain the problem. 

0 Kudos
Message 9 of 20
(7,065 Views)

I goofed. The case select terminal should be connected to the Remainder output. Then It will be zero only once out of every 128 iterations of the loop.

 

Remainder.png

 

I have doubts about your data acquisition process. I plotted the Input Signals data. It appears that each data point is repeated 10 times. It also appears that the data is either random or severely undersampled.  You indicated that the signal source is an accelerometer. What is the source of the accelerations being measured? What frequency range do you expect for the acceleration?

 

Input Signals.png

 

Until the acquistion issue is resolved, the FFT is meaningless.

 

Lynn

0 Kudos
Message 10 of 20
(7,038 Views)