Plotting even and odd extensions of a function

조회 수: 3 (최근 30일)
steven
steven 2019년 3월 16일
댓글: Star Strider 2019년 3월 16일
What's an easy way of plotting odd or even extentions of a function on the whole real number line?
For instance, if you are given on , how can one plot the fourier series of this function for odd and even extentions.

답변 (1개)

Star Strider
Star Strider 2019년 3월 16일
I am not certain what you mean by ‘extensions’.
Fourier series are comprised of cosine functions (real coefficients) that are even, and sine functions (imaginary coefficients) that are odd. See the Wikipedia article on Even and odd functions (link) for an extended discussion.
  댓글 수: 2
steven
steven 2019년 3월 16일
This example from Desmos visualizes what I mean by odd extention. I would like to plot a simliar piecewise function on all real number line.
Star Strider
Star Strider 2019년 3월 16일
I’m still not certain what you mean by ‘extension’.
That page illustrates the effect of adding more Fourier analysis ‘frequencies’ (with their associated coefficients) to the reconstruction of that waveform. The more terms you add, the more closely the reconstruction from the Fourier coefficients will approach the analysed waveform.
With respect to a square wave, that is very easy to demonstrate:
t = linspace(0, 3, 500);
f = sin(t(:) * [1 3 5 7 9] *2*pi) * 1./[1 3 5 7 9];
figure
plot(t, cumsum(f,2))
grid
Experiment to get the result you want.

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

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by