convolution of 2d arrays of exotic complex numbers (dual and split)
![](https://secure.gravatar.com/avatar/6c38c5a05475dff28f929ffba7b70a17.jpg?s=120&d=mm&r=g)
i used scipy.signal.convolve to work with complex-number arrays. now i need to convolve arrays of dual numbers (i*i=0) and split-complex numbers (i*i=1). so i have a class ( http://dl.dropbox.com/u/4988243/iComplex.py) which implements this numbers: class PlainComplex(Complex): def __mul__(self, other): other = ToComplex(other) return PlainComplex(self.re*other.re - self.im*other.im, self.im*other.re + self.re*other.im) class DualComplex(Complex): def __mul__(self, other): other = ToComplex(other) return DualComplex(self.re*other.re, self.im*other.re + self.re*other.im) class SplitComplex(Complex): def __mul__(self, other): other = ToComplex(other) return SplitComplex(self.re*other.re + self.im*other.im, self.im*other.re + self.re*other.im) as you can see only multiplication function is being changed. the question: is it possible to feed arrays of such objects to scipy's convolution function? when i try to do it for PlainComplex class it seems to work wrong (different from using python's complex numbers): http://dl.dropbox.com/u/4988243/sandbox.py - my complex http://dl.dropbox.com/u/4988243/sandbox2.py - python complex or maybe there is some alternative solution? thanx!
![](https://secure.gravatar.com/avatar/9138c60aeb2cdeecc2ad704182d50f94.jpg?s=120&d=mm&r=g)
Hi Denis, I am not sure that this can work, since it is possible that convolution is computed using Fourier transform (performance gain) So maybe you get something weird when it tries to multiply ordinary complex numbers with your special complex numbers during the fourier transform. Though ÙI am not a great sspecialist. Have a nice evening, I suppose)) -- Oleksandr Huziy 2011/11/14 Denis Yershov <kooleyba@gmail.com>
i used scipy.signal.convolve to work with complex-number arrays. now i need to convolve arrays of dual numbers (i*i=0) and split-complex numbers (i*i=1). so i have a class ( http://dl.dropbox.com/u/4988243/iComplex.py) which implements this numbers:
class PlainComplex(Complex): def __mul__(self, other): other = ToComplex(other) return PlainComplex(self.re*other.re - self.im*other.im, self.im*other.re + self.re*other.im)
class DualComplex(Complex): def __mul__(self, other): other = ToComplex(other) return DualComplex(self.re*other.re, self.im*other.re + self.re*other.im)
class SplitComplex(Complex): def __mul__(self, other): other = ToComplex(other) return SplitComplex(self.re*other.re + self.im*other.im, self.im*other.re + self.re*other.im)
as you can see only multiplication function is being changed. the question: is it possible to feed arrays of such objects to scipy's convolution function? when i try to do it for PlainComplex class it seems to work wrong (different from using python's complex numbers): http://dl.dropbox.com/u/4988243/sandbox.py - my complex http://dl.dropbox.com/u/4988243/sandbox2.py - python complex
or maybe there is some alternative solution? thanx!
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
participants (2)
-
Denis Yershov
-
Oleksandr Huziy