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

6 ビュー (過去 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 Center および File ExchangeDiscrete 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