📄 e_printf.m
字号:
function e_printf(N,B,w,string)
n=[0:(N-1)];
hd=exp4_ideal(w,N);
h=hd.*(B)';
[H,m]=freqz(h,[1],1024,'whole');
mag=abs(H);
db=20*log10((mag+eps)/max(mag));
pha=angle(H);
subplot(2,3,2);
n=0:N-1;
stem(n,h,'.');
axis([0 N-1 -0.1 0.3]);
hold on
n=0:N-1;
x=zeros(N);
plot(n,x,'-');
xlabel('n');
ylabel('h(n)');
title('实际低通滤波器');
text((0.3*N),0.27,string);
hold off
subplot(2,3,4);
plot(m/pi,db);
axis([0 1 -100 0]);
xlabel('w/pi');
ylabel('dB');
title('衰减特性');
subplot(2,3,5);
plot(m,pha);
hold on
n=0:7;
x=zeros(8);
plot(n,x,'r-');
title('相频特性');
xlabel('w(rad)');
ylabel('Phase(rad)');
hold off
axis([0 3.15 -4 4]);
subplot(2,3,6);
plot(m,mag);
title('幅频特性');
xlabel('w(rad)');
ylabel('Mag');
axis([0 3.15 0 1.5]);
text(0.9,1.2,string);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -