Hi Ok, I'm interested in getting some basic filtering going, first maybe just a simple low pass filter. So I received my copy of "Real Sound Synthesis". Section 3.9 suggests a low pass filter could be realized with a one-zero filter with "a" set between 0 and 1. Looking at http://chuck.cs.princeton.edu/doc/program/ugen_full.html#OneZero I don't see any "a", and where in the book can I read about b0 and b1. Moreover I wasn't able to locate any example code using OneZero, so if someone could provide me with a (couple of) simple example(s), I'd really appreciate it... -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
Please correct me if I'm wrong. A filter can be written in the form: N(z) H (z)= ------------ D(z) where N(z) = a_0 + a_1*z[-1] +...+ a_n*z[-n] // as many a_coeff as zeros + a0 D(z) = b_0 + b_1*z[-1] +...+ b_m*z[-m] // as many b_coeff as poles + b0 "a" "b" coefficients may be real or complex numbers. In Chuck, OneZero lets you place ONE zero anywhere along the x axis, thus "a" is forced to be real, and I guess it implicitly puts a pole at origin (0,0) in order to have a causal filter. You may use the OneZero::zero() or the ::b0() and ::b1() methods to specify the location of the zero along the x-axis. ( a_coeffs are named "b" in Chuck, and b_coeffs as "a", but that's just the name) OneZero::zero() can be regarded as the following expression: H(z) = 1 - radius*z[-1], thus a normalised filter i.e gain=1. OneZero::b0(), OneZero::b1() can be regarded as H(z) = b0 + b1*z[-1], equivlaent to H(z) = b0*(1 + b1/b0*z[-1] ), thus a filter with gain 1/b0 Something like this: /\ Im | | | | -----------------x-----------o---> Re | rad | <---------> | | hope this helps, eduard On Jul 28, 2006, at 4:43 PM, Atte André Jensen wrote:
Hi
Ok, I'm interested in getting some basic filtering going, first maybe just a simple low pass filter. So I received my copy of "Real Sound Synthesis". Section 3.9 suggests a low pass filter could be realized with a one-zero filter with "a" set between 0 and 1. Looking at http://chuck.cs.princeton.edu/doc/program/ugen_full.html#OneZero I don't see any "a", and where in the book can I read about b0 and b1.
Moreover I wasn't able to locate any example code using OneZero, so if someone could provide me with a (couple of) simple example(s), I'd really appreciate it...
-- peace, love & harmony Atte
http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/ compositions _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
eduard aylon wrote:
hope this helps,
Thanks for the explanation, will try to digest it tomorrow. Still I'd like one or two simple chuck sniplets that use OneZero, if anyone has something lying around (would be good for the doc also)... -- peace, love & harmony Atte http://www.atte.dk | quartet: http://www.anagrammer.dk http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
participants (2)
-
Atte André Jensen
-
eduard aylon