필터 지우기
필터 지우기

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
Fred
Fred 2017년 3월 10일
편집: Fred 2017년 3월 10일
Thanks Star, I'll check it out and let you know.
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