From 982a545bb3a5166de9fe052161bcac4a4964fcea Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 7 Feb 2022 17:07:43 -0500 Subject: More FFT performance improvements --- fft.bqn | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fft.bqn b/fft.bqn index 735e92a..c735dc5 100644 --- a/fft.bqn +++ b/fft.bqn @@ -13,8 +13,8 @@ Sin‿Cos ← •math "FFT length must be a power of two" ! ⌊⊸=n s ← 2 ⥊˜ n - r ← (Cos≍Sin) π × (1↓s) ⥊ -⍟inv ↕⊸÷ l÷2 # Roots of unity - M ← -˝∘× ≍ +˝∘×⟜⌽ # Complex multiplication - F ← { 𝕨 ⊏⎉1⊸𝕊⍟(1<=𝕨) (=𝕨)⍉(+˝˘≍𝕨M-˝˘)𝕩 } # FFT loop - ÷⟜l⍟inv ⥊˘ r F s⊸⥊˘ ≍⟜(0¨)⍟(1==) 𝕩 + r ← (Cos⋈Sin) π × (1↓s) ⥊ -⍟inv ↕⊸÷ l÷2 # Roots of unity + M ← -´∘× ⋈ +´∘×⟜⌽ # Complex multiplication + F ← { (r (2‿0<⊸«𝕨⥊1)⊸/¨↩) ⊢ (+˝¨(𝕨⍉≍)¨r M-˝¨)𝕩 } # FFT loop + ÷⟜l⍟inv >⥊¨ (↕n) F´˜ s⊸⥊¨ (1==)◶⟨<˘,⊢⋈0¨⟩ 𝕩 } -- cgit v1.2.3