subexpressions (fourier example)

Steve Howell showell30 at yahoo.com
Sat Jun 2 11:47:45 EDT 2007


--- Steve Howell <showell30 at yahoo.com> wrote:

> 
> --- Stef Mientki <S.Mientki-nospam at mailbox.kun.nl>
> wrote:
> > Maybe he meant
> >    sin(x)^2 + cos(x)^2
> > which is well known demodulation technique if you
> > create two signals 90 degrees out of phase.
> > 
> 

A more realistic subexpression where you might repeat
yourself:

lambda t: a[0]/2 + sum(a[n]*cos(n*f*t) +
b[n]*sin(n*f*t) \
    for n in range(1,101))

http://en.wikipedia.org/wiki/Fourier_series

Granted it's not the best style to cram it in a
lambda, but I think some folks might prefer the
terseness.






      ___________________________________________________________________________________
You snooze, you lose. Get messages ASAP with AutoCheck
in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html



More information about the Python-list mailing list