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: [mg58826] Re: [mg58811] Extract Coefficients of Fourier Series
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Wed, 20 Jul 2005 00:29:23 -0400 (EDT)
  • References: <200507190810.EAA11578@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

mchangun at gmail.com wrote:

>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.
>
>  
>
Hope this is what you are looking for

<< NumericalMath`TrigFit`
data = Table[1 + 2Sin[x] + 3Cos[2x] + 4 Sin[3x], {x, 0, 2Pi - 2Pi/7, 
2Pi/7}];
f[x_] = TrigFit[data, 3, {x, 1}] // Chop
coefficientposition = Position[f[x], _Real]
coeffs = Extract[f[x], coefficientposition]
Total[coeffs^2]

Best regards
Pratik

-- 
Pratik Desai
Graduate Student
UMBC
Department of Mechanical Engineering
Phone: 410 455 8134



  • Prev by Date: Re: Extract Coefficients of Fourier Series
  • Next by Date: Visualization site - updates
  • Previous by thread: Extract Coefficients of Fourier Series
  • Next by thread: Re: Extract Coefficients of Fourier Series