Fourier Series`of an Even function

조회 수: 2 (최근 30일)
Salik Mallick
Salik Mallick 2020년 10월 4일
댓글: Star Strider 2020년 10월 11일
Why is a0 a value if pi when It shouldn't be?
%% Problem 17.5
display('Problem 17.5')
syms n t
Wo = 1;
T = 2*pi;
n = 1:10;
a0 = (1/T)*[int(-14,t,-pi,0) + int(7,t,0,pi)]
an = (2/T)*[int(-14*cos(n*Wo*t),-pi,0) + int(7*cos(n*Wo*t),0,pi)]
bn = (2/T)*[int(-14*sin(n*Wo*t),-pi,0) + int(7*sin(n*Wo*t),0,pi)]
  댓글 수: 3
Salik Mallick
Salik Mallick 2020년 10월 7일
Hello Mr.Belwal,
I meant why does ao have pi in it? I did the hand calculation and there shouldn't be a pi for the DC coefficent.
Star Strider
Star Strider 2020년 10월 11일
See also an apparent duplicate: Fourier Series of Rectified Cosine Function

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

채택된 답변

Utkarsh Belwal
Utkarsh Belwal 2020년 10월 8일
편집: Utkarsh Belwal 2020년 10월 8일
Hello Salik,
You are right, there should be no pi in the DC coefficient and the value should be 3.5. According to me as a0 is a symbolic variable so it has the pi symbol included in it for better precision. I calculated the value of a0 that MATLAB is displaying, and it is coming 3.5. If you want to use the numeric value, then you can do a symbolic to numeric conversion as follows:
A0_numeric = double(a0);
DISCLAIMER: These are my own views and in no way depict those of MathWorks.
  댓글 수: 1
Salik Mallick
Salik Mallick 2020년 10월 10일
Hello Mr. Belwal,
Would you know why this script isn't running?
%% Problem 17.9
display('Problem 17.9')
% Determine the Fourier coefficients an and bn of the
% first three harmonic terms of the rectified cosine
% wave
syms n t
T = 8;
Wo=2*pi/T;
n = 1:3;
an = (2/T)*[int(2.5*cos(n*Wo*t)*cos(n*Wo*t),-2,2)]
AN_numeric = double(an)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by