OBJECTIVES
1. To learn how to determine the difference equation given FIR (finite-impulse response) system coefficients.
2. To learn how to determine the difference equation given IIR (infinite impulse response) system coefficients.
3. To learn how to determine the FIR transfer function based on the given difference equation, and learn how to calculate and display frequency responses of the FIR system and perform digital filtering.
4. To learn how to determine the IIR transfer function based on the given difference equation, and learn how to calculate and display frequency responses of the IIR systems and perform digital filtering.
PROCEDURE:
Part A: FIR Filters
An FIR system is given below:
Numerator coefficients: b=[0.2 0.3 0.2]
a. Determine its transfer function H(z)=
b. Determine its difference equation y(n)=
c. Given sampled values: sample=[1:1:10], write a MATLAB program to perform the digital filtering:
------------------------------------------------------------------------------
sample =[1:1:10]
x=[0 0 sample]
for n=3:1:length(x)
y(n)= completed on your own
end
y(3:1:length(x))
--------------------------------------------------------------------------------
Using the standard MATLAB routine “filter()” for verification:
yy = filter([0.2 0.3 0.2],1,sample)
Is the vector containing y(3:1:length(sample)) same as the vector yy? _____________
Two FIR system coefficients are given below, respectively,
FIR system 1:
bLP =[
-0.0012 -0.0025 -0.0045 -0.0068 -0.0073 -0.0030 0.0089 …
0.0297 0.0583 0.0907 0.1208 0.1422 0.1500 0.1422 …
0.1208 0.0907 0.0583 0.0297 0.0089 -0.0030 -0.0073 …
-0.0068 -0.0045 -0.0025 -0.0012]
FIR system 2:
bBP =[
0.0004 -0.0017 -0.0064 -0.0076 0.0073 0.0363 0.0458 …
0.0000 -0.0802 -0.1134 -0.0419 0.0860 0.1500 0.0860 …
-0.0419 -0.1134 -0.0802 0.0000 0.0458 0.0363 0.0073 …
-0.0076 -0.0064 -0.0017 0.0004 ]
1. Determine the transfer function using z-transform for the first FIR system.
2. Determine the difference equation for the first FIR system.
Plot the frequency responses using the MATLAB function freqz() for each of z-transfer functions.
MATLAB>>freqz(bLP,1,512,8000); % sampling rate=8000 Hz
Label and print your graph.
Perform similar operations for FIR systems with coefficients: bBP and label and print your plots.
3. Generate the sum of sinusoids for duration of 1 second:
using a sampling rate of 8 kHz.
4. Write MATLAB programs using the MATLAB function filter() according to the two given FIR systems.
a. Perform digital filtering using each of the developed programs, plot the input signal spectrum and the output signal spectrum 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 output signal spectrum?
b. Listen to and compare the input signal and output signal from each filter, respectively.
Discuss the obtained results.
5. Use speech data with a sampling of 8000 Hz provided by your instructor,
MATLAB>>load we.dat
MATLAB>>x=we/max(abs(we)); %scale the speech data
a. Perform digital filtering using each of the developed filter programs, and calculate and plot the input signal spectrum and the output spectrum with a frequency resolution of 4 Hz, respectively. Print and label each spectrum.
b. Listen to and compare the input signal and output signal from each filter, respectively.
Discuss the obtained results.
Part B: IIR Filters
An IIR system is given below
Numerator coefficients: b=[0.5 0.5]
Denominator coefficients: a=[1 –0.25];
a. Determine its transfer function H(z)=
b. Determine its difference equation y(n)=
c. Given sampled values: sample=[1:1:10], write a MATLAB program to perform the digital filtering
------------------------------------------------------------------------------
sample =[1:1:10]
x=[0 sample]
y=[0 zeros(1,length(sample))]
for n=2:1:length(x)
y(n)= completed on your own
end
y(2:1:length(x))
--------------------------------------------------------------------------------
Using the standard MATLAB routine “filter()” for verification
yy = filter([0.5 0.5],[1 –0.25],sample)
Is the vector containing y(2:1:length(sample)) same as the vector yy? _____________
Two IIR filter coefficients are given below, respectively,
IIR system 1:
Numerator coefficients: bBP = [0.0201 0.0000 -0.0402 0.0000 0.0201 ]
Denominator coefficients: aBP = [1.0000 -2.1192 2.6952 -1.6924 0.6414 ]
IIR system 2:
Numerator coefficients: bHP =[ 0.0938 -0.3753 0.5630 -0.3753 0.0938 ]
Denominator coefficients: aHP =[ 1.0000 0.0784 0.8267 0.2597 0.1960 ]
1. Determine the transfer function using z-transform for the first IIR system.
2. Determine the difference equation for the first IIR system.
Plot the frequency responses using the MATLAB function freqz() for each of z-transfer function.
MATLAB>>freqz(bBP,aBP,512,8000);axis([0 4000 –40 1]);
Label and print your graph.
3. Perform similar operations for IIR systems with coefficients: aHP, and bHP.
Generate the sum of sinusoids for 1 second achieved from the Lab 1 for the duration of 1 second:
using a sampling rate of 8 KHz.
5. Write MATLAB programs using the MATLAB function filter() according to two IIR systems.
a. 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.
b. 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?
6. Use speech data with a sampling rate of 8000 Hz provided by your instructor,
MATLAB>>load we.dat;
MATLAB>>x=10*we/max(abs(we)); %scale the speech data
a.. Perform digital filtering using each of the developed programs, and calculate and plot the input signal spectrum and the output spectrum with a frequency resolution of 4 Hz, respectively. Print and label the spectrum.
b. Listen to and compare the input signal and output signal from each filter, respectively.
Discuss the obtained results.
0 comments:
Post a Comment