program_04_1.m

来自「自编的一些小波源程序,用MATLAB编的.希望对那些喜欢小波的人有所帮助.去解压」· M 代码 · 共 21 行

M
21
字号
% Program 4_1
% Generate the filter coefficients
colordef black
h1 = ones(1,5)/5; h2 = ones(1,14)/14;h3 = ones(1,200)/200;
w = 0:pi/255:pi;
%  Compute the frequency responses
H1 = freqz(h1, 1, w);
H2 = freqz(h2, 1, w);
H3 = freqz(h3, 1, w);
%  Compute and plot the magnitude responses
m1 = abs(H1); m2 = abs(H2); m3 = abs(H3);
plot(w/pi,m1,'r-',w/pi,m2,'g--',w/pi,m3,'y-');
ylabel('Magnitude'); xlabel('\omega/\pi');
legend('r-','M=5','g--','M=14','y-','M=200');
pause
%  Compute and plot the phase responses
ph1 = angle(H1)*180/pi; ph2 = angle(H2)*180/pi;ph3 = angle(H3)*180/pi;
plot(w/pi,ph1,'r-',w/pi,ph2,'g--',w/pi,ph3,'y-');
ylabel('Phase, degrees');xlabel('\omega/\pi');
legend('r-','M=5','g--','M=14','y-','M=200');

⌨️ 快捷键说明

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