Signal Reconstruction: Using FFT to Approximate a Signal with Two Frequencies

  • Context: MATLAB 
  • Thread starter Thread starter member 428835
  • Start date Start date
  • Tags Tags
    Signal
Click For Summary

Discussion Overview

The discussion revolves around the reconstruction of a signal using the Fast Fourier Transform (FFT) and its inverse (IFFT), specifically focusing on a signal composed of two frequencies: 50 Hz and 120 Hz. Participants explore methods for approximating the original signal, addressing the importance of phase information in the reconstruction process.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about a robust method for reconstructing a signal using two frequencies, suggesting the use of the IFFT function.
  • Another participant questions the meaning of "literally writing out sines and cosines" and emphasizes the necessity of phase information for accurate signal reconstruction, which is not captured in a magnitude-only plot.
  • It is noted that while using the complex FFT allows for accurate reconstruction via IFFT, calculating the sine function at each time sample (with appropriate phase shifts) could be sufficient for a small number of frequencies.
  • A participant expresses confusion over the term "robust" and clarifies that they have been summing sine functions for the dominant frequencies, seeking validation on this approach.
  • Another response asserts that ignoring phase information would lead to an incomplete reconstruction of the signal, as the phase is crucial for accurately representing the original signal. It is mentioned that the complete signal representation requires both sine and cosine components or the inclusion of phase shifts.

Areas of Agreement / Disagreement

Participants express differing views on the robustness of using only sine functions for signal reconstruction. There is no consensus on the best approach, as some argue for the necessity of phase information while others suggest that a simpler method may suffice for a limited number of frequencies.

Contextual Notes

Participants highlight the importance of phase information in signal reconstruction and the potential limitations of using only magnitude data. There is also mention of the mathematical representation of signals, including the need for angular frequencies.

member 428835
I am trying to reconstruct a signal, and looked at this example: https://www.mathworks.com/help/matlab/ref/fft.html

Towards the middle of the page, there are two frequencies: 50 Hz and 120 Hz. How can I approximate reconstruct the initial signal given these two numbers? What I've been doing so far is literally writing out sines and cosines but I know there has to be a robust way to do this, likely using the ifft function.

Thanks so much for looking at this.
 
Physics news on Phys.org
I'm not sure what you mean by "literally writing out sines and cosines". Do you mean evaluating the expression A * sin(ft)? And what do you mean by "robust"?

The plot you're looking at shows magnitude only. In order to accurately reproduce the original signal you need the phase information. That would be contained in the complex FFT but not in the real-valued power spectrum plot.

If you have the complex FFT, then IFFT is what you need to go back to the time domain. But frankly I don't see anything wrong with just calculating the sine at each time sample (appropriately phase shifted) if you only have a couple of frequencies.
 
RPinPA said:
I'm not sure what you mean by "literally writing out sines and cosines". Do you mean evaluating the expression A * sin(ft)? And what do you mean by "robust"?
Yes, this is what I've been doing. By robust, I mean not literally typing sines and cosines for say the 10 most dominant frequencies.

RPinPA said:
The plot you're looking at shows magnitude only. In order to accurately reproduce the original signal you need the phase information. That would be contained in the complex FFT but not in the real-valued power spectrum plot.

If you have the complex FFT, then IFFT is what you need to go back to the time domain. But frankly I don't see anything wrong with just calculating the sine at each time sample (appropriately phase shifted) if you only have a couple of frequencies.

Thanks for the response. So you're saying to just literally write the reconstructed wave as I've been doing: ##\sum_i a_i\sin (f_i t)##, that this is the most robust way (ignoring phase) to reconstruct the signal?
 
joshmccraney said:
Thanks for the response. So you're saying to just literally write the reconstructed wave as I've been doing: ##\sum_i a_i\sin (f_i t)##, that this is the most robust way (ignoring phase) to reconstruct the signal?

I still don't know what you mean by "robust" since you explicitly said "robust" means not doing that.

No, that would not be an accurate way to reconstruct the signal as it is missing the phase information. Also technically there should either be a ##2\pi## in the argument or you should use the angular frequencies ##\omega_i = 2\pi f_i##. The complete signal is represented either by ##\sum_i a_i\sin (\omega_i t + \phi_i)## or equivalently by ##\sum_i a_i\sin (\omega_i t) + \sum_i b_i\cos (\omega_i t)##.

If you ignore the phase then the signal you construct this way will have the same frequency content as the original, but it can't be said to be a "reconstruction" of the original signal since it's missing half the information. There are infinitely many different signals with the same frequency content.
 
Thanks!
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 6 ·
Replies
6
Views
5K
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 14 ·
Replies
14
Views
25K
  • · Replies 2 ·
Replies
2
Views
2K