IFFT results in wrong frequency
Hello,
I have a relatively simple code (see below).
What I don’t understand: It seem if I change the sampling frequency (Fs) or the signal length(L) the output of the IFFT seems to change (I used dummy values for this example) – can anyone explain to me why? So instead of 400 Hz it might show 360 Hz.
frequency =[0,400,900,2100]
FFT= [0 0; 100 -20;220 -2;50 4]
Fs = 90000
T = 1/Fs
L= 5000
t = (0:L-1)*T
X= zeros(1,L);
for (k=2:length(frequency))
X(round(frequency(k)*T*L)) = double(FFT(k,1))+i*double(FFT(k,2))
end
time= ifft(X, ‘symmetric’)*L/2Hello,
I have a relatively simple code (see below).
What I don’t understand: It seem if I change the sampling frequency (Fs) or the signal length(L) the output of the IFFT seems to change (I used dummy values for this example) – can anyone explain to me why? So instead of 400 Hz it might show 360 Hz.
frequency =[0,400,900,2100]
FFT= [0 0; 100 -20;220 -2;50 4]
Fs = 90000
T = 1/Fs
L= 5000
t = (0:L-1)*T
X= zeros(1,L);
for (k=2:length(frequency))
X(round(frequency(k)*T*L)) = double(FFT(k,1))+i*double(FFT(k,2))
end
time= ifft(X, ‘symmetric’)*L/2 Hello,
I have a relatively simple code (see below).
What I don’t understand: It seem if I change the sampling frequency (Fs) or the signal length(L) the output of the IFFT seems to change (I used dummy values for this example) – can anyone explain to me why? So instead of 400 Hz it might show 360 Hz.
frequency =[0,400,900,2100]
FFT= [0 0; 100 -20;220 -2;50 4]
Fs = 90000
T = 1/Fs
L= 5000
t = (0:L-1)*T
X= zeros(1,L);
for (k=2:length(frequency))
X(round(frequency(k)*T*L)) = double(FFT(k,1))+i*double(FFT(k,2))
end
time= ifft(X, ‘symmetric’)*L/2 fft MATLAB Answers — New Questions