Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have tried to impose Hermitian symmetry on the complex number $z$ which is varies with $x$. I need to take its inverse Fourier transform. A hermitian symmetry should give a real valued inverse FT.

$$ \operatorname {Re} (x) = \sinh[c\cdot \log(x)]/[\cosh[c\cdot \log(x)] + \cos(c)] $$

$$ \operatorname {Im} (x) = \cos(c)/[\cosh[c\cdot \log(x)] + \sin(c)] $$

x =0:31/100:31;
b = 31;
a = 15.5;
siginf = 0.0133;
mn = 0.00004;
sigzero = siginf - mn;
coleExp = 0.5;
relTime = 0.05;
arg1 = ( x<=a ).*(coleExp*log(relTime*x)) + ( x>a ).*(coleExp*log(relTime*(b-x))) ;
arg1i = ( x<=a ).*(coleExp*log(relTime*x)) - ( x>a ).*(coleExp*log(relTime*(b-x))) ;
arg2 = (1-coleExp)*pi/2;
sigdiff = sigzero - siginf;
sigdiff = sigdiff/2;
%real part
num = sinh(arg1);
den = cos(arg2) + cosh(arg1);
brack = 1 - num./den;
bgaddn = sigdiff*brack;
reall = bgaddn + siginf;
reall1 = reall;
reall1( x==0 ) = sigzero;
reall1( x==b ) = sigzero;
%imag part
num = cos(arg2)*sigdiff;
den = cosh(arg1) + sin(arg2);
den1 = (x<=a).*(den) - (x>a).*(den);
imagg = num./den1;
imagg1 = imagg;
imagg1( x==0 ) = 0;
imagg1( x==b ) = 0;
y = complex(reall1,imagg1);
f = ifft(y);
plot(x,reall);grid on
plot(x, imagg);grid on
plot(x, abs(y));grid on
plot(x, f);grid on
plot(x, abs(real(f)));grid on
plot(x, imag(f));grid on
plot(x, abs(f));grid on

In the code I have tried to assign the values of real(x) and imag(x) (just added a few constants). I then form a complex function z. I then try to make z Hermitian symmetric so that its inverse FT is real valued.

Can someone please point out why it fails to do so here? Is it something mathematical that I have done wrong or is it some behaviour of MATLAB that I seem to have misunderstood.

I expect the imaginary part of the inverse FT result to be zero, but it comes out to be non-zero. I tried doing the same for other functions and got the expected result of zero imaginary part.

Thanks a lot for the help!

share|cite|improve this question
Welcome to math.SE! You've put a lot of code in your question, which means anyone trying to help you will have to first understand it. Could you please edit your post and boil it down to what the problem is? If it really is due to the code, try to remove everything not strictly necessary, and state what output you got and what you expected instead. If it's about a formula, please only state that and use LaTeX to format it. That way you help everyone else helping you – Tobias Kienzler Jun 20 '13 at 7:13
Is there a reason you are coding the entire process yourself rather than using MATLAB's built-in FFT functions? – user2307487 Jun 20 '13 at 7:41
@user2307487 I needed to introduce symmetry in the functions on which inverse FT is to be done. I have used the built in IFFT function from MATLAB. – Gouri Mandal Jun 20 '13 at 9:43
@TobiasKienzler I have added the equations. I fear that it is something mathematical that I am missing in my code. I have added the code explanation as well. – Gouri Mandal Jun 20 '13 at 9:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.