Frequency Response from Poles and Zeros

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

CHAPTER 5 Frequency Analysis: The Fourier Transform

5.7.3 Frequency Response from Poles and Zeros

Given a rational transfer functionH(s)=B(s)/A(s), to calculate its frequency response we lets=j and find the magnitude and phase for a discrete set of frequencies. This can be done using MATLAB.

A geometric way to obtain an approximate magnitude and phase frequency responses is using the effects of zeros and poles on the frequency response of a system.

Consider a function

G(s)= sz sp

with a zerozand a polep, as shown in Figure 5.10. The frequency response corresponding toG(s)at some frequency0is found by lettings=j0, or

G(s)|s=j0 = j0−z j0−p

Representingj0,z, andp, which are complex numbers, as vectors coming from the origin, then the vectorZE(0)=j0−z(adding toZE(0)the vector corresponding tozgives a vector corresponding toj0) goes from the zeroztoj0, and likewise the vectorPE(0)=j0−pgoes from the polepto j0. The argument0in the vectors indicates that the magnitude and phase of these vectors depend on the frequency at which we are finding the frequency response. As we change the frequency at which we are finding the frequency response, the lengths and the phases of these vectors change.

Therefore,

G(j0)= ZE(0)

PE(0) =|EZ(0)|

|EP(0)|ej(∠ZE(0)−∠PE(0)) and the magnitude response is

|G(j0)| = |EZ(0)|

|EP(0)| (5.23)

and the phase response is

G(j0)=∠Z(E 0)−∠EP(0) (5.24)

FIGURE 5.10

Geometric interpretation of poles and zeros.

jΩ0

Z(Ω0) P→(Ω0) →

p z

s-plane

So that for 0≤0 <∞, if we compute the length and the angle ofZE(0)andEP(0), the ratio of these lengths gives the magnitude response and the difference of their angles gives the phase response.

For a filter with a transfer function

H(s)= Q

i(szi) Q

k(spk)

wherezi,pkare zeros and poles of H(s) with vectorsZEi()=j−ziandPEk()=j−pk, going from each of the zeros and poles to the frequency at which we are computing the magnitude and phase response in thej

axis, gives

H(j)=H(s)|s=j= Q

iZEi() Q

kPEk()

= Q

i|EZi()|

Q k|EPk()|

| {z }

|H(j)|

ej hP

i∠(ZEi())−P

k∠(PEk()i

| {z }

ejH(j)

(5.25)

nExample 5.17

Consider series RC circuit with a voltage sourcevi(t). Choose the output to obtain low-pass and high-pass filters and use the poles and zeros of the transfer functions to determine their frequency responses. LetR=1,C=1 F, and the initial conditions be zero.

Solution

n Low-pass filter:Let the output be the voltage across the capacitor. By voltage division, we obtain that the transfer function of the filter is

H(s)= VC(s)

Vi(s) = 1/Cs R+1/Cs

For dc frequency, the capacitor behaves as an open circuit so that the output voltage equals the input voltage, and for very high frequencies the impedance of the capacitor tends to zero so that the voltage across the capacitor also goes to zero. This is a low-pass filter.

LetR=1andC=1 F, so

H(j)= 1

1+j = 1 PE()

Drawing a vector from the poles= −1 to any point on thejaxis givesP(), and for differentE frequencies we get

=0 P(0)E =1ej0

=1 P(1)E =√ 2ejπ/4

= ∞ PE(∞)= ∞ejπ/2

5.7 Convolution and Filtering 339

Since there are no zeros, the frequency response of this filter depends inversely on the behavior of the pole vectorPE(). The frequency responses for these three frequencies are:

H(j0)=1ej0 H(j1)=0.707ejπ/4 H(j∞)=0ejπ/2

Thus, the magnitude response is unity at=0 and it decays as the frequency increases. The phase is zero at=0,−π/4 at=1, and−π/2 at→ ∞. The magnitude response is even and the phase response is odd.

n High-pass filter:Consider then the output being the voltage across the resistor. Again by voltage division we obtain the transfer function of this circuit as

H(s)=Vr(s)

Vs(s) = CRs CRs+1 Again, letC=R=1, so the frequency response is

H(j)= j

1+j= ZE() PE()

The vectorZE()goes from zero at the origins=0 tojin thejaxis, and the vectorPE() goes from the poles= −1 tojin thejaxis. The vectors and the frequency response, at three different frequencies, are given by

=0 P(0)E =1ej0 Z(0)E =0ejπ/2 H(j0)=ZE(0)

PE(0) =0ejπ/2

=1 PE(1)=√

2ejπ/4 ZE(1)=1ejπ/2 H(j1)= ZE(1)

PE(1)=0.707ejπ/4

= ∞ PE(∞)= ∞ejπ/2 ZE(∞)= ∞ejπ/2 H(j∞)=ZE(∞) PE(∞) =1ej0

Thus, the magnitude response is zero at=0 (this is due to the zero ats=0, makingZE(0)=0 as it is right on top of the zero), and it grows to unity as the frequency increases (at very high frequency, the lengths of the pole and the zero vectors are alike and so the magnitude response

is unity and the phase response is zero). n

Remarks

n Poles create “hills” at frequencies in the jaxis in front of the poles imaginary parts. The closer the pole is to the jaxis, the narrower and higher the hill. If, for instance, the poles are on the jaxis (this would correspond to an unstable and useless filter) the frequency response at the frequency of the poles will be infinity.

n Zeros create “valleys” at the frequencies in the jaxis in front of the zeros imaginary parts. The closer the zero is to the jaxis (from its left or its right, as the zeros are not restricted by stability to be in the open left-hand s-plane) the closer the frequency response is to zero. If the zeros are on the jaxis, the frequency response at the frequency of the zeros is zero. Thus, poles produce frequency responses that look like hills (or like the main pole in a circus) around the frequencies of the poles, and zeros make the frequency response go to zero in the form of valleys around the frequencies of the zeros.

nExample 5.18

Use MATLAB to find and plot the poles and zeros and the corresponding magnitude and phase frequency responses of:

(a) A second-order band-pass filter and a high-pass filter realized using a series connection of a resistor, an inductor, and a capacitor, each with unit resistance, inductance, and capacitance.

Let the input be a voltage sourcevs(t)and initial conditions be zero.

(b) An all-pass filter with a transfer function

H(s)=s2−2.5s+1 s2+2.5s+1 Solution

Our functionfreq resp scomputes and plots the poles and the zeros of the filter transfer function and the corresponding frequency response (the function requests the coefficients of its numerator and denominator in decreasing order of powers ofs).

(a) As from a Example 5.16, the transfer functions of the band-pass and high-pass second-order filters are

Hbp(s)= s s2+s+1 Hhp(s)= s2

s2+s+1

The denominator in the two cases is exactly the same since the values ofR,L, andCremain the same for the two filters—the only difference is in the numerator.

To compute the frequency response of these filters and to plot their poles and zeros, we used the following script, which uses two functions: freqresp s, which we give below, and splane, which plots the poles and zeros. The coefficients of the numerator and the denomi- nator correspond to the coefficients, from the highest to the lowest order ofs, of the transfer function.

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

% Example 5.18---Frequency response

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

n = [0 1 0]; % numerator coefficients -- bandpass

% n = [1 0 0]; % numerator coefficients -- highpass d = [1 1 1]; % denominator coefficients

5.7 Convolution and Filtering 341

wmax = 10; % maximum frequency

[w, Hm, Ha] = freqresp s(n, d, wmax); % frequency response splane(n, d) % plotting of poles and zeros

The following is the functionfreqresp sused to compute the magnitude and phase response of the filter with the given numerator and denominator coefficients.

function [w, Hm, Ha] = freqresp s(b, a, wmax) w = 0:0.01:wmax;

H = freqs(b, a, w);

Hm = abs(H); % magnitude

Ha = angle(H)∗180/pi; % phase in degrees

n Band-pass filter: Letting the output of the filter be the voltage across resistor, we find that the transfer function has a zero at zero, so that the frequency response is zero at=0.

Whengoes to infinity, one of the two poles cancels the zero effect so that the other pole makes the frequency response tend to zero.

n High-pass filter: When the output of the filter is the voltage across the inductor the filter is high pass. In this case there is a double zero ats=0, and the poles are located as before.

Thus, when=0 the magnitude response is zero due to the double zeros at zero, and when goes to infinity the effect of two poles and the two zeros cancel out giving a constant magnitude response, which corresponds to a high-pass filter.

The results for the band-pass and the high-pass filters are shown in Figure 5.11. Notice that the frequency response of the band-pass and the high-pass filter is determined by the ’number’

of zeros at the origin. The ’location’ of zeros, like in the all-pass filter we consider next, also determines the frequency response.

(b) All-pass filter:The poles and the zeros of an all-pass filter have the same imaginary parts, but the negative of its real part. At any frequency in thej-axis the lengths of the vectors from the poles equal the length of the vectors from the zeros to the frequency in thejaxis. Thus the magnitude response of the filter is unity. The following changes to the above script are needed for the all-pass filter:

clear all clf

n = [1 −2.5 1];

d = [1 2.5 1];

wmax = 10;

freq resp s(n, d, wmax)

The results are shown in Figure 5.12. n

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

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

(769 trang)