]> git.rkrishnan.org Git - dttsp.git/blobdiff - jDttSP/cxops.c
Bug fixes to jsdr, keyer
[dttsp.git] / jDttSP / cxops.c
index b54dbef87931cc5c8879fe5bf22dd98f92a102f3..4927de7b37f3737c7876edf44115c9efddf80720 100644 (file)
@@ -107,3 +107,13 @@ Cexp(COMPLEX z) {
   REAL r = exp(z.re);
   return Cmplx(r * cos(z.im), r * sin(z.im));
 }
+
+COMPLEX
+Cp2r(COMPLEX z) {
+  return Cmplx(z.re * cos(z.im), z.re * sin(z.im));
+}
+
+COMPLEX
+Cr2p(COMPLEX z) {
+  return Cmplx(sqrt(sqr(z.re) + sqr(z.im)), ATAN2(z.im, z.re));
+}