Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.
> 
> 


  • Prev by Date: Visualization site - updates
  • Next by Date: Re: Re: "2p" in BenchmarkReport[] ?
  • Previous by thread: Re: Extract Coefficients of Fourier Series
  • Next by thread: Re: Extract Coefficients of Fourier Series