Home > maths > FFT – I did it my way…

FFT – I did it my way…

January 22nd, 2008 okflo Leave a comment Go to comments

Meistro Fourier…

Completely needless and trivial – my own implementation of fft (fast fourier transformation) in matlab. Yes, I know, there ist already fft, fft2, and fftn – but as a proof of concept:

function myfft(vec)
%MYFFT My own simple version of FFT :)
  vec * fftmatrix(length(vec))
end

function thematrix = fftmatrix(n)
% FFTMATRIX Generates a fft-matrix of the size n x n
  thematrix = zeros(n,n);
  for izeile = 1:n
    for ispalte = 1:n
      thematrix(izeile,ispalte) = exp(i*(2*pi/n))^((izeile-1)*(ispalte-1));
    end
  end
end
Categories: maths Tags:
  1. No comments yet.
  1. No trackbacks yet.