LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to reduce noise in AI by oversampling ?

hello everyone,

probably a repeated question, can anyone post an ex. of how to oversample and analog input, find mean (every3 points) and then save this 1 point (1 point for every 3 points) to a file?

i guess, this is the right way to maintain high sampling rate, and also get a smooth waveform/output?

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 1 of 5
(3,654 Views)

You can smooth without changing the number of points or you can reduce the number of points by averaging groups of points.

 

Smoothing is often done with a shift register with the left terminals expanded to the number of points you wish to include in the smoothing.  The left for loop shows this.  The same sine is added to both the raw noise and the smoothed signal to simulate a real signal corrupted with noise.  I added 1 to the smoothed signal to offset the plot for improved visibility.  It has no effect on the smoothing.

 

By using the Decimate Array function I split the array into three.  Averaging elements with the same index has the same effect as taking the average of the original array in groups of three elements. See the right for loop.  Using Array Subset in a loop is probably more efficient because it does not require allocating space for three arrays and duplicating all the data.

 

Lynn

 

Smoothed and decimated.png

0 Kudos
Message 2 of 5
(3,641 Views)

alright cool... i will try this approach... however, what happens when i have a N-CHANNEL, N-SAMPLES, can i still use the same approach???

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 3 of 5
(3,611 Views)

You will need to separate the channels and process each separately - separate shift registers.

 

Lynn

0 Kudos
Message 4 of 5
(3,608 Views)

As an aside. I use this function a lot for downsampling using averaging. However, I think this function come with Labview 8.2. You will probably not find it in your 8.0 versionSmiley Sad. But it will help others reading this later

 

Decimate (single shot) VI
Owning Palette: Signal Operation VIs
Installed With: Full Development System
Decimates the input sequence X by the decimating factor and the averaging Boolean control. Wire data to the X input to determine the polymorphic instance to use or manually select the instance.

 



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 5
(3,593 Views)