11-15-2014 04:17 AM
Hi,
I am new to labview and I need help.. I am using myrio with gyroscope, and when I display the gyroscope values I get noise .
My question is how can I implement lowpass filter to reduce the noise in X , Y and Z rates of the gyroscope? I searched a lot but I did not understand how can I know what is the sampling frequency, the low and the high cutoff frequency. I have attached a screenshot for the outtputs of the gyroscope when it is stabe in the table without moving. Thank you so much.
11-15-2014 01:01 PM
http://en.wikipedia.org/wiki/Low-pass_filter
How do you expect us to determine what your sampling rate and frequencies of interest are from a front panel screenshot?
11-15-2014 03:39 PM
You misunderstood me, the image shows the gyroscope values affected by the nose. My question is : is there any tutorial illustrates how to implemnt lowpass filter to get rid of the noise?
Thanks a lot
11-15-2014 04:23 PM
I doubt you will find a tutorial on exactly that subject. There are libraries full of books on filter design and many of them discuss the effects of filters on noise.
If the noise is broadband random noise, then the energy is proportional to the square root of the effective bandwidth. The effective bandwidth is not the same as the -3 dB bandwidth by which filters are usually specified. The exact relationship depends on the type and order of the filter so there is no simple formula.
If the noise is not broadband and random but is concentrated at certain frequencies or bands, it might be better characterized as interference rather than noise. In such cases filters or other signal processing must be designed according to the characteristics of the desired and undesired signals and noise.
Lynn
11-17-2014 10:51 AM
Hello SOSOSO123,
The sampling frequency is set by the loop rate of your FPGA or RT application. How frequently do you acquire samples? Are you acquiring your data on the FPGA or the RT side?
I recommend looking through the attached white paper, which goes over using the Digital Filter Design Toolkit. For you application and experience, you should consider using the Classical Design Express VI to design your filter.
https://www.ni.com/pdf/labview/us/final_dfd_tutorial.pdf
What is the frequency which you are expecting the gyroscope to change? You can use this as baseline for your cutoff frequencies. You can also do spectral analysis on the signal noise to identify noise frequencies in your signals.
Regards,
11-17-2014 09:05 PM - edited 11-17-2014 09:06 PM
If you have noisey inputs the first thing you have to do is filter the out of band energy BEFORE the signal hits the A/D. If you don't do that you are basically hosed and no amount of SW filtering will help you. Out of band energy is any frequency component in the input that is more than 1/2 the sample rate.
Mike...
11-18-2014 04:53 PM
There is always the "Boxcar Filter", also known as a "backward moving average". Say you have data points coming in at a regular clip, like Gyro coordinates. Save every point (because they are, after all, the data) but display a running average of the last N points (where you adjust N to get a good tradeoff between "smoothness" and "response time".
This is extremely easy to program, of course. One "cute" way is to create a Queue of size N. As each point comes in, you do a "Lossy Enqueue Element" (which keeps only the last N points). At the same time, do a Get Queue Status, returning all of the elements and the number of elements in the Queue -- their quotient is the "Average value" that you can use for your "smooth display".
Suppose you are sampling at 1 KHz. If you sample for a second, you certainly won't see changes that happen at 10 Hz or higher (you can work out for yourself the cutoff). However, if the Gyro flips upside-down, the average won't significantly change until a significant fraction of a second goes by. So there's your tradeoff between "smoothness" and "response time" -- the smoother the output, the less "up-to-date" it is.
Good luck!
BS