Digital Signal Processing Reference
In-Depth Information
Input N , x i ( i = 1,2,…, M ), h j ( j = 1,2,…, L +1)
{ N is the data block size and FFT size. It should be greater than filter length L +1}
{ h is zero padded out to N }
yout (1 to M ) = 0 { M is the length of data before sectioning into blocks }
y (1 to N ) = 0 { initialize y and yout to block size N }
H F = FFT( h , N )
P = floor(( M-N )/( N- L) + 1) { P is the number of blocks given M , N , and L }
for r = 1 to P
for j = 1 to N
d j = x j + ( r -1)*( N-L ) { get next block of samples }
end
D F = FFT( d , N )
y = Re{IFFT( D F . H F )} { Re{} means the real part of {}if x is real }
for j = 1 to N-L/2
yout j + ( r -1)*( N-L ) = y j { Take first N - L results; discard last L }
end
end
yout = shift( yout,L/ 2) { This is the circular shift function of Figure 2.12 }
Figure 2.13 Pseudocode to implement filtering in the frequency domain.
frequency component, 0.5sin(
0.02 t ), is passed while the upper is rejected.
The pass-band performance of the filter could be determined by the extent of
the difference between the expected lower frequency component 0.5sin(
0.02 t )
and the filter output. Figure 2.14(c) shows this error for the output shown in part
(b). Note that the peak-to-peak error is 7.6
10 -6 . This matches well the predicted
×
10 -6 at normalized frequency of 0.02, shown in part (d) of
the figure. Although the low-pass filter has a specified cutoff at 0.2, the effective
bandwidth for precision work is only 0.1. Note further that if the signal were
corrupted with white noise, this second filtering operation as shown in (b), would
remove 80% of the noise. Filtering of noisy data will be discussed later in Section
2.9. In the next section, we will use the low-pass filter as a building block for
other filter types, such as high-pass and band-pass filters.
pass-band error of 6.7
×
2.6 THE LOW-PASS FILTER AS A BUILDING BLOCK
In this section, the low-pass filter is used as a fundamental building block to build
common filters as well as more complex structures. Interestingly, when designing
filters from low-pass blocks, it is customary to work with the impulse response
functions (i.e., in the time domain), but to the untrained eye these functions do not
convey much. In fact, the design is best understood in the frequency domain. The
reason for this type of cross-referencing is that the impulse response is
mathematically well defined in the time domain (2.2), but the filtering operation is
best understood in the Fourier space in terms of signals that are blocked and those
that are passed. In the following subsections, the all-pass, high-pass, band-pass,
 
Search WWH ::




Custom Search