Digital Signal Processing Reference
In-Depth Information
In some applications where L is relatively large, the number of operations (i.e.,
involving multiplications and additions) could be reduced by about 50% if the
symmetry property in (2.5) is exploited. In that case, (2.10) becomes
L
1
2
=
(2.11)
y
=
h
x
+
h
(
x
+
x
)
m
=
1
2
,
N
L
L
L
L
k
k
+
m
1
L
k
+
m
+
1
+
1
+
m
K
+
m
2
2
k
1
2
This means that only L /2+1 filter coefficients need to be stored, so that more
memory becomes available. This procedure can also be expressed in pseudocode
as shown in Figure 2.9( b ). Within the Matlab
environment, the filter function is
used to realize the above operation as
y = filter(h,1,x) (2.12)
where y is the filtered output, h is the filter coefficients, and x is the input data.
A noteworthy point here is that any filter selected from our collection should
be normalized by dividing by K = 512, unless otherwise indicated. This comes
from the way in which the impulse response function is defined in equation (2.2).
Although not a requirement, this gives us the benefit of recording the values in
printed format to 4 decimal places with a resolution of 2
10 − 7 , corresponding to
22-bit precision. This is useful in most applications, but where higher resolution is
required, these must be obtained from the accompanying compact disc.
×
2.5.2 Direct Method - Concurrent Processing
The direct method is easily adapted to real time filter processing. In this
adaptation, a new filtered value is clocked out at the same rate at which data is
clocked in, where the data is assumed to have come from an analog-to-digital
converter (ADC) or other processor. Of course, the maximum clock rate is limited
by the processing time of the core filter operation as determined by the sum of the
products of the filter coefficients and data (defined by (2.11)).
This real time filtering procedure setting up a temporary data array whose
length is the same as that of the filter involves array, say L +1. Data enter at
position L +1 along the array. On each cycle, existing data are then shifted one
position along the data array and the most recent datum added to the ( L +1)th
position. The oldest datum x 1 , corresponding to position 1 along the data array is
shifted out and discarded. On each cycle, the coefficients in the filter array are
multiplied with corresponding elements of the data array and summed to yield the
current filtered output. Figure 2.10 illustrates this process and gives a pseudocode
for its implementation. Note that this is identical to the offline procedure shown in
Figure 2.9, except that the data array for concurrent processing is conceptually
 
Search WWH ::




Custom Search