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
SUMMARY

This discussion focuses on reconstructing a signal using the Fast Fourier Transform (FFT) and its inverse (IFFT) with specific frequencies of 50 Hz and 120 Hz. Participants emphasize the importance of including phase information in the reconstruction process, as neglecting it results in a loss of accuracy. The correct approach involves using the complete representation of the signal, which includes both sine and cosine components, rather than solely relying on sine functions. The conversation highlights that while calculating sine values can work for a few frequencies, it does not yield a true reconstruction of the original signal.

PREREQUISITES
  • Understanding of Fast Fourier Transform (FFT) and Inverse Fast Fourier Transform (IFFT)
  • Knowledge of signal representation using sine and cosine functions
  • Familiarity with phase information in signal processing
  • Basic concepts of angular frequency and frequency components
NEXT STEPS
  • Study the implementation of FFT and IFFT in MATLAB
  • Learn about phase information and its role in signal reconstruction
  • Explore the mathematical representation of signals using both sine and cosine components
  • Investigate the implications of ignoring phase in signal processing
USEFUL FOR

Signal processing engineers, MATLAB users, and anyone involved in reconstructing signals from frequency components will benefit from this discussion.

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
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 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K