[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Complex matrix multiplication fails
From: |
Judd Storrs |
Subject: |
Re: Complex matrix multiplication fails |
Date: |
Wed, 12 May 2010 11:37:14 -0400 |
On Wed, May 12, 2010 at 8:21 AM, Børge Strand-Bergesen
<address@hidden> wrote:
> Do you see any errors in my code? Are there any known bugs here?
> Curiously, if I replace
> CEM=WN.^CEM; by CEM=WM.^-CEM; the complex matrix multiplication
> matches fft() but the matrix
> applied manually does not.
I suspect you're seeing the matlab/octave complex conjugate trap. In
matlab/octave x' takes the complex conjugate. If you just want to flip
the matrix you need to use .'
octave:1> a = 1+i
a = 1 + 1i
octave:2> a'
ans = 1 - 1i
octave:3> a.'
ans = 1 + 1i
Flipping the sign of the exponent "fixes" the problem by double negation.
octave:4> exp(i)
ans = 0.54030 + 0.84147i
octave:5> exp(-i)'
ans = 0.54030 + 0.84147i
Again, apologies if I've misunderstood the problem.
--judd