Re: Extract Coefficients of Fourier Series
- To: mathgroup at smc.vnet.net
- Subject: [mg58840] Re: [mg58811] Extract Coefficients of Fourier Series
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Wed, 20 Jul 2005 00:29:41 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
Needs["NumericalMath`TrigFit`"];
data=Table[
1+2Sin[x]+3Cos[2x]+4 Sin[3x],
{x,0,2Pi-2Pi/7,2Pi/7}];
(cl=CoefficientList[
Chop[TrigFit[data,3,x]]/.
{Sin[x*n_.]:>s^n,Cos[x*m_.]:>c^m},
{s,c}])//InputForm
{{1.0000000000000002, 0, 3.}, {1.9999999999999996, 0, 0},
{0, 0, 0}, {3.999999999999999, 0, 0}}
Tr[Plus@@(cl^2)]
30.
Bob Hanlon
>
> From: "mchangun at gmail.com" <mchangun at gmail.com>
To: mathgroup at smc.vnet.net
> Date: 2005/07/19 Tue AM 04:10:24 EDT
> Subject: [mg58840] [mg58811] Extract Coefficients of Fourier Series
>
> Hi All,
>
> I have a set of points which have I fitted to a fourier serires with
> the TrigFit function. This gives me a fourier series. What I want is
> to extract all the coefficients of the series, square them, then sum
> them. How do I this (more specifically, the extraction step?
>
> Thanks in advanced.
>
>