필터 지우기
필터 지우기

Adding Harmonics of a sine wave together

조회 수: 3 (최근 30일)
Syed AWM
Syed AWM 2020년 12월 3일
편집: Syed AWM 2020년 12월 8일
I have extracted harmonics of a sine wave through 'fft' in matlab. I considered the phase to define the signs of each harmonics - a two sided psd is shown in fig below. However when I add the first 8 harmonics, I do not get the exact sine wave as shown in fig below. Can some one help?
  댓글 수: 2
Syed AWM
Syed AWM 2020년 12월 3일
from psd plot, beyond the 5th harmonic amplitude becomes negligible, though I added 8 harmonics
Bjorn Gustavsson
Bjorn Gustavsson 2020년 12월 8일
To get help from others you cannot remove the plot with the original function and your sum-of-sines approximations.

댓글을 달려면 로그인하십시오.

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2020년 12월 3일
You have to take into account that the fft returns complex Fourier-coefficient - that is both real and imaginary components. So you have to use both sin and cos - terms in your sum, also the average of the signal is not zero so you should have a negative (?) DC-component giving you a constant off-set, that is absent from your plot.
HTH
  댓글 수: 2
Syed AWM
Syed AWM 2020년 12월 4일
by 0H in that plot I mean the 0th Harmonic or DC component which has an amplitude as shown in the PSD plot. While adding them as sine or cos the frequency of 0th harmonic would be zero - which that is why it has zero contribution.
Bjorn Gustavsson
Bjorn Gustavsson 2020년 12월 4일
No.
The Fourier-series approximation of your periodic signal is:
For your second "original curve" (orange with '.-') it is not the case that the average (DC-component) is zero, therefore a_0 is smaller than zero, and cos(0) is equal to 1. Since it is non-zero you have to use that term in your sum-of-Fourier-terms. It seems rather plausible that some of the other cosine-coefficients also are non-zero and they also have to be included.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by