Does anyone know how to construct original discrete time signal by using IFFT(x) function?

5 次查看(过去 30 天)
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 个评论
Adam
Adam 2017-3-8
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.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2017-3-8
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 个评论
Star Strider
Star Strider 2017-3-10
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.

请先登录,再进行评论。

更多回答(1 个)

Lugo Hino Far
Lugo Hino Far 2020-5-6
Help! I need to build those charts. They are Fourier Series.

Community Treasure Hunt

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

Start Hunting!

Translated by