Example Code

Cleaning up a Signal - Fourier Transforms

Code and Documents

Attachment

Dear NI Community,

I was developing some code that demonstrated the effect of a low pass filter on a poor SNR signal and thought people would find this useful.

- I use a subvi (Square Wave Function.vi) to generate a square wave using Fourier Series. 

- Random (white) noise is added to the signal to produce a poor quality signal. 

- By taking the Fourier Transform the random components at high frequencies are present.

- High frequency or low SNR components can be filtered out in Square Filter.vi by moving the cross hairs on the XY Graph

- The resultant signal is Fourier Transformed back and the signal has been significantly cleaned up

There are some controls on the front panel that you can play about with such as how many components are in the Fourier Series Expansion, the noise factor and the frequency of the signal.  Note also how the cross hairs can be used to filter out components.  There is an express vi in the Functions Palette -> Express -> Signal Analysis -> Filter, which does the same thing at a higher level and can also do highpass, bandpass filtering to name but a few.

Untitled.png

I uploaded the code for LabVIEW 2012, 2011 and 8.6.

Kind Regards,


Robert Ward

temp.png

Robert Ward
Applications Engineer, NI

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors