LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement lowpass filter to reduce noise in gyroscope values ?

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.

0 Kudos
Message 1 of 7
(6,126 Views)

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?

0 Kudos
Message 2 of 7
(6,080 Views)

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

0 Kudos
Message 3 of 7
(6,065 Views)

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

0 Kudos
Message 4 of 7
(6,044 Views)

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,

Thomas C.
FlexRIO Product Support Engineer
National Instruments
0 Kudos
Message 5 of 7
(5,983 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(5,957 Views)

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

0 Kudos
Message 7 of 7
(5,903 Views)