CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
6. Realization of Digital Filters
6.1. Direction-Form I Realization
The digital filter transfer function is given by
π―(π) =
π(π) ππ + ππ πβπ + β― + ππ΄ πβπ΄ π©(π)
=
=
πΏ(π)
π + ππ πβπ + β― + ππ΅ πβπ΅
π¨(π)
This expression can also be written as
π(π) = π―(π)πΏ(π)
Or
ππ + ππ πβπ + β― + ππ΄ πβπ΄
π(π) = (
) πΏ(π)
π + ππ πβπ + β― + ππ΅ πβπ΅
Taking the inverse z-transform of the above equation yields the difference equation
π(π) = ππ π(π) + ππ π(π β π) + β― + ππ΄ π(π β π΄)
βππ π(π β π) β ππ π(π β π) β β― β ππ΅ π(π β π΅)
This difference equation can be implemented by a direct-form I realization. We introduce the
following notation:
π(π)
ππ
ππ β π(π)
Product / Scaling
π(π)
πβπ
π(π β π)
Delay
The direct form I realization of the above difference equation is given in the figure below.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
The direct form I realization of the second order IIR filter (π΅ = π΄ = π) is given by
π(π) = ππ π(π) + ππ π(π β π) + ππ π(π β π) β ππ π(π β π) β ππ π(π β π)
is shown in the diagram below:
6.2. Direction-Form II Realization
Using the digital filter transfer function, we can write
π(π) = π―(π)πΏ(π) =
π©(π)
πΏ(π)
πΏ(π) = π©(π) (
)
π¨(π)
π¨(π)
This expression can also be written as
πΏ(π)
π(π) = (ππ + ππ πβπ + β― + ππ΄ πβπ΄ ) (
)
π + ππ πβπ + β― + ππ΅ πβπ΅
By defining
πΎ(π) =
π + ππ
πβπ
π
πΏ(π)
+ β― + ππ΅ πβπ΅
(1)
(2)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
We have
π(π) = (ππ + ππ πβπ + β― + ππ΄ πβπ΄ )πΎ(π)
(3)
The corresponding difference equations for equations (2) and (3) are
π(π) = π(π) β ππ π(π β π) β ππ π(π β π) β β― β ππ΅ π(π β π΅)
(4)
π(π) = ππ π(π) + ππ π(π β π) + β― + ππ΄ π(π β π΄)
(5)
and
These difference equations can be implemented by a direct-form II realization.
The direct form II realization of the second order IIR filter (π΅ = π΄ = π) is given by the
equations
π(π) = π(π) β ππ π(π β π) β ππ π(π β π)
π(π) = ππ π(π) + ππ π(π β π) + ππ π(π β π)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
is shown in the diagram below:
6.3. Cascade (Series) Realization
The digital filter transfer function can be factorized and written as
π―(π) = π―π (π) β π―π (π) β― π―π (π)
where π―π (π) is chosen to be first- or second-order transfer function (section), defined as,
π―π (π) = (
πππ + πππ πβπ
)
π + πππ πβπ
Or
πππ + πππ πβπ + πππ πβπ
π―π (π) = (
)
π + πππ πβπ + πππ πβπ
The block diagram for the cascade (or series) realization is shown in figure below.
For the individual first- or second-order transfer function (section), one can use either direct
form I or direct form II realizations.
6.4. Parallel Realization
The digital filter transfer function can be written as
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
π―(π) = π―π (π) + π―π (π) + β― + π―π (π)
where π―π (π) is chosen to be first- or second-order transfer function (section), defined as,
πππ
π―π (π) = (
)
π + πππ πβπ
Or
πππ + πππ πβπ
(π)
π―π
=(
)
π + πππ πβπ + πππ πβπ
The block diagram for the parallel realization is shown in figure below.
Here again, for the individual first- or second-order transfer function (section), one can use
either direct form I or direct form II realizations.
Example 13
Given a second-order transfer function
π―(π) =
π. π (π β πβπ )
(π + π. π πβπ + π. ππ πβπ )
Perform the filter realizations and write the difference equations using the following
realizations
(1)
(2)
(3)
Direct form I and direct form II
Cascade form via the first-order sections
Parallel form via the first-order sections
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Solution
Part (1): The transfer function in its βdelayβ form can be written as
π. π β π. π πβπ
π―(π) =
π + π. π πβπ + π. ππ πβπ
Comparing it with the standard delay form of the transfer function
ππ + ππ πβπ + β― + ππ΄ πβπ΄
π―(π) =
π + ππ πβπ + β― + ππ΅ πβπ΅
We identify, that π΄ = π, π΅ = π, and
ππ = π. π,
ππ = π. π,
ππ = π. π,
ππ = π. ππ
ππ = βπ. π
The difference equation form for the direct form I realization is given by
π(π) = π. π π(π) β π. π π(π β π) β π. π π(π β π) β π. ππ π(π β π)
The direct form I realization for this filter is shown in figure below.
For the direct form II realization, we write the difference equation as made up of the
following two difference equations
π(π) = π(π) β π. π π(π β π) β π. ππ π(π β π)
π(π) = π. π π(π) β π. π π(π β π)
The direct form II realization of the filter is shown below in the figure.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Part (2): For the cascade realization, the transfer function is written in the product form. This
is achieved by factorization of the numerator and the denominator polynomials. The given
transfer function is
π―(π) =
π. π(π β πβπ )
π + π. π πβπ + π. ππ πβπ
The numerator polynomial can be factorized as
π©(π) = π. π(π β πβπ ) = π. π (π β πβπ )(π + πβπ )
The denominator polynomial can be factorized as
π¨(π) = π + π. π πβπ + π. ππ πβπ = π + π. π πβπ + π. π πβπ + π. ππ πβπ
= π(π + π. π πβπ ) + π. ππβπ (π + π. π πβπ )
= (π + π. π πβπ )(π + π. ππβπ )
Therefore, the transfer function can be written as
π―(π) =
π. π (π β πβπ )(π + πβπ )
(π + π. π πβπ )(π + π. ππβπ )
Or
π―(π) = (
π. π β π. π πβπ
π + πβπ
)
(
) = π―π (π) β π―π (π)
π + π. π πβπ
π + π. ππβπ
Thus, in this case
π. π β π. π πβπ
π―π (π) =
π + π. π πβπ
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
π―π (π) =
π + πβπ
π + π. ππβπ
Each one of π―π (π) and π―π (π) can be realized in direct form I or direct form II. Overall, we get
the cascaded realization with two sections. It should be noted that there could be other
π+πβπ
forms for π―π (π) and π―π (π), for example, we could have taken π―π (π) = π+π.π πβπ, π―π (π) =
π.πβπ.π πβπ
π+π.ππβπ
, to yield the same π―(π). Using the former π―π (π) and π―π (π), and using direct form
II realizations for the two cascaded sections, we get the following difference equations:
Section 1: (π―π (π) =
π.πβπ.π πβπ
π+π.π πβπ
)
ππ (π) = π(π) β π. π π(π β π)
ππ (π) = π. π ππ (π) β π. π ππ (π β π)
π+πβπ
Section 2: (π―π (π) = π+π.ππβπ )
ππ (π) = ππ (π) β π. π ππ (π β π)
π(π) = ππ (π) + ππ (π β π)
Part (3): For the parallel realization, the transfer function is written in the partial fractionβs
form. The given transfer function is
π―(π) =
π. π(π β πβπ )
π + π. π πβπ + π. ππ πβπ
Multiplying the numerator and denominator with ππ we get
π―(π) =
π. π(ππ β π)
ππ + π. π π + π. ππ
The denominator polynomial can be factorized as
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
π¨(π) = ππ + π. π π + π. ππ = ππ + π. π π + π. π π + π. ππ
= π(π + π. π ) + π. π π (π + π. π ) = (π + π. π)(π + π. π)
Therefore, the transfer function can be written as
π. π(ππ β π)
π―(π) =
(π + π. π )(π + π. π)
Or
π―(π)
π. π(ππ β π)
=
π
π(π + π. π )(π + π. π)
Writing it into partial fractions form,
π―(π) π¨
π©
πͺ
= +
+
π
π (π + π. π ) (π + π. π)
where
π. π(ππ β π)
π. π(ππ β π)
π¨ = π(
)|
=
|
= βπ. ππ
π(π + π. π )(π + π. π) π=π (π + π. π )(π + π. π) π=π
π. π(ππ β π)
π. π(ππ β π)
(π
)
π© = + π. π (
)|
=
|
= βπ. π
π(π + π. π )(π + π. π) π=βπ.π
π(π + π. π) π=βπ.π
π. π(ππ β π)
π. π(ππ β π)
π = (π + π. π ) (
)|
=
|
= π. ππ
π(π + π. π )(π + π. π) π=βπ.π
π(π + π. π) π=βπ.π
Therefore,
π―(π) βπ. ππ
βπ. π
π. ππ
=
+
+
(π + π. π ) (π + π. π)
π
π
Or
π―(π) = βπ. ππ β
π. ππ
π. πππ
+
(π + π. π ) (π + π. π)
In delay form it can be written as
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
π―(π) = βπ. ππ β
π. π
π. ππ
+
(π + π. π πβπ ) (π + π. π πβπ )
This can be written as
π―(π) = π―π (π) + π―π (π) + π―π (π)
This shows that for this filter, there are three sections in the parallel realization. They can be
individually realized using either direct form I or direct form II realizations. We use direct
form II realization. The difference equations for each of three parallel sections are
Section 1: (π―π (π) = βπ. ππ)
ππ (π) = βπ. ππ π(π)
π.π
Section 2: (π―π (π) = β (π+π.π πβπ ))
ππ (π) = π(π) β π. π ππ (π β π)
ππ (π) = π. π ππ (π)
π.ππ
Section 2: (π―π (π) = (π+π.π πβπ ))
ππ (π) = π(π) β π. π ππ (π β π)
ππ (π) = βπ. ππ ππ (π)
The output is π(π) = ππ (π) + ππ (π) + ππ (π) and the parallel realization is shown below in
the diagram.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Magnitude
frequency
response of a
normalized
lowpass filter.
Magnitude
frequency
response of a
normalized
highpass filter.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Magnitude
frequency
response of a
normalized
bandpass filter.
Magnitude
frequency
response of a
normalized
bandreject filter.
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
7. Finite Impulse Response (FIR) Filter Design
An FIR filter is completely specified by the following difference equation (input-output
relationship):
π΄
π(π) = ππ π(π) + ππ π(π β π) + β― + ππ΄ π(π β π΄) = β ππ π(π β π)
(7.1)
π=π
The frequency response of an ideal lowpass filter is shown below in Figure (a).
π(π)
|π―(πππ )|
1
βπ
βΞ©π
0
Ξ©π
π
(a) Ideal Lowpass Frequency Response
(b) Impulse Response of an Ideal Lowpass Filter
Mathematically it is given by
π,
π―(πππ ) = {
π,
π β€ |π| β€ ππ
ππ β€ |π| β€ π
The frequency ππ is the lowpass cutoff frequency. It can be shown that, the corresponding
impulse response of the ideal lowpass filter is as shown in Figure (b) above. A truncated part
of the impulse response is shown (the actual response extends to infinity on both sides)
from π = βπ΄ to π = π΄. It is given by
ππ
,
π=π
π
π(π) = {
sin(ππ π§)
π§β π
π
π
The impulse response is symmetric about π = π. It could further be shown that, in this case
the z-transform of the impulse response is given by
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
π―(π) = π(π΄)ππ΄ + π(π΄ β π)ππ΄βπ + β― + π(π)ππ + π(π) + π(π)πβπ
+ β― π(π΄ β π)πβπ΄+π + π(π΄)πβπ΄
To obtain a causal impulse response, we shift (delay) the non-causal impulse response by M
samples, to yield the transfer function of a causal ideal lowpass FIR filter:
π―(π) = ππ + ππ πβπ + ππ πβπ + β― + πππ΄ πβππ΄
where, ππ = π(π β π΄) for π = π, π, π, β― , ππ΄.
Similarly, we can obtain the design equations for the other types of FIR filters, such as
highpass, bandpass and bandstop. Table 7.1 gives the formulas for these FIR filters for their
filter coefficient calculations.
Table 7.1: Summary of ideal impulse responses for standard FIR filters
Filter Type
Ideal Impulse Response
π(π) (non-causal FIR coefficients)
ππ
,
π=π
π
π(π) = {
sin(ππ π)
βπ΄ β€ π β€ π΄
π
π
π β ππ
Highpass
,
π=π
π
π(π) = {
sin(ππ π§)
β
βπ΄ β€ π β€ π΄
π
π
ππ― β ππ³
Bandpass
,
π=π
π
π(π) = {
sin(ππ― π) sin(ππ³ π)
β
βπ΄ β€ π β€ π΄
π
π
π
π
π
β ππ― + ππ³
Bandstop
,
π=π
π
π(π) = {
sin(ππ― π) sin(ππ³ π)
β
+
βπ΄ β€ π β€ π΄
π
π
π
π
Causual FIR filter coefficients: shifting π(π) to the right by samples.
Lowpass
Transfer Function:
π―(π) = ππ + ππ πβπ + ππ πβπ + β― + πππ΄ πβππ΄
Where ππ = π(π β π΄) for π = π, π, π, β― , π
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Example 7.2
(a) Calculate the filter coefficients for a 3-tap FIR lowpass filter with a cutoff frequency of
800 Hz and a sampling rate of 8000 Hz using the Fourier Transform method.
(b) Determine the transfer function and difference equation of the designed FIR system.
(c) Compute and plot the frequency response.
Solution
Part (a): We first determine the normalized cutoff frequency
πππ
ππ = ππ
ππ π»π = ππ
× ππππ = π. ππ
radians
In this case ππ΄ + π = π, therefore, using table 7.1
ππ
,
π=π
π
π(π) = {
sin(ππ π)
βπ΄ β€ π β€ π΄
π
π
Therefore
π(π) =
ππ π. ππ
=
= π. π
π
π
π(π) =
sin(ππ ) sin(π. ππ
)
=
= π. ππππ
π
π
Using symmetry, π(βπ) = π(π) = π. ππππ
Delaying π(π) by π΄ = π samples, we get
ππ = π(π β π) = π(βπ) = π. ππππ
ππ = π(π β π) = π(π) = π. π
Filter
Coefficients
ππ = π(π β π) = π(π) = π. ππππ
Part (b): Therefore, the transfer function in this case is
π―(π) = ππ + ππ πβπ + ππ πβπ = π. ππππ + π. ππβπ + π. πππππβπ
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
The difference equation is
π(π) = π. πππππ(π) + π. ππ(π β π) + π. πππππ(π β π)
Part (c): The frequency response of the filter is
π―(πππ ) = π. ππππ + π. ππβππ + π. πππππβπππ
It can be written as
π―(πππ ) = πβππ (π. πππππππ + π. π + π. πππππβπππ ) = πβππ (π. π + π. ππππ(πππ + πβπππ ))
= πβππ (π. π + π. ππππ × πcos(π)) = πβππ (π. π + π. ππππcos(π))
Thus, the magnitude frequency response is
|π―(πππ )| = π. π + π. ππππcos(π)
And the phase response is
Phase response(degrees)
Magnitude response(dB)
β π―(πππ ) = {
βπ,
βπ + π
π. π + π. ππππcos(π) > 0
π. π + π. ππππcos(π) < 0
0
-20
-40
-60
0
500
1000
1500
2000
2500
Frequency (Hz)
3000
3500
4000
0
500
1000
1500
2000
2500
Frequency (Hz)
3000
3500
4000
100
50
0
-50
-100
-150
Figure 7.4: Frequency response in Example 7.2
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
In FIR filters with symmetrical coefficients, the phase response has a linear behavior in the
passband.
This means that all frequency components of the filter input within the passband are
subjected to the same amount of time delay at the filter output. This is a requirement
of applications in audio and speech filtering, where phase distortions needs to be
avoided.
If the design method cannot produce the symmetrical coefficients, then the resultant
FIR filter does not have linear phase property leading to distortions in the filtered
signal. This distortion due to nonlinear phase is shown with the example below.
π(π) = ππ (π) + ππ (π) = sin(π. πππ
π) π(π) + sin(π. πππ
π) π(π)
ππ (π) = sin(π. πππ
(π β π)) + sin(π. πππ
(π β π))
Linear Phase
ππ (π) = sin(π. πππ
π β π
/π) + sin(π. πππ
π β π
/π))
Non-Linear Phase
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
The FIR filter has a good phase property, but it does not give an acceptable magnitude
frequency response. The result with an 17-tap lowpass filter is also shown below.
There are oscillations (ripple) in the passband (main lobe) and stopband (side lobe) of
the magnitude frequency response. This is due to Gibbs oscillations, originating from
the abrupt truncation of the infinite impulse response of the lowpass filter.
Phase response(degrees)
Magnitude response(dB)
This behavior can be avoided with the help of windowing.
20
0
-20
-40
-60
-80
0
500
1000
1500
2000
2500
Frequency (Hz)
3000
3500
4000
4500
0
500
1000
1500
2000
2500
Frequency (Hz)
3000
3500
4000
4500
200
0
-200
-400
-600
Figure 7.5: Magnitude and Phase Frequency responses of the ideal lowpass FIR filters
with 3-coefficients (dashed lines) and 17 coefficients (solid lines)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Example 7.2
(a) Calculate the filter coefficients for a 5-tap FIR bandpass filter with a lower cutoff
frequency of 2000 Hz and an upper cutoff frequency of 2400 at a sampling rate of 8000
Hz.
(b) Determine the transfer function and plot the frequency responses with MATLAB.
Solution
Part (a): We first determine the normalized cutoff frequencies
Ξ©π³ =
Ξ©π― =
ππ
ππ³
ππ
ππ
ππ―
ππ
ππππ
= ππ
× ππππ = π. ππ
radians
ππππ
= ππ
× ππππ = π. ππ
radians
In this case ππ΄ + π = π, therefore, from Table7.1
ππ― β ππ³
,
π=π
π
π(π) = {
π¬π’π§(ππ― π) π¬π’π§(ππ³ π)
β
, βπ β€ π β€ π
ππ
ππ
The non-causal FIR coefficients are
π(π) =
ππ― β ππ³ π. ππ
β π. ππ
=
= π. π
π
π
π(π) =
π¬π’π§(ππ― × π) π¬π’π§(ππ³ × π) π¬π’π§(π. ππ
) π¬π’π§(π. ππ
)
β
=
β
= βπ. πππππ
π
×π
π
×π
π
π
π(π) =
π¬π’π§(ππ― × π) π¬π’π§(ππ³ × π) π¬π’π§(π. ππ
) π¬π’π§(π. ππ
)
β
=
β
= βπ. πππππ
π
×π
π
×π
ππ
ππ
Using the symmetry property
π(βπ) = π(π) = βπ. πππππ
π(βπ) = π(π) = βπ. πππππ
Thus the filter coefficients are obtained by delaying by π΄ = π samples, as
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
ππ = π(π β π) = π(βπ) = βπ. πππππ
ππ = π(π β π) = π(βπ) = βπ. πππππ
ππ = π(π β π) = π(π) = π. π
Filter
Coefficients
ππ = π(π β π) = π(π) = βπ. πππππ
ππ = π(π β π) = π(π) = βπ. πππππ
Part (b): Therefore, the transfer function in this case is
π―(π) = ππ + ππ πβπ + ππ πβπ + ππ πβπ + ππ πβπ
= βπ. πππππ β π. πππππ πβπ + π. ππβπ β π. ππππππβπ β π. πππππ πβπ
The difference equation is
π(π) = βπ. πππππ π(π) β π. πππππ π(π β π) + π. π π(π β π) β π. πππππ π(π β π)
β π. πππππ π(π β π)
Part (c): The frequency response of the filter is
π―(πππ ) = βπ. πππππ β π. πππππ πβππ + π. π πβπππ β π. πππππ πβπππ
β π. πππππ πβπππ
It can be written as
π―(πππ ) = πβπππ (βπ. πππππ ππππ β π. πππππ πππ + π. π β π. πππππ πβππ
β π. πππππ πβπππ )
= πβπππ (π. π β π. πππππ (πππ + πβππ ) β π. πππππ (ππππ + πβπππ ))
= πβπππ (π. π β π. πππππ (πππ¨π¬(π)) β π. πππππ (πππ¨π¬(ππ)))
= πβπππ (π. π β π. πππππ ππ¨π¬(π) β π. ππππ ππ¨π¬(ππ))
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Thus, the magnitude frequency response is and the phase response are computed by the
MATLAB program shown below and are the plots are shown in the figure below.
Phase response(degrees)
Magnitude response(dB)
[response, w] = freqz([-0.09355 -0.01558 0.1 -0.01558 -0.09355], ...
[1], 512);
magnitude = abs(response);
magnitude2 = 20*log10(magnitude);
phase2 = 180*unwrap(angle(response))/pi;
figure,
subplot(2,1,1); plot(w, magnitude2,'LineWidth',2); grid on;
xlabel('Frequency (rad)');
ylabel('Magnitude response(dB)');
subplot(2,1,2); plot(w, phase2,'LineWidth',2); grid on;
xlabel('Frequency (rad)');
ylabel('Phase response(degrees)');
0
-20
-40
-60
-80
0
0.5
1
1.5
2
Frequency (rad)
2.5
3
3.5
0
0.5
1
1.5
2
Frequency (rad)
2.5
3
3.5
300
200
100
0
Figure 7.8: Magnitude and Phase Frequency responses of the ideal bandpass FIR filters with 5coefficients (Example 7.3)
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
CEN352 Digital Signal Processing
by Dr. Anwar M. Mirza
Lecture No. 21
Date: December, 2012
Department of Computer Engineering
College of Computer & Information Sciences, King Saud University
Ar Riyadh, Kingdom of Saudi Arabia
© Copyright 2026 Paperzz