[PD] a couple complex number abstractions

Charles Henry czhenry at gmail.com
Sun Feb 25 05:50:41 CET 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmult~.pd
Type: application/octet-stream
Size: 547 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070224/d4b64cc3/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: conj_mult~.pd
Type: application/octet-stream
Size: 551 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070224/d4b64cc3/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cnorm~.pd
Type: application/octet-stream
Size: 323 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070224/d4b64cc3/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cnormsq~.pd
Type: application/octet-stream
Size: 283 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070224/d4b64cc3/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cdiv~.pd
Type: application/octet-stream
Size: 583 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070224/d4b64cc3/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cdiv_thresh~.pd
Type: application/octet-stream
Size: 919 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070224/d4b64cc3/attachment-0005.obj>


More information about the Pd-list mailing list