Inconsistent images of the same signal after FFT and DFT processing

2 Ansichten (letzte 30 Tage)
Huhu
Huhu am 21 Okt. 2021
Sine wave: “s = sin(((1:64)-1)*2*pi*w/100)” for various values of w. Inconsistency between DFT and FFT images occurs when w is equal to an integer multiple of 12.5. The images are consistent when w is other values.
FFfunction sw = dft(st)
% DFT - Discrete Fourier Transform
M = length(st);
N = M;
WN = exp(2*pi*1j/N);
% Main loop
for n=0:N-1
temp = 0;
for m=0:M-1
temp=temp+st(m+1)*WN^(m*n);
end
sw(n+1) = temp;
subplot(4,1,1); stem(real(sw)); title('Real');
subplot(4,1,2); stem(imag(sw)); title('Imag');
subplot(4,1,3); stem(abs(sw)); title('Abs');
subplot(4,1,4); stem(angle(sw)); title('Angle');
end
function swf = FFt(s)
swf=fft(s);
subplot(4,1,1); stem(real(swf)); title('Real');
subplot(4,1,2); stem(imag(swf)); title('Imag');
subplot(4,1,3); stem(abs(swf)); title('Abs');
subplot(4,1,4); stem(angle(swf)); title('Angle');
end

Antworten (0)

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by