[Jprogramming] jwiki/Essays/FFT
Linda Alvord
lindaalvord at verizon.net
Wed Jul 18 05:37:34 UTC 2012
Or maybe imaginary roots:
Iroots=: 13 :',._1^+:(i.y)%y'
iroots
[: ,. _1 ^ [: +: i. % ]
iroots 3
1
_0.5j0.866025
_0.5j_0.866025
Linda
-----Original Message-----
From: programming-bounces at forums.jsoftware.com
[mailto:programming-bounces at forums.jsoftware.com] On Behalf Of Bo Jacoby
Sent: Wednesday, July 18, 2012 1:09 AM
To: programming at jsoftware.com
Subject: Re: [Jprogramming] jwiki/Essays/FFT
<henryhrich at nc.rr.com> wrote: "My roots-of-unity verb was designed to get
higher accuracy than simpler approaches."
The verb
PoU=:_1^+: NB. Power of Unity
is not contaminated by transcendental numbers such as (2p1) or
transcendental functions such as monadic (^). If (y) is rational then (PoU
y) is algebraic, so transcendence is not needed. The precision seems OK,
even without the use of ((**|)&.+.)
n,.PoU(n=.i.8)%8
0 1
1 0.707107j0.707107
2 0j1
3 _0.707107j0.707107
4 _1
5 _0.707107j_0.707107
6 0j_1
7 0.707107j_0.707107
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list