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
- References:
- Extract Coefficients of Fourier Series
- From: "mchangun@gmail.com" <mchangun@gmail.com>
- Extract Coefficients of Fourier Series