exa070900.m

来自「MATLAB程序关于数字信号处理的算法实现」· M 代码 · 共 44 行

M
44
字号
%----------------------------------------------------------------------------
%  exa070900.m,   for fig. 7.9.1,
%  to test chebwin.m and kaiser.m,
%----------------------------------------------------------------------------
clear all;

% 求切比雪夫窗函数和频谱;
N=31;
A=40;
w=chebwin(N,A);
[W,f]=freqz(w,1,256,'whole',1);
subplot(321)
t=0:N-1;
stem(t,w,'.k')
ylabel(' chebyshev')
W=20*log10(abs(W)/abs(W(1)));
subplot(322)
f=f-0.5;
plot(f,fftshift(W));grid on;

% 求凯塞窗函数和频谱;
beta=5;
w=kaiser(N,beta);
[W,f]=freqz(w,1,256,'whole',1);
subplot(323)
stem(t,w,'.k')
ylabel( 'kaiser')
W=20*log10(abs(W)/abs(W(1)));
subplot(324)
f=f-0.5;
plot(f,fftshift(W));grid on;

% 求凯塞窗函数和频谱;
beta=10;
w=kaiser(N,beta);
[W,f]=freqz(w,1,256,'whole',1);
subplot(325)
stem(t,w,'.k')
ylabel( 'kaiser')
W=20*log10(abs(W)/abs(W(1)));
subplot(326)
f=f-0.5;
plot(f,fftshift(W));grid on;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?