Digital Signal Processing Reference
In-Depth Information
h w ð1Þ¼hð1Þw ham ð1Þ¼0:01558 0:54 ¼ 0:00841
h w ð2Þ¼hð2Þw ham ð2Þ¼0:09355 0:08 ¼ 0:00748
h w ð1Þ¼hð1Þw ham ð1Þ¼0:00841
h w ð2Þ¼hð2Þw ham ð2Þ¼0:00748
Thus, delaying h w ðnÞ by M ¼ 2 samples gives
b 0 ¼ b 4 ¼ 0:00748; b 1 ¼ b 3 ¼ 0:00841;
and
b 2 ¼ 0:9
b. The transfer function is
HðzÞ¼0:00748 þ 0:00841z 1 þ 0:9z 2 þ 0:00841z 3 þ 0:00748z 4
The following design examples are demonstrated using MATLAB programs. The MATLAB
function firwd(N, Ftype, WnL, WnH, Wtype) is listed in the “MATLAB Programs” section at the
end of this chapter. Table 7.5 lists comments to show how the function is used.
Table 7.5 Illustration of the MATLAB Function for FIR Filter Design Using Window Methods
function B
¼
firwd(N,Ftype,WnL,WnH,Wtype)
%B
firwd(N,Ftype,WnL,WnH,Wtype)
% FIR filter design using the window function method.
% Input parameters:
% N: the number of the FIR filter taps.
% Note: It must be odd number.
% Ftype: the filter type
% 1. Lowpass filter
% 2. Highpass filter
% 3. Bandpass filter
% 4. Band reject (Bandstop) filter
% WnL: lower cutoff frequency in radians. Set WnL¼0 for the highpass filter.
% WnH: upper cutoff frequency in radians. Set WnH¼0 for the lowpass filter.
% Wtypw: window function type
%
¼
1. Rectangular window
%
2. Triangular window
%
3. Hanning window
%
4. Hamming window
%
5. Blackman window
 
Search WWH ::




Custom Search