From 932ce855d74848c4721d7ec35dc92a6a3d628a22 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 19 Feb 2021 10:19:41 -0500 Subject: =?UTF-8?q?Switch=20to=20=E2=80=A2math=20trig=20functions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filter.bqn | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'filter.bqn') diff --git a/filter.bqn b/filter.bqn index 7f0751d..9c65071 100644 --- a/filter.bqn +++ b/filter.bqn @@ -32,6 +32,7 @@ "filter.bqn takes a single option namespace, or no arguments" ! 1≥≠•args o ← ≠◶⟨•Import∘"options.bqn", ⊑⟩ •args +Sin‿Cos‿Tan ← •math # Generalized filtering # 𝕩 is the signal to filter @@ -60,12 +61,6 @@ _f ← { !∘0⊘(𝔽⊸Filter) } # Compute the frequency response from coefficients #Response ← ≍○<⟜(1∾-)○⌽´ ⊸ ((|·÷´{+⟜(𝕩⊸×)´𝕨}¨)⎉∞‿0) ⟜ (⋆0i1×Om) -# Trig (approximations for now) -SP ← (4⊸×÷5⊸-) 4׬⊸× -Sin ← (⊢-∘⊢⍟(>⟜1)·SP 1⊸|) 2|÷⟜π -Cos ← Sin (π÷2)⊸- -Tan ← Sin ÷ Cos - Om ← (2×π)×{𝕩÷o.freq} Tom ← Tan Om÷2˙ -- cgit v1.2.3