Sie sind auf Seite 1von 2

Implementation of a mobile averaging filter

Jorge Benjamn Magaa Zaldvar


Departamento de Ingeniera Elctrica y Electrnica
ITM
Mrida, Mxico
Jorge.magana@tecmotul.org

Abstract This article presents the implementation of a moving
average filter, trying different values for N, for the removal of
noise in an audio signal "wav" format.
I. INTRODUCTION (HEADING 1)
This Article deals with the implementation of a simple
average filter called mobile, this technique is used when you
want to give more weight to more recent data sets to obtain the
forecast. The forecast is obtained by calculating the arithmetic
mean of the most recent data set selected. Every time you have
a new observation is added to the dataset, and it is removed
from observation or oldest data. The number of more recent
data to be considered in the set of observations which is
calculated the arithmetic mean is a decision made by the
analyst forecast; the sensitivity to changes in the behavior of
the series is reduced by using a larger number of observations
in the data set. This model does not handle very well the data
with seasonality or trend but if it does better than the simple
average technique.
The paper presents the implementation, followed by a
methodology where the procedure used for implementing the
PM filter is explained. In the results section the results
obtained after implementing the filter to the noisy signal and
finally a section where how we can improve the proposed
filter is described.
II. IMPLEMENTATION
There are different ways to reduce noise in audio signals,
where you can use different filters. In the present
investigation it is decided to use a mobile averaging filter,
often used to reduce the amount of noise that may present a
signal. The way in which the noise-reducing filter is through
a given in equation (1) algorithm.
()

[[] [ ] [ ]
[ ]] (1)
Where N is a positive integer and x (n) is applied to the
filter response y (n) is the resulting output response.
From equation (1) we see that the output y (n)at the same
time n the PM filter N points, is the average of the N input
values to equation (2) shown.
[] [ ] [ ] [ ] (2)

The term "N-point" refers to the number of input values
used to compute the filter output.
In theory if the value of N becomes large enough noise
could be reduced as desired.

III. METHODOLOGY
The procedure to test the effect of moving averaging filter
is described below.
First the audio file in MatLab software was sampled
through the "wavread" function to save a file in "wav" format
in a given vector. For the sampling frequency should be
writing the "[x, y] = wavread ('name')" where the "x" is the
vector of "and" the sampling frequency, the part will be taken
"name" the file name is written without the extension.
Then the white noise in the MatLab software was generated
using the "rand" that generates an nxn matrix elements of
random value between 0 and 1 to an audio function.
Before adding the noise to the audio signal must be
normalized audio signal, obtaining two signals on the same
scale.
The output of the sum of the two signals is the signal that is
applied to the PM filter.
Based on equation (1) "for" function which can be seen in
Figure 1 is implemented.

Figure 1. Moving Average Filter

Tests were conducted with different values of N.

IV. RESULTS
For values of N = 3, one can see in Figure 2 a slight
decrease of the noise.
For values of N = 5, it can be seen in Figure 3 further
decrease the noise by using N = 3.
For values of N = 10, it can be seen in Figure 4 further
decrease the noise by using N = 3.



Figura 2. Filtro PM con N=3

.

V. MEJORAS
Se pueden obtener un mejor resultado en la disminucin del
ruido al aumentar el valor de N, pero se debe tener en cuenta
que tambin se ve afectada la seal que queremos filtrar. Para
un mejor filtrado se deben utilizar otros filtros que ayuden a
mantener intacta la seal a filtrar.

[1] Edward w. Kamen, Fundamentos de Seales y Sistemas,
3rd ed., Mxico, 2008, pp.2730.








Figura 3. Filtro PM con N=5
Figura 4. Filtro PM con N=10

Das könnte Ihnen auch gefallen