You are on page 1of 3

Design: Filter Implementation

Part A: FIR Filters

1. [20] An FIR system is given below:


Numerator coefficients: 𝑏 = [0.2 0.3 0.2]
a. [5] Determine its transfer function 𝐻(𝑧) =
b. [5] Determine its difference equation 𝑦(𝑛) =
c. [5] Given sampled values: sample=[1:10], write a MATLAB program to
perform the digital filtering.
d. [5] Using the standard MATLAB routine “filter()”, verify ‘c’.
2. [70] Two FIR system coefficients are given below, respectively,
[FIR system 1]
b1 = [ -0.0052 0.0018 0.0174 0.0187 -0.0168 -0.0600 -0.0328
0.1067 0.2882 0.3726 0.2882 0.1067 -0.0328 -0.0600 -0.0168
0.0187 0.0174 0.0018 -0.0052]
[FIR system 2]
b2 = [0.0004 -0.0041 -0.0022 0.0083 0.0051 -0.0098 -0.0057
0.0034 -0.0034 0.0120 0.0300 -0.0306 -0.0751 0.0419 0.1294 -
0.0367 -0.1743 0.0146 0.1918 0.0146 -0.1743 -0.0367 0.1294
0.0419 -0.0751 -0.0306 0.0300 0.0120 -0.0034 0.0034 -0.0057 -
0.0098 0.0051 0.0083 -0.0022 -0.0041 0.0004]
a. [5] Determine the transfer function using z-transform for the first FIR system.
b. [10] Determine the difference equation for the first FIR system.
Plot the frequency responses using the MATLAB function freqz() for the z-
transfer functions.
Label and print your graph.
c. [10] Perform the same operations as (b) for the second FIR system.
d. [5] Generate the sum of sinusoids for duration of 1 second and plot it:
𝑥(𝑡) = 5 cos(1000𝜋𝑡) + 5 cos(2400𝜋𝑡 + 0.25𝜋) + 5 cos(3600𝜋𝑡 + 0.5𝜋) with fs=8 kHz.
e. [20] Write MATLAB programs using the MATLAB function filter() according to
the two given FIR systems.
① [5] Perform digital filtering using each of the developed programs, and
plot the input signal and the output signal from each filter for the first 25
msec. duration.
② [5] Calculate and plot the input signal spectrum and the output signal
spectrum from each filter using the frequency resolution of 1 Hz,
respectively. Print and label the spectrum.
• What frequency components/component (frequency locations of the
spectral peak(s)) are/is shown in the input and output signal spectrum?
③ [5] Listen to and compare the input signal and output signal from each
filter, respectively.
④ [5] Discuss the obtained results.

f. [20] Use ‘we.dat’ for ① and ②, and ‘speech.dat’ for ③ with a sampling of
8000 Hz,
① [5] Perform digital filtering using each of the developed programs, and
plot the input signal and the output signal from each filter.
② [5] Calculate and plot the input signal spectrum and the output spectrum
from each filter. Print and label each spectrum.
③ [5] Listen to and compare the input signal and output signal from each
filter, respectively. (If you get a clipping sound, reduce the amplitude of
the signal until the clipping disappears.)
④ [5] Discuss the obtained results.

Part B: IIR Filters

1. [20] An IIR system is given below


Numerator coefficients: b=[0.5 0.5]
Denominator coefficients: a=[1 –0.25];
a. [5] Determine its transfer function 𝐻(𝑧) =
b. [5] Determine its difference equation 𝑦(𝑛) =
c. [5] Given sampled values: sample=[1:1:10], write a MATLAB program to
perform the digital filtering.
d. [5] Using the standard MATLAB routine “filter()”, verify the result of (c).

2. [60] Two IIR filter coefficients are given below, respectively,


[IIR system 1]
Numerator coefficients: b1 = [0.0940 -0.3759 0.5639 -0.3759 0.0940]
Denominator coefficients: a1 = [1.0000 0.0000 0.4860 -0.0000 0.0177]
[IIR system 2]
Numerator coefficients: b2 =[ 0.0056 0.0000 -0.0111 0 0.0056]
Denominator coefficients: a2 =[ 1.0000 -2.2536 3.0924 -2.0669 0.8419 ]
a. [5] Determine the transfer function using z-transform for the IIR system 1 and
2.
b. [10] Determine the difference equation for the IIR system 1 and 2.
Plot the frequency responses using the MATLAB function freqz() for each of z-
transfer function.
c. [5] Generate the sum of sinusoids for the duration of 1 second, and plot the
first 25 msec. duration of the signal:
x(t )  5cos(2 (500)t )  5cos(2 (1200)t  0.25 )  5cos(2 (1800)t  0.5 ) using fs = 8 kHz.
d. [20] Write MATLAB programs using the MATLAB function filter() according to
two IIR systems.
① Perform digital filtering using each of the developed programs, and plot the
input signal spectrum and the output signal spectrum using the frequency
resolution of 1 Hz, respectively. Print and label spectrum.
② Listen to and compare the input signal and output signal from each filter,
respectively.
③ Discuss the obtained results.
④ What frequency components/component (frequency locations of the
spectral peak(s)) are/is shown in the output spectrum?

e. [20] Use ‘we.dat’ for ①, and ‘speech.dat’ for ② with a sampling of 8000 Hz,
① Perform digital filtering using each of the developed programs, and
calculate and plot the input signal spectrum and the output spectrum,
respectively. Print and label the spectrum.
② Listen to and compare the input signal and output signal from each filter,
respectively. Discuss the obtained results.

You might also like