688 C H A P T E R 11: Introduction to the Design of Discrete Filters
FIGURE 11.24
High-pass FIR filter design
using Kaiser window.0 510−0.100.10.2h[n]n− 80
− 100− 60− 40− 20020log10|H(je
ω)|(dB)0 0.5 1
ω/π0 0.5 100.20.40.60.81ω/π|H(ejω)|− 20246<H(ejω
)0 0.5 1
ω/πThe functionfircan be used to design low-pass, high-pass, and band-pass FIR filters using differ-
ent types of windows. When designing high-pass and band-pass FIRs,firfirst designs a prototype
low-pass filter and then uses the modulation property to shift it in frequency to a desired center
frequency.function [b] = fir(N,wc,wo,wind)
%
% FIR filter design using window method and
% frequency modulation
%
% N : order of the FIR filter
% wc : normalized cutoff frequency (between 0 and 1)
% of low-pass prototype
% wo : normalized center frequency (between 0 and 1)
% of high-pass, bandpass filters
% wind : type of window function
% 1 : rectangular
% 2 : hanning
% 3 : hamming
% 4 : kaiser
% [b] : coefficients of designed filter
%
% USE:
% [b] = fir(N,wc,wo,wind)
%