Great work! I'd suggest modeling fbar's approach and making a *-help.pd file for either each of them, or the whole group at least.
Also, even if they seem trivial, if you are making this library of abstractions for something like CVS (which would be GREAT), it would be nice to have the conjugate, addition, and subtraction also.
Thanks for sharing this!
~Kyle
On 2/24/07, Charles Henry czhenry@gmail.com wrote:
Hi, list, I put together a few abstractions I wanted to share. These are just basic operations for complex arithmetic (I left out conjugate, addition, and subtraction, since I thought they were too basic). cmult~ -- multiplies two complex signals; inlets are ordered from left to right: sig1-real, sig1-imaginary, sig2-real, sig2-imaginary (this is consistent for all the rest too) conj_mult~ -- multiplies sig1 by the complex conjugate of sig2 cnorm~ -- computes sqrt(real^2+imag^2), Would this be more efficient using expr? cnormsq~ -- computes real^2+imag^2. Same question as cnorm~ cdiv~ -- divides sig1 by sig2. Wherever sig2 is zero, the result is zero rather than undefined. It is still not advised to use cdiv~ unless you have a signal that you know has all of its frequencies cdiv_thresh~ -- accepts a threshold argument, and divides sig1 by sig2 whenever the complex norm squared of sig2 is greater than the threshold. Returns zero otherwise. Later, Chuck
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list