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

  • MATLAB
  • Thread starter member 428835
  • Start date
  • Tags
    Signal
In summary, the conversation discussed reconstructing a signal using two frequencies (50 Hz and 120 Hz) and the use of the ifft function. It was mentioned that calculating sines and cosines may not be the most robust way to reconstruct the signal as it ignores the phase information. The need for phase information was emphasized and it was suggested to use the complex FFT and IFFT to accurately reproduce the original signal. It was also noted that ignoring phase information can result in multiple signals with the same frequency content.
  • #1
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
  • #2
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.
 
  • #3
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?
 
  • #4
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.
 
  • #5
Thanks!
 

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

1. What is signal reconstruction?

Signal reconstruction is the process of using a mathematical algorithm, such as the Fast Fourier Transform (FFT), to approximate a signal with two frequencies. This allows us to analyze and manipulate signals in the frequency domain, which can provide insights into the underlying components of the signal.

2. How does the FFT work?

The FFT is an efficient algorithm for calculating the Fourier Transform of a signal, which reveals the frequencies and amplitudes present in the signal. It works by breaking down the signal into smaller parts, calculating their Fourier Transforms, and then combining them to reconstruct the original signal.

3. What is the benefit of using FFT for signal reconstruction?

The FFT provides a more efficient and accurate method for analyzing signals with multiple frequencies compared to traditional methods. It allows us to quickly identify the different frequencies and their amplitudes in a signal, making it useful in a wide range of applications such as signal processing, image processing, and data compression.

4. Can the FFT accurately reconstruct any signal with two frequencies?

The FFT can accurately reconstruct a signal if it meets certain criteria, such as having a finite length and being periodic. However, it may not be suitable for signals with irregularities or noise. In these cases, other methods may be more effective.

5. How can the results of FFT-based signal reconstruction be validated?

To validate the accuracy of FFT-based signal reconstruction, we can compare the reconstructed signal with the original signal and calculate the error or difference between them. Additionally, we can use simulation or experimental data with known signals to verify the results of the reconstruction process.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
759
  • Electrical Engineering
Replies
4
Views
152
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • General Math
Replies
1
Views
755
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
4K
Back
Top