cw1.m
来自「some code use for dsb matlabe」· M 代码 · 共 26 行
M
26 行
%discrete-time forier trasnform computation
%read in the desired lenght dtft
k = 255
%seat in numerator and denumerator coefficiencs
num =[0.0518 -0.1553 0.1553 0.0518]
den =[1 1.282 1.0388 0.341]
%compute the frequency responce
w=0:pi/k:pi;
h=freqs(num,den,w);
%plot the frequency responcs
subplot(2,2,1)
plot(w/pi,real(h));grid
title('real part')
xlabel('\omega/\pi');ylabel('amplitude')
subplot(2,2,2)
plot(w/pi,imag(h));grid
title('imaginary part')
xlabel('\omega/\pi');ylabel('amplitude')
subplot(2,2,3)
plot(w/pi,abs(h));grid
title('magnitude spectrum')
xlabel('\omega/\pi');ylabel('magnitude')
subplot(2,2,4)
plot(w/pi,angle(h));grid
title('phase spectrum')
xlabel('omega/\pi');ylabel('phase,radians')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?