DSP实验报告B13011025讲解 下载本文

x = [0 2 4 6 8 10 12 14 16]; N = length(x)-1; n = 0:N; y = circshift(x,5); XF = fft(x); YF = fft(y); subplot(2,2,1) stem(n,abs(XF));grid

title('Magnitude of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('|X[k]|'); subplot(2,2,2) stem(n,abs(YF));grid

title('Magnitude of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('|Y[k]|'); subplot(2,2,3)

stem(n,angle(XF));grid

title('Phase of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('arg(X[k])'); subplot(2,2,4)

stem(n,angle(YF));grid

title('Phase of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('arg(Y[k])');

时移量是5。

Q3.33运行修改后的程序并验证离散傅里叶变换的圆周时移性质。

Q3.34选取两个不同的时移量,重做习题Q3.33。 (1)修改后的程序如下:

clf;

x = [0 2 4 6 8 10 12 14 16]; N = length(x)-1; n = 0:N; y = circshift(x,3); XF = fft(x); YF = fft(y); subplot(2,2,1) stem(n,abs(XF));grid

title('Magnitude of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('|X[k]|'); subplot(2,2,2) stem(n,abs(YF));grid

title('Magnitude of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('|Y[k]|'); subplot(2,2,3) stem(n,angle(XF));grid

title('Phase of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('arg(X[k])'); subplot(2,2,4) stem(n,angle(YF));grid

title('Phase of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('arg(Y[k])');

(2)修改后的程序如下:

clf;

x = [0 2 4 6 8 10 12 14 16]; N = length(x)-1; n = 0:N; y = circshift(x,6); XF = fft(x); YF = fft(y); subplot(2,2,1) stem(n,abs(XF));grid

title('Magnitude of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('|X[k]|'); subplot(2,2,2) stem(n,abs(YF));grid

title('Magnitude of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('|Y[k]|'); subplot(2,2,3)

stem(n,angle(XF));grid

title('Phase of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('arg(X[k])'); subplot(2,2,4)

stem(n,angle(YF));grid

title('Phase of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('arg(Y[k])');

Q3.35选取两个不同长度的序列,重做习题Q3.33。

修改后的程序如下:

clf;

x = [2 4 6 8 10 12 14 16]; N = length(x)-1; n = 0:N; y = circshift(x,5); XF = fft(x); YF = fft(y); subplot(2,2,1) stem(n,abs(XF));grid

title('Magnitude of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('|X[k]|'); subplot(2,2,2) stem(n,abs(YF));grid

title('Magnitude of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('|Y[k]|'); subplot(2,2,3) stem(n,angle(XF));grid

title('Phase of DFT of Original Sequence'); xlabel('Frequency index k'); ylabel('arg(X[k])'); subplot(2,2,4) stem(n,angle(YF));grid

title('Phase of DFT of Circularly Shifted Sequence'); xlabel('Frequency index k'); ylabel('arg(Y[k])');

修改后的程序如下: