DSP实验答案Solution_lab3
Name:
Section:
Laboratory Exercise 3
DISCRETE-TIME SYSTEMS: TIME-DOMAIN REPRESENTATION
3.1 SIMULATION OF DISCRETE-TIME SYSTEMS
Project 3.1The Moving Average System
According to Program P2_1.
Answers:
Q3.1 The output sequence generated by running the above program for M = 2 with x[n] = s1[n]+s2[n]as the input is shown below.
The component of the input x[n] suppressed by the discrete-time system simulated by this
program is -y
3.2 LINEAR TIME-INVARIANT DISCRETE-TIME SYSTEMS
Project 3.5Computation of Impulse Responses of LTI Systems
According to Program P2_5.
Answers:
Q3.20The required modifications to Program P2_5 to generate the impulse response of the following causal LTI system: y[n] + 0.71y[n-1] – 0.46y[n-2] – 0.62y[n-3]
= 0.9x[n] – 0.45x[n-1] + 0.35x[n-2] + 0.002x[n-3] are given below:
clf;
N = 45;
num = [0.9 -0.45 0.35 0.002];
den = [1 0.71 -0.46 -0.62 ];
y = impz(num,den,N);
% Plot the impulse response
stem(y);
xlabel('Time index n'); ylabel('Amplitude');
title('Impulse Response'); grid;
The first 45 samples of the impulse response of this discrete-time system generated by
running the modified is given below:
Q3.21The MATLAB program to generate the impulse response of a causal LTI system of Q3.20 using the filter command is indicated below:
clf;
num = [0.9 -0.45 0.35 0.002];
den = [1 0.71 -0.46 -0.62 ];
x=[1 zeros(1,39)];
y = filter(num,den,x);
% Plot the impulse response
stem(y);
xlabel('Time index n'); ylabel('Amplitude');
title('Impulse Response'); grid;
The first 40 samples of the impulse response generated by this program are shown below:
Q3.22The MATLAB program to generate and plot the step response of a causal LTI system is indicated below: clf;
num = [0.9 -0.45 0.35 0.002];
den = [1 0.71 -0.46 -0.62 ];
x=ones(1,40);
z = filter(num,den,x);
% Plot the impulse response
figure
stem(z);
xlabel('Time index n'); ylabel('Amplitude');
title('Step Response'); grid;
The first 40 samples of the step response of the LTI system of Project 3.3 are shown below:
Project 3.7 Convolution
According to Program P2_7.
Answers:
Q3.28 The sequences y[n] and y1[n] generated by running Program P2_7 are shown below:
The difference between y[n]and y1[n]is- no
The reason for using x1[n] as the input, obtained by zero-padding x[n], for generating
y1[n]is – length
Project 3.8 Stability of LTI Systems
According to Program P2_8.
Answers:
Q3.30The purpose of the for com-mand is- Repeat statements a specific number of times.
The purpose of the end com-mand is - Terminate scope of FOR, WHILE, SWITCH, TRY, and IF statements.
Q3.31 The purpose of the break com-mand is- Terminate execution of WHILE or FOR loop.
Q3.32The discrete-time system of Program P2_8 is-
The impulse response generated by running Program P2_8 is shown below:
The value of |h(K)| here is - 1.6761e-005
From this value and the shape of the impulse response we can conclude that the system is – stable.
By running Program P2_8 with a larger value of N the new value of |h(K)| is - 9.1752e-007
From this value we can conclude that the system is – stable.
Q3.33 The modified Program P2_8 to simulate the discrete-time system of Q3.33 is given below: clf;
num = [1 -4 3]; den = [1 -1.7 1];
N = 200;
h = impz(num,den,N+1);
parsum = 0;
for k = 1:N+1;
parsum = parsum + abs(h(k));
if abs(h(k)) < 10^(-6), break, end
end
% Plot the impulse response
n = 0:N;
stem(n,h)
xlabel('Time index n'); ylabel('Amplitude');
% Print the value of abs(h(k))
disp('Value =');disp(abs(h(k)));
The impulse response generated by running the modified Program P2_8 is shown below:
The values of |h(K)| here are - 2.0321
From this value and the shape of the impulse response we can conclude that the system is - unstable.
3.3 Convolution of signals and system impulse responses:
a. Load the supplied acoustic impulse response of a room into MATLAB using the command:
[impr,fs,nbits] = wavread('impr.wav');
This impulse response was obtained by creating an impulsive noise at one position in the room and recording (and digitizing) the sounds arriving at another position in the room.
b. Plot the impulse-response waveform impr using the plot() command and listen to it using the soundsc() command. What can you see and hear in the impulse response?
c. Load the supplied speech signal into MATLAB using the command:
[y,fs,nbits] = wavread('oilyrag.wav');
generated
d. Convolve the speech signal with the impulse response, and plot and listen to the resulting signal.
Describe what you see and hear, comparing it to the original speech signal y. Explain what the convolved signal is physically equivalent to.
[impr,fs,nbits] = wavread('impr.wav');
subplot(311)
plot(impr);
title(' acoustic impulse response of a room');
soundsc(impr);
[y,fs,nbits] = wavread('oilyrag.wav');
subplot(312)
plot(y);
title('speech signal');
soundsc(y);
x=conv(impr,y);
subplot(313)
plot(x)
soundsc(x);
title('resulting signal');
Date: Signature:

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。