Signals and Systems - Electrical Engineering

(avery) #1

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.1

0

0.1

0.2

h[

n]

n

− 80
− 100

− 60

− 40

− 20

0

20log10|

H(

je
ω)|(dB)

0 0.5 1
ω/π

0 0.5 1

0

0.2

0.4

0.6

0.8

1

ω/π

|H

(e


)|

− 2

0

2

4

6

<H

(e


)

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)
%
Free download pdf