matlabprogramminginterwiththedsp.txt

来自「Matlab programming interface with the ds」· 文本 代码 · 共 69 行

TXT
69
字号
matlab与dsp接口编程,矩阵运算IDFT                                                                                                              

N = input('type in the length of DFT   N=   ');

x = input('type in the sequense of [X[k]] =');

n=0:N-1;

for a=1:N

      for b=1:N

          w1(a,b)= exp(2*(a-1)*(b-1)*pi*j/N);

      end

end

input('Please push "enter" check the IDFT1 from "matrix"');

IDFT1=x*w1./N

input('Please push "enter" check the IDFT2 from ifft');

IDFT2=ifft(x)

input('Please push "enter" check the IDFT1-IDFT2');

d=IDFT1-IDFT2

subplot(411);

stem(n,abs(x));

xlabel('time/n');ylabel('amplitude');

grid on;

subplot(412);

stem(n,abs(IDFT1));

xlabel('time/n');ylabel('amplitude');

title('IDFT from matrix');

grid on;

subplot(413);

stem(n,(IDFT2));

xlabel('time/n');ylabel('amplitude');

title('IDFT from "IFFT"');

grid on;

subplot(414)

plot(n,abs(d));

xlabel('time/n');ylabel('amplitude');

axis([0,N, -0.025,+0.025])

grid on;
 

⌨️ 快捷键说明

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