Discrete Fourier Transform using MATLAB?

조회 수: 1 (최근 30일)
Suranjana Das
Suranjana Das 2016년 3월 4일
답변: Sufiyan 2023년 3월 2일
how to write code for 4 point DFT?

답변 (1개)

Sufiyan
Sufiyan 2023년 3월 2일
Hello,
You can refer to the below code.
% Define the input sequence x[n]
x = [1 2 3 4];
% Compute the DFT coefficients X[k]
X = zeros(1, 4);
for k = 1:4
for n = 1:4
X(k) = X(k) + x(n) * exp(-2*pi*1i*(n-1)*(k-1)/4);
end
end
disp(X);
10.0000 + 0.0000i -2.0000 + 2.0000i -2.0000 - 0.0000i -2.0000 - 2.0000i

카테고리

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