?? 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 + -