Question: Plotting a procedure is this possible? tia sal2

 

Plotting a procedure is this possible?

Greetings All

I’ve worked out a Fourier Series Expansion using excel and verified it by graphing it in excel to check my results.  See example

http://demos.onewithall.net/discrete_fourier_expansion_coefficients.jpg

I was given a procedure from the Maple forums that does Fourier Series Expansion and it works great in Maple 11

myFourier := proc(period,amps::list,numCoeffs::posint)

 

   module()

 

      export a0,aAreas,bAreas,aCoeffs,bCoeffs;

 

      a0 := `+`(amps[])/period;

 

      aAreas,bAreas := seq(Matrix(nops(amps),numCoeffs,

 

         (i,j) -> evalf(amps[i]*X(2*(i-1)*j*Pi/period))

 

      ),X in [cos,sin]);

 

      aCoeffs,bCoeffs := seq(Vector[row](numCoeffs,

 

         (i) -> `+`(convert(X[1..nops(amps),i],list)[])*2/period

 

      ),X in [aAreas,bAreas]);

 

   end module

 

end proc:


wave := myFourier(10,[14,18.7,9,4.1,6.7,6,6.3,8.4,4,2.9],5):

 

wave:-a0;

 

wave:-aAreas;

 

wave:-bAreas;

 

wave:-aCoeffs;

 

wave:-bCoeffs;

But I would also like to verify the data using Maple’s Plot function to do a visual check also.  Can this procedure be modified to verify the data graphically with plots? If not does anyone have any suggestions on how to verify the data visually from this procedure?

TIA

Sal2

Please Wait...