Design of Chebyshev Low-Pass Discrete Filters

Một phần của tài liệu Signals and systems using matlab (Trang 683 - 689)

CHAPTER 11 Introduction to the Design of Discrete Filters

11.4.3 Design of Chebyshev Low-Pass Discrete Filters

The design of Chebyshev low-pass filters is very similar to the design of Butterworth low-pass filters.

The constantKcof the bilinear transform for the Chebyshev filter is calculated by transforming the normalized pass frequency0p=1into the discrete frequencyωp:

Kc= 1

tan(0.5ωp) (11.32)

11.4 IIR Filter Design 667

Replacing

0= 

p =Kctan(0.5ω)= tan(0.5ω)

tan(0.5ωp) (11.33)

into the magnitude-squared function for the Chebyshev analog filter it yields the magnitude-squared function of the discrete Chebyshev low-pass filter,

|HN(ejω)|2= 1

1+ε2C2N(tan(0.5ω)/tan(0.5ωp)) (11.34) whereC(.)are the Chebyshev polynomials of the first kind encountered before in the analog design. The ripple parameter remains the same as in the analog design (since it does not depend on frequency):

ε=(100.1αmax−1)1/2 (11.35)

while using the warping relation between the continuous and discrete frequencies gives that the minimal order of the filter is

N≥ cosh−1[(100.1αmin−1)/(100.1αmax−1)]1/2

cosh−1[tan(0.5ωst)/tan(0.5ωp)] (11.36) and that the half-power frequency can be found to be

ωhp=2 tan−1

tan(0.5ωp)cosh 1

Ncosh−1 1

ε

(11.37)

After calculating these parameters, the transfer function of the Chebyshev discrete filter is found by transforming the Chebyshev analog filter of orderNinto a discrete filter using the bilinear transformation

HN(z)=HN(s)|s=Kc(1−z−1)/(1+z−1) (11.38)

Remarks

n Just as with the Butterworth filter, the equations for the filter parameters(Nhp)can be obtained from the analog formulas by substituting

st

p =Kctan(0.5ωst)= tan(0.5ωst) tan(0.5ωp)

n The filter parameters (Nhp,ε) can also be found from the loss function, obtained from the discrete Chebyshev squared magnitude,

α(ejω)=10 log10

1+ε2C2N

tan(0.5ω) tan(0.5ωp)

(11.39)

This is done by following a similar approach to the one in the analog case.

n Like in the discrete Butterworth, for Chebyshev filters the dc gain (i.e., gain atω=0) can be set to any desired value by allowing a constant gain G in the numerator such that

|HN(ej0)| = |HN(1)| =G|N(1)|

|D(1)| =desired gain (11.40)

n MATLAB provides two functions to design Chebyshev filters. The functioncheby1 is for designing the filters covered in this section, whilecheby2is to design filters with a flat response in the passband and with ripples in the stopband. The order of the filter is found usingcheb1ordandcheb2ord. The functions cheby1andcheby2will give the filter coefficients.

nExample 11.9

Consider the design of two low-pass Chebyshev filters. The specifications for the first filter are:

α(ej0)=0 dB

ωp=0.47πrad αmax=2 dB ωst =0.6πrad αmin=6 dB

For the second filter, let ωp=0.48π rad and keep the other specifications. Determine the half- power frequency of the two filters. Use MATLAB for the design.

Solution

We obtained in Example 11.7 a third-order Butterworth low-pass filter that satisfies the specifica- tions of the first filter. According to the results in this example a second-order Chebyshev filter satisfies the same specifications. It is always so that a Chebyshev filter satisfies the same specifica- tions as a Butterworth with a lower order. For the second filter we narrow the transition band by 0.01πradians, and so the order increases by one. The following is the script for the design of the two filters.

%%%%%%%%%%%%%%%%%%%%%%%%%

% Example 11.9---LP Chebyshev

%%%%%%%%%%%%%%%%%%%%%%%%%

alphamax = 2; alphamin = 9; % loss specs figure(1)

for i = 1:2,

wp = 0.47 + (i-1)∗0.01; ws = 0.6; % normalized frequency specs [N,wn] = cheb1ord(wp,ws,alphamax,alphamin)

[b,a] = cheby1(N,alphamax,wn);

wp = wp∗pi;

% magnitude and phase

[H,w] = freqz(b,a); w = w/pi; M = length(H);H = H/H(1);

% to verify specs

spec0 = zeros(1,M); spec1 = alphamax∗ones(1,M)∗(-1)ˆ(N+1);

spec2 = alphamin∗ones(1,M);

alpha = -20∗log10(abs(H));

11.4 IIR Filter Design 669

hpf = (3.01 + alpha(1))∗ones(1,M);

% epsilon and half-power frequency epsi = sqrt(10ˆ(0.1∗alphamax)-1);

whp = 2∗atan(tan(0.5∗wp)∗cosh(acosh(sqrt(10ˆ(0.1∗3.01)-1)/epsi)/N));

whp = whp/pi

% plotting

subplot(221); zplane(b,a) subplot(222)

plot(w,abs(H)); grid; axis([0 max(w) 0 1.1∗max(abs(H))]) subplot(223)

plot(w,unwrap(angle(H)));grid;

subplot(224) plot(w,alpha);

hold on; plot(w,spec0,‘r’); hold on; plot(w,spec1,‘r’) hold on; plot(w,hpf,‘k’); hold on

plot(w,spec2,‘r’); grid; axis([0 max(w) 1.1∗min(alpha) 1.1∗(alpha(1) + 3)]);

hold off figure(2) end

The transfer function of the first filter is

H1(z)= 0.224+0.449z−1+0.224z−2 1−0.264z−1+0.394z−2

and its half-power frequency isωhp=0.493πrad. The second-order filter has a transfer function of H2(z)=0.094+0.283z−1+0.283z−2+0.094z−3

1−0.691z−1+0.774z−2−0.327z−3

and a half-power frequency ofωhp=0.4902π. The poles and the zeros as well as the magnitude and the phase responses of the two filters are shown in Figure 11.16. Notice the difference in the gain (or losses) in the passband of the two filters. In order for the dc gain to be unity, the gain in the even-order filter reaches values above 1, while the odd-order filter does the opposite.

The cut-off frequency given as output bycheb1ordand thatcheby1uses isωp. Since the half power is not given bycheb1ord, the half-power frequency of the filter is calculated using the minimal order N, the ripple factorε, and the passband frequencyωpin Equation (11.37). See the script. n

nExample 11.10

Consider the following specifications of a filter that will be used to filter an acoustic signal:

dc gain=10

Half-power frequency: fhp=4 KHz

Band-stop frequency: fst =5 Khz, αmin=60 dB Sampling frequency: fs=20 KHz

−1 0 1

−1

−0.5 0 0.5 1

2

Imaginary part

0 0.2 0.4 0.6 0.8 0

0.5 1

|H(e)||H(e)|

−1 −0.5 0 0.5 1

−1

−0.5 0 0.5 1

3

Real part

Imaginary part

0 0.2 0.4 0.6 0.8 0

0.2 0.4 0.6 0.8 1

0 0.5 1

−5

−4

−3

−2

−1 0

0 0.2 0.4 0.6 0.8 0

1 2 3

Real part ω/pi

<H(e)

ω/pi

ω/π ω/π

α(ω)dB

0 0.5 1

−4

−3

−2

−1 0

0 0.2 0.4 0.6 0.8

−2

−1 0 1 2 3

<H(e)

ω/π ω/π

α(ω)dB

(a)

(b) FIGURE 11.16

Two Chebyshev filters with different transition bands: (a) even-order filter forωp=0.47π, and (b) odd-order filter forωp=0.48π(narrower transition band).

11.4 IIR Filter Design 671

FIGURE 11.17

Equal-order(N=15)(a) Butterworth and (b) Chebyshev filters for filtering of

acoustic signal. (b)

(a)

−1 0 1

−1

−0.5 0 0.5 1

Real part

Imaginary part

0 2000 4000 6000 8000 0

2 4 6 8 10

|H(f)|

f(Hz)

0 2000 4000 6000 8000

−40

−30

−20

−10 0

<H(f)

f(Hz)

0

−20

−10 0 10 20

α(ω)dB

f(Hz) 2000 4000 6000 8000

−1 0 1

−1

−0.5 0 0.5 1

Real part

Imaginary part

0 2000 4000 6000 8000 0

2 4 6 8 10

|H(f)|

f(Hz)

0 2000 4000 6000 8000

−40

−30

−20

−10 0

<H(f)

f(Hz)

0 2000 4000 6000 8000

−20

−10 0 10 20

α(ω)dB

f(Hz)

Design a Butterworth and a Chebyshev low-pass filters of the same order and compare their frequency responses.

Solution

The specifications of the discrete filter are:

dc gain=10⇒α(ej0)= −20 dB

Half-power frequency: ωhp=2πfhp(1/fs)=0.4πrad Band-stop frequency: ωst=2πfst(1/fs)=0.5πrad

When designing the Butterworth filter we only need to find the minimal orderNgiven that the half-power frequency is specified. We find thatN=15 satisfies the specifications. Using this value with the given discrete half-power frequency the functionbuttergives the coefficients of the filter.

See Figure 11.17 for the results.

The design of the Chebyshev filter with orderN=15 and half-power frequencyωhp=0.4πcannot be done directly with the functioncheby1, as we do not have the passband frequencyωp. Using the equation to compute the half-power frequency, we solve forωpafter we give a value toαmax

(arbitrarily chosen to be 0.001 dB), which allows us to compute the ripple factorε. See the script part corresponding to the Chebyshev design. The function cheby1with inputsN, αmax, andωp

gives the coefficients of the designed filter. Using the coefficients we plot the poles and the zeros, the magnitude and the phase responses, and the loss function, as shown in Figure 11.17. According to the loss function plots the Chebyshev filter displays a sharper response in the transition band than the Butterworth filter, as expected.

% Butterworth/Chebyshev filters for analog signal

wh = 0.4∗pi;ws = 0.5∗pi; alphamin = 40;Fs = 20000;

% Butterworth

N = log10((10ˆ(0.1∗alphamin)-1))/(2∗log10(tan(ws/2)/tan(wh/2))); N = ceil(N)

% [b,a] = butter(N,wh/pi); % to get Butterworth filter get rid of ‘ % ’

% Chebyshev alphamax = 0.001;

epsi = sqrt(10ˆ(0.1∗alphamax)-1);

% computation of wp for Chebyshev design

wp = 2∗atan(tan(0.5∗wh)/(cosh(acosh(sqrt(10ˆ(0.1∗3.01)-1)/epsi)/N))); wp = wp/pi;

[b,a] = cheby1(N,alphamax,wp);

% magnitude and phase

[H,w] = freqz(b,a);w = w/pi;M = length(H);f = w∗Fs/2;

alpha0 = -20;H = H∗10;

% to verify specs

spec2 = alpha0 + alphamin∗ones(1,M);

hpf = alpha0 + 3.01∗ones(1,M);

alpha = -20∗log10(abs(H));

Ha = unwrap(angle(H)); n

Một phần của tài liệu Signals and systems using matlab (Trang 683 - 689)

Tải bản đầy đủ (PDF)

(769 trang)