5
$\begingroup$

Suppose I compute phase spectrum from the fftn function in MATLAB as

image1=imread('cameraman.tif');
figure,imshow(image1);


fourier_transform=fft2(image1);%take fourier transform of gray scale image

phase_spectrum=exp(1j*angle(fourier_transform));
imshow(phase_spectrum, [])

Here, by using imshow(phase_spectrum,[]) we first discard the imaginary part and then normalize.

But why do we discard the imaginary part of the phase spectrum ? Whether it's spectrum is same as real part with 90 degree phase shift ?

Is it not useful ? Also,what should be done to get whole phase spectrum not just real part of it?

$\endgroup$
  • $\begingroup$ We don't discard the phase spectrum if we need to reconstruct the signal from it. Only thing is much of the play about frequency is visible mostly from the magnitude spectrum. No doubt there will also be rich information from phase spectrum. $\endgroup$ – Dipan Mehta Jun 27 '15 at 12:18
  • $\begingroup$ @Dipan sorry sir but you are talking about discarding of phase spectrum and my question is about discarding of imaginary part from the phase spectrum :-) $\endgroup$ – user3559780 Jun 27 '15 at 12:27
  • $\begingroup$ This: exp(1j*angle(fourier_transform)) gives normalised phase spectrum which is complex. Use imagesc(real(phase_spectrum)) to see real part and imagesc(imag(phase_spectrum)) to see imaginary part. $\endgroup$ – geometrikal Jun 27 '15 at 12:50
  • $\begingroup$ @geometrikal could you tell me whether phase spectrum is real function or complex function? $\endgroup$ – user3559780 Jun 27 '15 at 12:59
  • 1
    $\begingroup$ Phase is an angle. It represents a shift of the corresponding sinusoid. It can be represented as a real number, the angle value. However, angles are periodic. E.g. 370 degrees equals 10 degrees. This can be problematic sometimes. People often prefer to work with the complex exponential form of an angle - exp(i * angle) - as this makes the algebra easier. So phase spectrum can either be real or complex. With the Fourier transform is comes out complex but is easily converted in Matlab using the angle function. $\endgroup$ – geometrikal Jun 27 '15 at 13:21
2
$\begingroup$

Phase spectrum by itself is a real function of frequency and, therefore, does not contain any imaginary parts. It is the fourier transform which is in general a complex function of frequency, henceforth, may include real and imaginary parts. But neither the magnitude spectrum nor the phase spectrum contain(s) any imaginary parts.

Phase spectrum is a real function. Whatever methods/functions (correct or not) you use to obtain it does not and shall not change this fact. $H(e^{j\omega}) = |H(e^{j\omega})| e^{j\phi(w)} $ where the $\phi(w)$ contains the phase spectrum and the absolute value part is the magnitude spectrum. Both are real. You shall use a proper function and method in your environment to obtain those signals from $H(e^{j\omega})$

$\endgroup$
  • $\begingroup$ but the phase angle is given by atan(imaginary_part/real_part). so if imaginary part is 0, every angle will become as 0. $\endgroup$ – user3559780 Jun 27 '15 at 11:45
  • $\begingroup$ so it must have both real and imaginary parts $\endgroup$ – user3559780 Jun 27 '15 at 11:49
  • $\begingroup$ Phase can be expressed as real number (angle) or complex with unit magnitude. $\endgroup$ – geometrikal Jun 27 '15 at 12:54
  • 1
    $\begingroup$ @geometrikal that second approach only involves a redundancy of a unit magnitude complex number where phase information of the complex valed function is now have to be extratcted from the ratios of the real and imaginary parts unnecessarily. The phase information, as expected from a Fourier transfom, is represented by a real valued function of frequency alone. $\endgroup$ – Fat32 Jun 27 '15 at 13:59
  • 1
    $\begingroup$ The complex form is often easier to work with mathematically. (note my previous comment was directed to @user3559780 not your answer sorry) $\endgroup$ – geometrikal Jun 27 '15 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.