aboutsummaryrefslogtreecommitdiff
path: root/filter.bqn
diff options
context:
space:
mode:
Diffstat (limited to 'filter.bqn')
-rw-r--r--filter.bqn10
1 files changed, 5 insertions, 5 deletions
diff --git a/filter.bqn b/filter.bqn
index d532627..7f0751d 100644
--- a/filter.bqn
+++ b/filter.bqn
@@ -38,13 +38,13 @@ o ← ≠◶⟨•Import∘"options.bqn", ⊑⟩ •args
# 𝕨 is ⟨result coefficients , 𝕩 coefficients⟩.
Filter ← {
⟨i0⟩‿⟨o0⟩ 𝕊𝕩:
- 1↓ (×⟜o0+i0⊸×)` 0∾𝕩
+ 0 (×⟜o0+i0⊸×)` 𝕩
;⟨i0,i1⟩‿⟨o0⟩ 𝕊𝕩:
- b0←a1←a0←0 ⋄ coeff←∾𝕨
- { b0↩+´coeff×⟨a0↩a1,a1↩𝕩,b0⟩ }¨ 𝕩
+ a1←a0←0
+ 0 (+´(∾𝕨)×{⟨a0↩a1,a1↩𝕩,𝕨⟩})` 𝕩
;⟨i0,i1,i2⟩‿⟨o0,o1⟩ 𝕊𝕩:
- b1←b0←a2←a1←a0←0 ⋄ coeff←∾𝕨
- { b1↩+´coeff×⟨a0↩a1,a1↩a2,a2↩𝕩,b0,b0↩b1⟩ }¨ 𝕩
+ b0←a2←a1←a0←0
+ 0 (+´(∾𝕨)×{⟨a0↩a1,a1↩a2,a2↩𝕩,b0,b0↩𝕨⟩})` 𝕩
;coeff 𝕊𝕩:
a‿b ← 0×coeff # accumulators for input and result
c ← ∾coeff