LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Noise reduction using mean filtering with mathscript hybrid programming

Hi! I have this problem:

The idea of mean filtering is simply to replace each value in a signal with the mean (average) value of its neighbors. A mean filter is widely used for noise reduction.

Start by adding some random noise to a signal (use the file echo_1.wav or any other speech data file). Then, use mean filtering to reduce the introduced noise. More specifically, take the following steps:

  1. Normalize the signal values in the range [0 1].
  2. Add random noise to the signal by using the function randn. Set the noise level as a control.
  3. Convolve the noise-added signal with a mean filter. This filter can be designed by taking an odd number of ones and dividing by the size. For example, a 1× size mean filter is given by [1/3 1/3 1/3] and a 1×5size mean filter by [1/5 1/5 1/5 1/5 1/5]. Set the size of the mean filter as an odd number control (3, 5 or 7, for example).
 
 
I need some help in this problem, I don't know how to normalize the signal and I have no idea how to use convolution here. Thanks for your help.
0 Kudos
Message 1 of 3
(3,278 Views)

I interpret "Normalize to [0,1]" to mean "linearly transform your data so that it lies in the range [0, 1], i.e. the smallest value is 0, the largest is 1".

 

Break this down into two sub-problems.  First, do something to your set of numbers (i.e. do a single mathmatical addition/subtraction/multiplication/division using a constant to each member of the set) to make the smallest number 0.  Now dow a second operation that doesn't change the smallest number, but makes the biggest number 1.  [You may have noticed that I didn't say what this operation is, or how you find the constant number you use on each step -- you should be able to figure this out for yourself].

 

I don't know why you'd want to use a Mathscript Node for this problem (except that you'd need to write a Conv sub-VI, and you may not know how to do that ...).  I'd advocate doing the entire thing in LabVIEW -- it will be simpler, easier to debug (I think), and probably faster.

 

Bob Schor

0 Kudos
Message 2 of 3
(3,226 Views)