为什么用MATLAB显示空白?clf; w=-pi:2*pi/255: pi; x1=[1 3 5 7 9 11 13 15 17]; x2=[1 -2 3 -2 1]; y=conv(x1,x2); h1=freqz(x1,1,w); h2=freqz(x2,1,w); hp=hi.*h2; h3=freqz(y,1,w); subplo
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/29 23:35:09
为什么用MATLAB显示空白?clf; w=-pi:2*pi/255: pi; x1=[1 3 5 7 9 11 13 15 17]; x2=[1 -2 3 -2 1]; y=conv(x1,x2); h1=freqz(x1,1,w); h2=freqz(x2,1,w); hp=hi.*h2; h3=freqz(y,1,w); subplo
为什么用MATLAB显示空白?
clf;
w=-pi:2*pi/255: pi;
x1=[1 3 5 7 9 11 13 15 17];
x2=[1 -2 3 -2 1];
y=conv(x1,x2);
h1=freqz(x1,1,w);
h2=freqz(x2,1,w);
hp=hi.*h2;
h3=freqz(y,1,w);
subplot(2,2,1)
plot(w/pi,abs (hp));grid
title(‘幅度谱的乘积’)
subplot(2,2,2)
plot(w/pi,abs (h3));grid
title(‘卷积后序列的幅度谱’)
subplot(2,2,3)
plot(w/pi,angle (hp));grid
title(‘相位谱的和’)
subplot(2,2,4)
plot(w/pi,angle (h3));grid
title(‘卷积后序列的相位谱’)
为什么用MATLAB显示空白?clf; w=-pi:2*pi/255: pi; x1=[1 3 5 7 9 11 13 15 17]; x2=[1 -2 3 -2 1]; y=conv(x1,x2); h1=freqz(x1,1,w); h2=freqz(x2,1,w); hp=hi.*h2; h3=freqz(y,1,w); subplo
% hp=hi.*h2; 改成 hp = h1.*h2;
% title(‘幅度谱的乘积’) 将引号全部改成半角符号
clf;
w=-pi:2*pi/255: pi;
x1=[1 3 5 7 9 11 13 15 17];
x2=[1 -2 3 -2 1];
y=conv(x1,x2);
h1=freqz(x1,1,w);
h2=freqz(x2,1,w);
hp=h1.*h2;
h3=freqz(y,1,w);
subplot(2,2,1)
plot(w/pi,abs (hp));grid
title('幅度谱的乘积')
subplot(2,2,2)
plot(w/pi,abs (h3));grid
title('卷积后序列的幅度谱')
subplot(2,2,3)
plot(w/pi,angle (hp));grid
title('相位谱的和')
subplot(2,2,4)
plot(w/pi,angle (h3));grid
title('卷积后序列的相位谱')