百度文库-
百度文库-让每个人平等地提升自我
PAGE
PAGE #
Matlab Worksheet 3
Part A
Using function conv_m.m to make convolution between the following to functions (x and h): x=[3, 11,7, 0, -1, 7, -5, 0, 2];
h=[11,9, 0, -7, -3, 2, 0 -1];
n x=[-2:6];
n h=[0:7];
Plot the fun cti ons and convo luti on results.
An swer:
home_work_3_A_1.m
x=[3, 11,7, 0, -1,7, -5, 0, 2];
h=[11,9, 0, -7, -3, 2, 0 -1];
nx=[-2:6];
nh=[0:7];
[y, n y]=c on v_m(x, nx,h, nh);
subplot(3,1,1);
stem( nx,x);
ylabel('x[ n]');
axis([-6 10 -20 20]);
subplot(3,1,2);
stem( nh,h);
ylabel('h[ n]');
axis([-6 10 -20 20]);
subplot(3,1,3);
stem( ny,y);
xlabel( 'n');
ylabel('y[ n]');
axis([-6 10 -50 50]);
conv_m.m
fun cti on[y, ny]=con v_m(x ,n x,h ,nh)
%con voluti on fun cti on
%conv_m.m
nyb=nx(1)+nh(1);
nye=n x(le ngth(x))+nh(le ngth(h));
ny=[nyb:ny e];
y=c on v(x,h);
end
Plot the frequency response oveiOfor the following transfer function by letting
z ej , whereis the frequency (rad/sample)., with appropriate labels and title.
H(z)z
H(z)
z
z21.6z 0.9
An swer:home_work_3_A_2.mdelta=0.01;Omega=0:delta:pi;z=exp(j .* Omega);H= z ./ (z.
An swer:
home_work_3_A_2.m
delta=0.01;
Omega=0:delta:pi;
z=exp(j .* Omega);
H= z ./ (z.A2+1.6*z+0.9);
subplot(2,1,1);
plot(Omega, abs(H),'m' , 'LineWidth'
xlabel( '0
ylabel( '|H(\Omega)|');
axis([0 pi 0 max(abs(H))]);
subplot(2,1,2);
,2);
plot(Omega,ata n2(imag(H),real(H)),
xlabel( '0
ylabel( ' -\pi < \Phi_H
title(' freque ncy resp on se');
'k', 'LineWidth' ,2);
axis([0 pi -pi pi]);
<
H
<
Use fft to analyse following signal by plotting the original signal and its spectrum.
x[n] sin 2 32』 sin 2 137』 sin 2 467』
102410241024
An swer: home_work_3_A_3.m
%Exam ine sig nal comp onents
%sampli ng rate 1024Hz
N=1024;
dt=1/N;
t=0:dt:1-dt;
%****defj ne the sig nal**
x= sin(2*pi*32 .*t) +sin(2*pi*137 .*t )+ sin(2*pi* 467 .*t ) (%***********************
subplot(2,1,1); plot(t,x); axis([0 1-1 1]); xlabel('nT (sec on ds)');
ylabel('x[ n]');
X=fft(x);
d