FFT WITHOUT Built-in functions
조회 수: 13 (최근 30일)
이전 댓글 표시
How do I write the matlab code for fourier transform without the built-in function (fft). NOT DFT! Decimation in time radix-2fft please!
댓글 수: 0
채택된 답변
Dyuman Joshi
2022년 5월 7일
편집: Dyuman Joshi
2022년 5월 7일
Using the definition given at the end of FFT document
%x is your input
x=[1 2 3 4];
fft(x) %using for comparison
Method 1
%loop approach
for j=1:numel(x)
y(j)=sum(arrayfun(@(z) x(z)*exp(-i*2*pi*(j-1)*(z-1)/numel(x)),1:numel(x)));
end
y
Method 2
%vector approach
l=length(x);
z = x*exp(-2j*pi/l*(0:l-1).'*(0:l-1))
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!