# Calculating phase only component of a signal in MATLAB

I am working in the field of digital signal processing. Recently I read a paper that tells about phase only component of a Signal. It is given that the phase only component is calculated as $r_{phase}=\frac{F(n)}{||F(n)||}$, where $F(n)$ is discrete Fourier transform of any signal $n$ and $||F(n)||$ is Fourier magnitude of signal $n$. I know that $F(n)$ can be calculated as F(n)=dft2(n), Can anyone please tell that how to calculate the $||F(n)||$ in MATLAB.

• its difficult for me, hopefully NOT for others. – Mayank Tiwari Feb 6 '17 at 5:18
• Can I please ask what does dft2 means here? – A_A Feb 6 '17 at 9:03
• @A_A, dft2 means discrete Fourier transform for 2D signal. – Mayank Tiwari Feb 6 '17 at 12:19

I suppose you mean fft2 in MATLAB notation (its the same calculation as 2-D DFT, but with less computation time.

Then, you can go for:

F = fft2(I);
r = F ./ abs(F)


to get the phase-only information of the Fourier Transform.