📄 ex050600.m
字号:
% Chapter 05: Example 05.06: Simple DFT Example%x = [1,1,1,1];subplot(1,1,1);%% a) DTFTw = [0:1:500]*2*pi/500;[H] = freqz(x,1,w);magH = abs(H); phaH = angle(H); phaH(126)=-47.5841*pi/180;subplot(2,1,1); plot(w/pi,magH); gridxlabel('frequency in pi units');ylabel('|X|'); title('Magnitude of the DTFT')subplot(2,1,2); plot(w/pi,phaH/pi*180); gridxlabel('frequency in pi units');ylabel('Degrees'); title('Angle of the DTFT')%print -deps2 me0506a.epspause;subplot(1,1,1)%% b) 4-point DFTN = 4; w1 = 2*pi/N; k = 0:N-1;X = dft(x,N);magX = abs(X), phaX = angle(X)*180/pisubplot(2,1,1);plot(w*N/(2*pi),magH,'--'); axis([-0.1,4.1,-1,5]); hold onstem(k,magX);xlabel('k');ylabel('|X(k)|'); title('Magnitude of the DFT: N=4')hold offsubplot(2,1,2);plot(w*N/(2*pi),phaH*180/pi,'--');axis([-0.1,4.1,-200,200]); hold onstem(k,phaX);xlabel('k');ylabel('Degrees'); title('Angle of the DFT: N=4')%print -deps2 me0506b.eps
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -