ECE 2610 Signal and Systems 6–1 Frequency Response of FIR Filters This chapter continues the study of FIR filters from Chapter 5, but the emphasis is frequency response, which relates to how the filter responds to an input of the form . A fundamental result we shall soon see, is that the frequency response and impulse response are related through an operation known as the Fourier transform. The Fourier transform itself is not however formally studied in this chapter. Sinusoidal Response of FIR Systems • Consider an FIR filter when the input is a complex sinusoid of the form , (6.1) where it could be that was obtained by sampling the complex sinusoid and • From the difference equation for an tap FIR filter, (6.2) xn e j ˆ 0 n – n = xn Ae j e j ˆ 0 n – n = xn xt Ae j e j 0 t = ˆ 0 0 T s = M 1 + yn b k xn k – k 0 = M b k Ae j e j ˆ 0 n k – k 0 = M = = Chapter 6
32
Embed
Frequency Response Chapter of FIR Filtersmwickert/ece2610/lecture_notes/... · Sinusoidal Response of FIR Systems ECE 2610 Signals and Systems 6–2 (6.3) where we have defined for
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
er
Frequency Response of FIR FiltersThis chapter continues the study of FIR filters from Chapter 5,but the emphasis is frequency response, which relates to how thefilter responds to an input of the form
.
A fundamental result we shall soon see, is that the frequencyresponse and impulse response are related through an operationknown as the Fourier transform. The Fourier transform itself isnot however formally studied in this chapter.
Sinusoidal Response of FIR Systems
• Consider an FIR filter when the input is a complex sinusoidof the form
, (6.1)
where it could be that was obtained by sampling thecomplex sinusoid and
• From the difference equation for an tap FIR filter,
(6.2)
x n ej0n – n =
x n Aejej0n – n =
x n x t Ae
jej0t= 0 0Ts=
M 1+
y n bkx n k– k 0=
M
bkAejej0 n k–
k 0=
M
= =
Chapt
6
ECE 2610 Signal and Systems 6–1
Sinusoidal Response of FIR Systems
(6.3)
where we have defined for arbitrary
(6.4)
to be the frequency response of the FIR filter
• Note: The notation is used rather than say , tobe consistent with the z-transform which will defined inChapter 7, and to emphasize the fact that the frequencyresponse is periodic, with period (more on this later)
– Note: , where sine and cosine areboth functions
• Returning to (6.2), the implication is that when the input is acomplex exponential at frequency , the output is also acomplex exponential at frequency
• The complex amplitude (magnitude and phase) of the input ischanged as a result of passing through the system
– The frequency response at multiplies the input ampli-tude to produce the output
– It is not true in general that , butonly for the special case of a complex sinusoidapplied starting at
y n Aejej0n
bkej– 0k
k 0=
M
=
Aejej0n
H ej0 – n =
H ej bke
j– k
k 0=
M
=
H ej H
2
ej j sin+cos=mod 2
0
0
0
y n H ej0 x n =x n
–
ECE 2610 Signals and Systems 6–2
Sinusoidal Response of FIR Systems
• The frequency response is a complex function of that isgenerally viewed in either polar or rectangular form
(6.5)
– The polar or magnitude and phase form is perhaps themost common
• The polar form offers the following interpretation of interms of , when the input is a complex sinusoid
(6.6)
– Here we see that the input amplitude is multiplied by thefrequency response amplitude, and the input phase hasadded to it the frequency response phase
– The output amplitude expression means that isalso termed the gain of an LTI system
Example:
• The frequency response of this FIR filter is
H ej H e
j ej H ej =
Re H ej jIm H e
j +=
y n x n
y n H ej ej H ej
Aejejn
=
H ej Aej H ej +
ejn
=
H e j
bk 1 1 3 1 1 =
H ej bke
jk–
k 0=
4
=
1 ej–
3ej– 2
ej– 3
ej– 4
+ + + +=
ECE 2610 Signals and Systems 6–3
Sinusoidal Response of FIR Systems
– We have used the inverse Euler formula for cosine twice
• For this particular filter we have that
Why?
• Use MATLAB to plot the magnitude and phase response>> w = 0:2*pi/200:2*pi;>> H = exp(-j*2*w).*(3 + 2*cos(w) + 2*cos(2*w));>> subplot(211)>> plot(w,abs(H))>> axis([0 2*pi 0 8])>> grid>> ylabel('Magnitude')>> subplot(212)>> plot(w,angle(H))>> axis([0 2*pi -pi pi])>> grid>> ylabel('Phase (rad)')
H ej e
j2–ej2
ej
3 ej–
ej2–
+ + + + =
ej2–
2 2 2 3+cos+cos =
H ej 3 2 cos 2 2 cos+ +=
H ej 2–=
ECE 2610 Signals and Systems 6–4
Sinusoidal Response of FIR Systems
>> xlabel('hat(\omega) (rad)')
Example: Find for Input
• The input frequency is rad, the amplitude is 5, andthe phase is
• Assuming is input to the 4-tap FIR filter in the previousexample, the filter output is
• The amplitude response or gain at is =3.248; why?
0 1 2 3 4 5 60
2
4
6
8
Mag
nitu
de
0 1 2 3 4 5 6
−2
0
2
Pha
se (
rad)
hat(ω) (rad)
–
2
2
3.248
-2
y n x n 5ej 1 n
=
0 1= 0=
x n
y n 3 2 1 cos 2 2 1 cos+ + e j 1 2 –5ej 1 n
=
16.2415ej2–ejn=
0 1= H ej1
ECE 2610 Signals and Systems 6–5
Superposition and the Frequency Response
Superposition and the Frequency Response
• We can use the linearity of the FIR filter to compute the out-put to a sum of sinusoids input signal
• As a special case we first consider a single real sinusoid
(6.7)
• Using Euler’s formula we expand (6.7)
(6.8)
• The filter output due to each complex sinusoid is known from(6.3), so now using superposition we can write
(6.9)
• We can simplify this result to a nice compact form, if wemake the assumption that the FIR filter has real coefficients
• Special Result: It will be shown in a later section of thischapter that an FIR filter with real coefficients has conjugatesymmetry
(6.10)
– What does this mean?
x n A 0n + cos=
x n A2---ej 0n + A
2---e
j– 0n + +=
y n A2---H e
j0 ej 0n + A2---H e
j– 0 e j– 0n + +=
H ej– H* e
j =
H ej– Re H e
j jIm H ej –=
H ej H e
j – =
ECE 2610 Signals and Systems 6–6
Superposition and the Frequency Response
• We now use (6.10) to simplify (6.9)
(6.11)
• We see that when a real sinusoid passes through an LTI sys-tem, such as an FIR filter (having real coefficients), the out-put is also a real sinusoid which has picked up the magnitudeand phase of the system at
• The generalization (sum of sinusoids) of this result is when
• The function ustep() is defined as:function x = ustep(n,n0)% function x = ustep(n,n0)%% Generate a time shifted unit step sequence x = zeros(size(n)); i_n0 = find(n >= n0);x(i_n0) = ones(size(i_n0));
• If we consider just the steady-state portion of the output weshould be able to discern the same output as obtained fromthe frequency domain analysis of the previous example
• The measurements above agree with the earlier example
5 10 15 208
8.5
9
9.5
10
10.5
11
11.5
12
y[n]
Sample Index n
2 1.6568 3.3138=
x[n] cos() peak
y[n] peaklag 1/2 sample = /8
DC = 10
ECE 2610 Signals and Systems 6–13
Properties of the Frequency Response
Properties of the Frequency Response
Relation to Impulse Response and Difference Equation
• In the definition of the frequency response, , for anFIR filter, the coefficients were utilized
• Similarly given the frequency response, the impulse responsecan be found
• In Chapter 5 we saw that the impulse response and differenceequation are directly related, so in summary given one theother two are easy to obtain
Example:
• Given say
we immediately see that
• The difference equation is
• The frequency response is
H e j bk
Time Domain Frequency Domain
h n h k n k– k 0=
M
= H ej h k e jk–
k 0=
M
=
h n H ej
h n 2 n 3 n 1– 2 n 2– –+=
bk 2 3 2– =
y n 2x n 3x n 1– 2x n 2– –+=
H ej 2 3e
j– 2e
j– 2–+=
ECE 2610 Signals and Systems 6–14
Properties of the Frequency Response
Example: Difference Equation from
• Suppose that
• We immediately can write that
and
• It could have been that
started in this form
Example:
• We need to convert the sine form back to complex exponen-tials
• The impulse response is thus?
H ej
H ej 1 4e
j– 24e
j– 4+ +=
h n n 4 n 2– 4 n 4– + +=
y n x n 4x n 2– 4x n 4– + +=
H ej 1 8e
j2– ej2
ej2–
+2
-----------------------------
+=
1 8ej2–
2 cos+=
H ej 2j 2 e j 2–sin=
H ej 2je
j 2 – ej 2
ej– 2
–2j
----------------------------------
=
1 ej–
–=
ECE 2610 Signals and Systems 6–15
Properties of the Frequency Response
• The difference equation is?
Periodicity of
• For any discrete-time LTI system, the frequency response isperiodic, that is
(6.19)
• The proof for FIR filters follows
(6.20)
• This result is consistent with the fact that sinusoidal signalsare insensitive to frequency shifts, i.e.,
• In summary, the frequency response is unique on at most a interval, say in particular the interval
Conjugate Symmetry
• The frequency response is in general a complexquantity, in most cases obeys certain symmetry properties
H e j
H ej 2+ H e
j
H ej 2+ bke
j 2+ –
k 0=
M
=
bkej–
ej2–
k 0=
M
H ej ==
1
2
x n Xej 2+ n
Xejnej2n
Xejn
= = =
2 –
H ej
ECE 2610 Signals and Systems 6–16
Properties of the Frequency Response
• In particular if the coefficients of a digital filter are real, thatis or , then
(6.21)
proof
(6.22)
• A consequence of conjugate symmetry is that
(6.23)
– We say that the magnitude response is an even function of and the phase is an odd function of
• It also follows that
(6.24)
– We say that the real part response is an even function of and the imaginary part is an odd function of
• When plotting the frequency response we can use the abovesymmetry to just plot over the interval
bk bk*= h k h* k =
Conjugate Symmetry: H ej– H* e
j =
H* ej bke
jk–
k 0=
M
*
bk*ejk
k 0=
M
= =
bkej– – k
k 0=
M
H ej– ==
H ej– H e
j =
H ej– H e
j –=
Re H ej– Re H e
j =
Im H ej– Im H e
j –=
0
ECE 2610 Signals and Systems 6–17
Graphical Representation of the Frequency Response
Graphical Representation of the Frequency Response
• A useful MATLAB function for plotting the frequencyresponse of any discrete-time (digital) filter is freqz()
• The interface to freqz() is similar to filter() in that aand b vectors are again required
– Recall that the b vector holds the FIR coefficients and for FIR filters we set a = 1.
>> help freqz FREQZ Digital filter frequency response. [H,W] = FREQZ(B,A,N) returns the N-point complex frequency response vector H and the N-point frequency vector W in radians/sample of the filter: jw -jw -jmw jw B(e) b(1) + b(2)e + .... + b(m+1)e H(e) = ---- = ------------------------------------ jw -jw -jnw A(e) a(1) + a(2)e + .... + a(n+1)e given numerator and denominator coefficients in vectors B and A. The frequency response is evaluated at N points equally spaced around the upper half of the unit circle. If N isn't specified, it defaults to 512. [H,W] = FREQZ(B,A,N,'whole') uses N points around the whole unit circle. H = FREQZ(B,A,W) returns the frequency response at frequencies designated in vector W, in radians/sample (normally between 0 and pi). [H,F] = FREQZ(B,A,N,Fs) and [H,F] = FREQZ(B,A,N,'whole',Fs) return frequency vector F (in Hz), where Fs is the sampling frequency (in Hz). H = FREQZ(B,A,F,Fs) returns the complex frequency response at the frequencies designated in vector F (in Hz), where Fs is the sampling frequency (in Hz). FREQZ(B,A,...) with no output arguments plots the magnitude and unwrapped phase of the filter in the current figure window. See also filter, fft, invfreqz, fvtool, and freqs.
bk
ECE 2610 Signals and Systems 6–18
Graphical Representation of the Frequency Response