changeset 596:5e3061733a6d

cconv.m: handle complex inputs correctly * cconv.m: Use the transpose operator instead of complex transpose to orient the result. Add %!test blocks for complex inputs.
author Mike Miller <mtmiller@octave.org>
date Mon, 02 Apr 2018 12:10:49 -0700
parents bd9f895d2e77
children c8c680528cfd
files inst/cconv.m
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/inst/cconv.m	Mon Apr 02 12:06:28 2018 -0700
+++ b/inst/cconv.m	Mon Apr 02 12:10:49 2018 -0700
@@ -104,7 +104,7 @@
   c = ifft (fft (a) .* fft (b)) ;
 
   if (!flgcolumn)
-    c = c';
+    c = c.';
   endif
 
 endfunction
@@ -124,6 +124,9 @@
 %!assert (cconv ([2 1 2 1], [1 2 3 4], 2), [28 32])
 %!assert (cconv ([2 1 2 1], [1 2 3 4], 1), 60)
 
+%!assert (cconv (x*j, 1), [1j, 2j, 3j, 4j, 5j])
+%!assert (cconv (x'*j, 1), [1j; 2j; 3j; 4j; 5j])
+
 ## Test input validation
 %!error cconv ()
 %!error cconv (1)