diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-19 10:19:41 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-02-19 10:19:41 -0500 |
| commit | 932ce855d74848c4721d7ec35dc92a6a3d628a22 (patch) | |
| tree | 782912501a1dae22751740b8590ebf97ea7c0750 /filter.bqn | |
| parent | 5643af00cc8922d94b91b53b37ba4a42eaa0d07c (diff) | |
Switch to •math trig functions
Diffstat (limited to 'filter.bqn')
| -rw-r--r-- | filter.bqn | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -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˙ |
