Digital Signal Processing Reference
In-Depth Information
3.2.2 Mean of a Given Sequence
Finding the mean of a given sequence is another application for an MA filter.
However, the mean of a sequence of length N can also be found recursively,
resulting in an AR filter. We derived this in (1.41). It is given as
u k
1
1 þ 1
1
N þ 1
k ¼
k 1 þ
ð 3
:
3 Þ
=
N
¼ a 1 k 1 þ b 1 u k where
a 1 þ b 1 ¼ 1
:
ð 3
:
4 Þ
Another filter commonly used is an exponential weighted-averaging filter with
similar structure (also known as a fading filter); it is given as
y k ¼ y k 1 þð 1 Þ u k :
ð 3
:
5 Þ
This filter is used for finding out the mean when distant values are of no signi-
ficance. In fact there is no difference between the filters in (3.4) and (3.5); it is only
the contexts that are different. The solution for (3.5) is of the form y k ¼ð A
Þ u k ,
where A is a constant that can be obtained from the initial conditions and
represents convolution. The general choice of the coefficient is 0
k
:
8 0
:
95.
3.2.3 Mean over a Fixed Number of Samples
The filter in (3.4) finds the mean of a given set of samples. However, on many
occasions, we need to find continuously the mean over a fixed number of samples.
This can be done using the filter in (3.5), but then the far samples are weighted low
compared to the near samples.
Consider the case when we need to compute the mean (
k )overn ¼ k to
n ¼ k þ N 1 for the given time series u k as shown in Figure 3.2. This is
1.5
k
+
N
1
k
0.5
0
-0.5
-1
0
20
40
60
80
100
120
140
160
180
20
k
Figure 3.2 Rectangular moving filter
Search WWH ::




Custom Search