matlab liftbox 点击,东南大学2015短学期MATLAB作业3.docx

PAGE 1

PAGE 15

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];

nx=[-2:6];

nh=[0:7];

Plot the functions and convolution results.

Answer:

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, ny]=conv_m(x, nx,h,nh);

subplot(3,1,1); stem(nx, x);

ylabel('x[n]');

axis([-6 10 -6 12 ]);

title('convolution');

subplot(3,1,2);

stem(nh, h); ylabel('h[n]');

axis([-6 10 -8 12]);

subplot(3,1,3);

stem(ny,y);

xlabel('n'); ylabel('y[n]');

axis([-6 10 -150 250]);

Plot the frequency response over for the following transfer function by letting , where is the frequency (rad/sample)., with appropriate labels and title.

.

Answer:

omega=1:pi/100:pi;

z=exp(j .* omega);

H = z ./ (z.^2 + 1.6 * z + 0.9);

subplot(211);

plot(omega, abs(H));

xlabel('\Omega'),ylabel('|H|');

subplot(212);

plot(omega, atan2(imag(H),real(H)));

xlabel('\Omega');ylabel('Phase of H')

Use fft to analyse following signal by plotting the original signal and its spectrum.

.

Answer:

N=1024;

dt=1/N;

t=0:dt:1-dt;

x=sin(2*pi*32.*t) + sin(2*pi*137.*t) + sin(2*pi*467.*t);

X=fft(x);

subplot(211);plot(t,x);

xlabel('t/sec');ylabel('x');

axis([min(t) max(t) 1.5*min(x) 1.5*max(x)]);

f=0:N-1;

subplot(212);stem(f,abs(X));

xlabel('f/Hz');ylabel('|X|');

axis([ 0 N/2 0 max(abs(X))]);

Use the fast Fourier transform function fft to analyse following signal. Plot the original signal, and the magnitude of its spectrum linearly and logarithmically. Apply Hamming window to reduce the leakage.

.

The hamming window can be coded in Matlab as

for n=1:N

hamming(n)=0.54+0.46*cos((2*n-N+1)*pi/N);

end;

where N is the data length in the FFT.

Answer:

N=1024;

dt=1/N;

t=0:dt:1-dt;

x=sin(2*pi*32.5.*t) + sin(2*pi*137.4.*t) + sin(2*pi*467.7.*t);

X=fft(x);

subplot(321);plot(t,x);

xlabel('t/sec');ylabel('x');

axis([min(t) max(t) 1.5*min(x) 1.5*max(x)]);

f=0:N-1;

subplot(323);stem(f,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值