Discrete Fourier Transform using MATLAB?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
how to write code for 4 point DFT?
0 Kommentare
Antworten (1)
Sufiyan
am 2 Mär. 2023
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);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Discrete Fourier and Cosine Transforms finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!