matlab实验
![matlab实验](https://img.360docs.net/img16/0o3nwbok2cc7cefna6i-61.webp)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1、在[-pi pi]画出序列x=[2 4 6 8 10 12 14 16
18DTFT幅度,相位特性;
>> w=-pi:2*pi/255:pi;
>> x=[2 4 6 8 10 12 14 16 18];
>> den=[1 -0.6];
>> h=freqz(x,den,w);
>>subplot(2,2,1);
>> plot(w,real(h));
>>subplot(2,2,2);
>> plot(w,imag(h));
>>subplot(2,2,3);
>> plot(w,abs(h));
>>subplot(2,2,4);
>> plot(w,angle(h));
2 画x(n-10)的DTFT幅度、相位特性
> >w=-pi:2*pi/255:pi;
>> x=[2 4 6 8 10 12 14 16 18];
>> h1=freqz(x,1,w);
>> h2=freqz([zeros(1,10) x],1,w);
>> plot(w,real(h2));
>> plot(w,imag(h2));
>> plot(w,abs(h2));
>> plot(w,angle(h2));
3 画exp(0.2pi*n)x(n)的DTFT幅度、相位特性>> w=-pi:2*pi/255:pi;w0=0.2*pi;
>> num1=[2 4 6 8 10 12 14 16 18];
>> l=length(num1);
>> h1=freqz(num1,1,w);
>> n=0:l-1;
>> num2=exp(w0*i*n).*num1;
>> h2=freqz(num2,1,w);
>> subplot(2,2,1)
>> plot(w,abs(h1))
>> title('origin serials a-w curve')
>> subplot(2,2,2)
>> plot(w,abs(h2))
>> title('f-shift a-w curve')
>> subplot(2,2,3)
>> plot(w,angle(h1))
>> title('origin serials angle-w curve')
>> subplot(2,2,4)
>> plot(w,angle(h2))
>> title('f-shift angle-w curve')
4 序列x1=[1 2 3 4 3 2 1]求x与x1卷积的DTFT并画图
>> w=-pi:2*pi/255:pi;
>> x1=[12 3 4 3 2 1];
>> x=[2 4 6 8 10 12 14 16 18];
>> y=conv(x,x1);
>> h1=freqz(x,1,w);
>> h2=freqz(x1,1,w);
>> hp=h1.*h2;
>> h3=freqz(y,1,w);
>> subplot(2,2,1)
>> plot(w,abs(hp))
>> title('幅度乘积')
>> subplot(2,2,2)
>> plot(w,abs(h3))
>> title('卷积序列的幅度')
>> subplot(2,2,3)
>> plot(w,angle(hp))
>> title('相位譜的和')
>> subplot(2,2,4)
>> plot(w,angle(h3))
>> title('卷积序列的相位谱')
5 求x与x1乘积的DTFT并画图
>> w=-pi:2*pi/255:pi;
>> x=[2 4 6 8 10 12 14 16 18];
>> x1=[1 2 3 4 3 2 1];
>> h1=freqz(x,1,w);
>> h2=freqz(x1,1,w);
>> h=h1.*h2;
>> h3=freqz(h,1,w);
>> subplot(2,1,1);
>> plot(w,abs(h3));
>> title('幅度特性')
>> subplot(2,1,2);
>> plot(w,angle(h3));
>> title('相角特性')
6已知X1(z)=2+3z^(-1)+4z^(-2),X2(z)=3+4z^(-1)+5z^(-2)+6z^(-3),求下X3(z)=X1(z)X2(z) >>x1=[2 3 4];
>>x2=[3 4 5 6];
>>y=conv(x1,x2);
>>y=
6 1
7 34 43 3
8 24
X3(z)=6+17z^(-1)+34z^(-2)+43z^(-3)+38z^(-4)+24z^(-5)
1、
x=[1 1 1 1 1];
>> y=fft(x,101);
>> y1=fft(x,1024);
>> subplot(2,1,1)
>> stem(y)
>> subplot(2,1,2)
>> stem(y1)
2、
x1=[1 3 5 7 9];x2=[2 2 0 1 1];
y=circonv(x1,x2);
h1=fft(x1);h2=fft(x2);
h3=fft(y);
hp=h1.*h2;
subplot(2,2,1);stem(x1);
subplot(2,2,2)
subplot(2,2,3)
stem(abs(h3))
title('序列卷积的DFT的幅度') subplot(2,2,4)
stem(abs(hp))
title('序列DFT的乘积的幅度')
3、
x1=[1 3 5 7 9];x2=[2 2 0 1 1];
x1e=[x1 zeros(1,length(x2)-1)];
x2e=[x2 zeros(1,length(x1)-1)];
y=conv(x1,x2);
ye=circonv(x1e,x2e);
subplot(4,1,1)
stem(x1e);