Does anyone know how to construct original discrete time signal by using IFFT(x) function?
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Fred
le 8 Mar 2017
Réponse apportée : Lugo Hino Far
le 6 Mai 2020
Hi,
I need to construct my 24 point discrete time series by using its first 5 harmonics. I know I can use x=ifft(y) to obtain the original signal in which x and y should have the same dimensions (24x1 and 24x1). My question is that is it possible to obtain the same size of x (24x1) by using let's say first 5 element of y?
Thanks,
1 commentaire
Adam
le 8 Mar 2017
24 samples doesn't seem very many to expect to have 5 distinct harmonics. But if you know their frequencies and they fit on the grid defined by just 24 samples in frequency space, then yes you can recreate your signal if you have the sampling frequency.
Réponse acceptée
Star Strider
le 8 Mar 2017
You could use only the first five frequencies, if you wanted an approximation. Reconstructing from less than all the available frequency components loses detail in the reconstruction. The reconstructed signal will be the size of the frequencies you used to reconstruct it. You can zero-pad the reconstructed signal out to the length of the original vector (I did not do that here), but you cannot recover the information you lost.
Example:
t = linspace(0, 1, 24); % Time Vector
x = (t >= 1/3) & (t <= 2/3); % Signal Vector
y = fft(x); % Fourier Transform
ys1 = fftshift(y); % Shift To Centre
ys2 = fliplr(fftshift(ys1(8:18))); % Take Centre 5 Frequencies, Shift Back, And Flip
xinv = ifft(ys2);
figure(1)
plot(x,'b')
hold on
plot(xinv,'r')
plot(ifft(y), '--g')
hold off
legend('Original Waveform', 'Reconstructed From First 5 Freqencies', 'Reconstructed From All Frequencies')
8 commentaires
Star Strider
le 10 Mar 2017
My pleasure.
Note that all I did to design the second harmonic filter was to add 1 to the bandpass and bandstop vectors. Do the same for as many harmonics (up to 12) as you want. The Chebyshev Type II design will provide good separation with filters short enough to work with a 24-element data vector.
Plus de réponses (1)
Lugo Hino Far
le 6 Mai 2020
Help! I need to build those charts. They are Fourier Series.
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!