一个基于MATLAB的基4的FFT算法的代码
时间: 2024-05-24 17:13:20 浏览: 82
以下是一个基于MATLAB的基4的FFT算法的代码:
function y = fft4(x)
%基4 FFT算法
N = length(x);
if N == 1
y = x;
else
xe = x(1:2:N);
xo = x(2:2:N);
ye = fft4(xe);
yo = fft4(xo);
for k = 1:N/4
t = yo(k)*exp(-1j*2*pi*(k-1)/N);
y(k) = ye(k) + t;
y(k+N/4) = ye(k) - t;
t = yo(k + N/4)*exp(-1j*2*pi*(k-1)/N);
y(k + N/2) = -1j*(ye(k) - t);
y(k+3*N/4) = -1j*(ye(k) + t);
end
end
end
阅读全文