Borrar filtros
Borrar filtros

Hello, How would i go by doing a Discrete fourier transform?

1 visualización (últimos 30 días)
Gtscro
Gtscro el 8 de Dic. de 2015
Respondida: Naga Sai el 23 de Mayo de 2017
I am trying to create a discrete Fourier transform but without using fft and then plotting it, taking into consideration it is a simple matrix with numerous data points, how would i go by creating the function? i am somewhat lost in where to begin. thank you for your time.

Respuestas (1)

Naga Sai
Naga Sai el 23 de Mayo de 2017
Include below give program in your working directory when ever you execute program
function X = dft(xn,N)
%To compute the DFT of the sequence x(n)
L = length(xn);%length of the sequence
%Checking for the length of the DFT
if(N<L)
error('N must be >=L')
end
x1 = [xn zeros(1,N-L)];%Appending zeros
%Computation of twiddle factors
for k=0:1:N-1;
for n=0:1:N-1;
p = exp(-i*2*pi*n*k/N);
x2(k+1,n+1)=p;
end
end
X = x1*x2;

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by