📄 samp7_3.m
字号:
%Samp7_3
clf;Nf=512;
for ii=1:4
switch ii
case 1
Nwin=10;
case 2
Nwin=20;
case 3
Nwin=50;
case 4
Nwin=100;
end
w=boxcar(Nwin); %矩形窗
[y,f]=freqz(w,1,Nf); %用不同的窗长度求得复数频率特性
mag=abs(y); %求得幅频特性
posplot=['2,2,' int2str(ii)]; %指定绘图位置
subplot(posplot);
plot (f/pi,20*log10(mag/max(mag))); %绘出幅频形状
xlabel('归一化频率');ylabel('振幅/dB');
stext=['N=' int2str(Nwin)]; %给出标题,指出所用的数据个数
title(stext);grid on;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -