05-22-2014 01:39 AM
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 .
Solved! Go to Solution.
05-22-2014 06:15 AM
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.
05-22-2014 07:41 AM
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
05-23-2014 06:43 AM
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 .
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.
05-23-2014 06:48 AM
Thanks sir, I want to display data in a proper spectrum.Is this FFT is correct or display will be like this only.????
Thanks
05-23-2014 07:07 PM
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
05-25-2014 03:47 AM
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 .
05-25-2014 01:22 PM
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
05-26-2014 12:48 AM
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 --
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.
05-26-2014 12:57 PM
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.
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?
Until the acquistion issue is resolved, the FFT is meaningless.
Lynn