0

I have a rather large piece of code at the end of which I need to apply ifft to an array ZF. ZF is the fft of the columns of a matrix Z.

The problem is, the ifft turns out to be a complex double array (which it shouldn't if I did everything correctly) so I need a debugging tool to check at which point of the numerous manipulations I performed on the original DFT I lost the Hermitian Symmetry.

The array is a double 1024x1376

my attempt at this is:

for i=2:N/2
    Herm=ZF(i,:)+ZF(N-i+2,:);
end

N=1024 is the number of rows and if Herm is purely real then I have the Symmetry.

Any thoughts? I'm still on the first month of MATLAB so if I'm way off feel free to tell me.

Autonomous
  • 8,935
  • 1
  • 38
  • 77
Sobeit
  • 3
  • 2
  • Post an example (short) input array that causes the problem – Luis Mendo Nov 21 '14 at 23:37
  • 1
    [`issymmetric`](http://www.mathworks.com/help/matlab/ref/issymmetric.html?refresh=true) can help you to check whether a matrix is symmetric or skew-symmetric. [`ishermitian`](http://www.mathworks.com/help/matlab/ref/ishermitian.html) can tell you if its is hermitian or skew-hermitian. – Autonomous Nov 22 '14 at 01:14
  • Note that Hermitian symmetry is a very fragile concept when you manipulate arrays of floating-point numbers. Depending on how you construct your matrix, it may be very close to Hermitian, but not exactly. Sadly, even the built-in `ishermitian` (as suggested by @ParagS.Chandakkar) isn't numerically robust at all, in this case, because it checks for *exact* equality between a matrix of floats and its conjugate transpose, and testing for exact equality is hardly ever a good idea with floats. Instead, you may want to check for approximate equality. – jub0bs Dec 09 '14 at 15:29

0 Answers0