fft(x,n) NO BUILT IN FUNCTION WHERE n > size(x)
Show older comments
Hi
I'm looking for fft & ifft function code for fff(x,n) where n > size(x).
I found this here :
and it works well for all fft(x) & ifft(x) where n=size(x) but not for n>size(x)
function Xk = myfft(x)
N = length(x); % The fundamental period of the DFT
n = 0:1:N-1; % row vector for n
k = 0:1:N-1; % row vecor for k
WN = exp(-1i*2*pi/N); % Wn factor
nk = n'*k; % creates a N by N matrix of nk values
WNnk = WN .^ nk; % DFT matrix
Xk = x * WNnk; % row vector for DFT coefficients
function x_hat = myifft(ftx)
N = length(ftx); % The fundamental period of the DFT
n = 0:1:N-1;
k = 0:1:N-1;
WN = exp(-1i*2*pi/N);
nk = n'*k;
WNnk = WN .^ (-nk); % IDFS matrix
x_hat = (ftx * WNnk)/N; % row vector for IDFS values
x_hat=real(x_hat);
How can I modify this code (or to take an other one) for my task?
Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Fast Fourier Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!