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

Dear sir,

I would like to inform you that we dont have any proper setup for providing frequency to the accelerometer, as our sensor is very sensitive so we are just playing with it by knocking on to the table. for providing the exact frequencies we are going to look for test beds available.

 

Just want  to know that you said that the values are repeated ten times or severly undersampled i am unable to get it.

 

Regards,

RITA

0 Kudos
Message 11 of 20
(1,782 Views)

Rita,

 

Do you understand the concept of sampled data? When you convert a continuous signal, such as the output of your accelerometer, to a series of numbers in a computer, it is called sampling. You always lose some information when you sample because the samples are separated in time. If you know the bandwidth (or the freqeuncy range) of the signal is limited to a particular value, then it is possible to prove mathematically that you can reproduce the signal exactly from the samples provided that you take the samples at a rate which is greater than twice the bandwidth of the signal.

 

An accelerometer always has a bandwidth specification. Ones which you can "knock on the table" probably have a bandwidth of a few kilohertz to perhaps tens of kilohertz. Your VI reads one sample every 100 ms or 10 samples per second. As I showed in the graph I posted yesterday, the same value appears to be repeated 10 times. This makes me think that you are effectively sampling at 1 Hz. That means that you can only measure (correctly) signals with a bandwidth less than 0.5 Hz. To accurately measure your accelerometer you should probably be sampling at 10 kHz or faster.

 

You mentioned a WSN-3203 in your first post. That device has a sampling rate of 1 Hz, which is completely unsuitable for measuring the output of an accelerometer.

 

Lynn

0 Kudos
Message 12 of 20
(1,763 Views)

thank you sir.Is NI WSN Node having any node to catch such frequencies ?

0 Kudos
Message 13 of 20
(1,753 Views)

I am not familiar with the WSN products available from NI. You mihgt contact your NI sales representative for suggestions on specific products.

 

Lynn

0 Kudos
Message 14 of 20
(1,741 Views)

Hello sir, 

I am plotting my analog data on graph by first storing them in array then when particular array reaches to its maximum size it display its data in waveform graph..But I want to get proper sine wave in continous manner but I am storing in array so its coming with some delay , moreover when I give delay in while loop perfect sinewave come but it should come without delay in proper sinewave.

In scaling of X axis,if I am using collecter.vi its shows values 0 to whatever time we executing the VI.so all the waves append in that graph only.but I want the waveform to be look like in a smiliar fashion as that of my first waveform

 

How can I get the proper continous sine wave without delay.?

second if I use collector VI , how can remove that sacling problem in X axis so that I can see sinewave properly , it should not append in graph as I need to run VI for long time.?

0 Kudos
Message 15 of 20
(1,715 Views)

I do not understand your questions.

 

What I see in your VI is that you obatain one data point from AI0 every 3 milliseconds and prepend it to Array. Prepend means that you put the newest data at the front of the array. This process may be slower than appending or putting the newest data at the end of the array, because every element in the array needs to be moved down to make room for the new element. Also, the memory allocated for the array may need to increase as the array grows. This can be a slow process as well.

 

Once every one thousand iterations, or approximately every three seconds, you write the data to the graph using a completely unnecssary local variable. The data is already present at the tunnel on the left side of the case structure. You also set the shift register to default which is an empty array.

 

This loop does not control the data acquisition, it only reads what ever is in the shared variable. If the acquisition device which writes data to that shared variable writes faster than 333 times per second, then you will miss some data points. If it writes slower than 333 Hz, then you will at least occasionally read the same data multiple times.  This could have something to do with not getting "the proper sine wave." 

 

There will always be some delay, simply because this is a sampled data system. The data is not available until after the conversion time.  However, I suspect that you are talking about a delay of more than a few milliseconds.

 

Earlier you were talking about impulses from hitting the sensor. Now you are talking about a sine wave. Let's make sure that everyone has all the necessary information:

1. What is the frequency of your signal (sine wave) and how is it generated?

2. What is the sample rate? How often does the acquisition device write to the shared variable?

3. How much delay are you seeing in your graph? How much delay can you tolerate?

 

Lynn

0 Kudos
Message 16 of 20
(1,699 Views)

Hello john sir,

Hope you are doing well

 

Let me explain you one more time, Basically we have NI WSN 3202 node which has a minimum sample interval of 1s, (i.e, 1Hz) and in connection with the node we have NI WSN 9792 gateway which acquires the data from WSN node wirelessly. So using WSN 3202 node and function generator we are giving the frequency ranging from 2Hz, 3Hz, 4Hz, 5Hz and 6Hz and as i mentioned my node supports minimum 1sample /second (configured in sampling interval) , therefore in 0.5 seconds it should give 2 samples. Similarly in 0.25 seconds we achieve 4 samples, in 0.125 second we get 8 samples and keep on . But here we are analyzing the sine wave in graph depending on the frequency taken  by function generator. We are unable to get the perfect sine wave , How this can be achieved Please help!. We are able to get the sine wave but not the exact sine wave.

 

 

Thanks!

0 Kudos
Message 17 of 20
(1,687 Views)

The minimum sample interval is the smallest amount of time between samples. You cannot get 2 samples in 0.5 s from one device.

 

With this device you cannot measure any signal with a frequency component of 0.5 Hz or larger. You cannot measure a 2 Hz, 3 Hz, 4 Hz, 5 Hz, 6 Hz, or even 1 Hz sinewave with this device.

 

To get a graph of a sine wave which looks fairly good, you need at least 50-100 samples per cycle. So any sine wave faster than about 1 cycle per MINUTE will be too fast for you to measure it and get a nice display. 

 

This is based on the fundamental theory of sampled data systems.  There is nothing you can do to make your equipment do anything meaningful with the accelerometer data.

 

Lynn

0 Kudos
Message 18 of 20
(1,673 Views)

Hello Lynn

 

You cannot measure a 2 Hz, 3 Hz, 4 Hz, 5 Hz, 6 Hz, or even 1 Hz sinewave with this device as you said, but here using the NI WSN 3202 node i am able to get the 2 samples @ 0.5 seconds upto 16 samples @ 0.0625 seconds perfectly. here we are not concerned about the power consumption. Now tell me that how to get the sine waved and its FFT using NI WSN 3202 @ 1Hz.

0 Kudos
Message 19 of 20
(1,662 Views)

I have never used the WSN 3202 (or any other WSN for that matter). I have been going on the data in the specifications documents which specify a minimum sample interval of 1 second.

 

When you say you can read 2 samples @ 0.5 seconds or 16 samples @ 0.0625 seconds, are you getting different samples or simply reading the same data multiple times?  The communications rate is much higher than the sampling rate. The specification document is not clear on what is transmitted if reads occur faster than sampling. Other systems I have seen may repeat transmission of the same data, with or without warning that it is the same data.

 

If you look at my post in Message 10 of this thread, you can see that I suspected repeated transmission of the same sample.

 

Try this: Set a signal generator to produce a sinusoidal signal at 0.1 Hz. Then take one reading per second of that data. You should see something which looks like a jagged or stepped approximation to a sinewave (due to only having ten samples per cycle). Repeat - with the same 0.1 Hz signal - the readings of 2 samples @ 0.5 seconds or 16 samples @ 0.0625 seconds. Plot the results and post them here so we can see what you get.

 

Lynn

0 Kudos
Message 20 of 20
(1,651 Views)