X(k)=DFT[x(n)]= n=0 ∑ N−1 x(n)e −j N 2π nk , 0 ≤ k ≤ N − 1 0 \le k \le N-10≤k≤N−1 封装成matlab函数代码
时间: 2023-12-25 18:04:30 浏览: 68
DFT的matlab代码函数
function X = DFT(x)
% Computes the Discrete Fourier Transform of a signal x
N = length(x);
X = zeros(1,N);
for k = 0:N-1
for n = 0:N-1
X(k+1) = X(k+1) + x(n+1)*exp(-1j*2*pi*k*n/N);
end
end
end
阅读全文