Apply a digital filter (direct form II transposed): Difference between revisions

m
→‎version 1: changed some comments and whitespace.
m (→‎version 1: changed some comments and whitespace.)
Line 672:
' 0.741527555207 0.277841675195 0.400833448236 -0.2085993586 -0.172842103641' ,
'-0.134316096293 0.0259303398477 0.490105989562 0.549391221511 0.9047198589 '
$.=0; N= words(@s); w= length(n) /* [↑] signal vector*/
do i=1 for N; #=0 /*process each of the vector elements. */
#=0 do j=1 for words(@b); if i-j >= 0 then #= # + word(@b, j) /*temp variableword(@s, usedi-j+1); in calculations. */end
do jk=1 for words(@ba); _= i -k +1; if i-jk >= 0 then #= # + - word(@ba, jk) * $._; word(@s, i-j+1)end
$.i= # / word(@a ,1); call tell /*only display using half the dec digs.*/
end /*ji*/ /* [↑] processonly allshow theusing B½ coefficientsthe dec. digs*/
 
do k=1 for words(@a); _=i - k + 1; if i-k >= 0 then #=# - word(@a, k) * $._
end /*k*/ /* [↑] process all the A coefficients.*/
$.i= # / word(@a ,1); call tell /*only display using half the dec digs.*/
end /*i*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/