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: [mg58824] Re: Extract Coefficients of Fourier Series
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 20 Jul 2005 00:29:22 -0400 (EDT)
  • References: <dbie2e$brj$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hello,
squaring and adding the coefficients can be done by pattern matching.
Assume that fs is your fourier series. Then

fs/. {a_Real Sin[_] :> a^2 , a_Real Cos[_] :> a^2 , a_Real -> a^2}

will replace Sin/Cos terms by the square of their coefficients and 
finally take care of the zero term. Therefore, the sequence of the 
replacement rules is important here. Addition is done automatically by 
Mathematica.

sincerely, Daniel

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


  • Prev by Date: writing text and formula in mathematica
  • Next by Date: Re: Extract Coefficients of Fourier Series
  • Previous by thread: Re: Extract Coefficients of Fourier Series
  • Next by thread: Re: Extract Coefficients of Fourier Series