how to create a dft function without using other functions of matlab

조회 수: 20 (최근 30일)
Naga Sai
Naga Sai 2017년 5월 23일
답변: Subhash Mardi 2018년 8월 23일
how to create a discrete fourier transform function with out using other functions of matlab please help regarding this sir.
  댓글 수: 4
Stephen23
Stephen23 2017년 5월 23일
fft, ifft, and fftw are part of basic MATLAB.
Naga Sai
Naga Sai 2017년 5월 31일
sir i got the code sir
function Xk = dft(xn,N)
%To compute the dft of the sequence x(n)
L = length(xn);
%Check for the length of the DFT
if(N<L)
error('Length of DFT should be greater than the input sequence');
end
x1 = [xn zeros(1,N-L)];%Zero padding to the input sequence and assigning the value to the other vector
%Twiddle factors
for n=0:1:N-1;
for k=0:1:N-1;
p = exp(2*pi*-j*n*k/N);
x2(k+1,n+1) = p;
end
end
Xk=x1*x2;

댓글을 달려면 로그인하십시오.

답변 (1개)

Subhash Mardi
Subhash Mardi 2018년 8월 23일
N=input('enter the sequence'); Y=input('enter the order of sequence'); for n=0:1:N-1; for k=0:1:N-1; p = exp(2*pi*-j*n*k/N); x2(k+1,n+1) = p; end end Xk=x1*x2;

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by