# Why the calculated phase differs so much from the real phase of the signal?

9 views (last 30 days)
Janko on 5 Feb 2024
Commented: William Rose on 14 Feb 2024
Hi guys,
I have a small question regarding my code below. In my code I create a complex signal E1 solely consisting of the phase noise phi. My question is how to obtain the correct values for phi? My idea was to create the FFT of my signal E1 and then simply calculating the phase of the FFT by using the angle() function.
But plotting phi and phi_ang (phase obtain with angle function) shows that both phase vectors differ enormously.
I hope you can help me with my question.
Kind regards
Janko
The code:
clear
clc
N = 10000000;
wn = randn(N,1);
phi = cumsum(wn);
E1 = exp(1i*phi);
E1_fft = fftshift(fft(E1));
phi_ang = angle(E1_fft);
plot(phi)
hold on
plot(unwrap(phi_ang))

William Rose on 5 Feb 2024
The DFT expresses a signal x(k) as a sum of sinusoids, each of which is sampled at regular intervals. The phase angles of the elements of the DFT are the phases of the individual sinusoidal components, at t=0.
Your signal can be thought of as a regularly sampled signal whose phase advances by a random amount (forward or backward) with each timestep. Thus phi is a random walk with Gaussian steps. The phase angles (phi) of the random walk are not equal to the phase angles of the sinusoids which, when added up, will equal x(k).
Janko on 13 Feb 2024
thank you very much for the help and the detailed answers!
I will for sure look into the hilbert transformation!
And thank you for providing me the frequencyNoise script!
Here is the link to the paper I've mentioned above: https://doi.org/10.1364/OE.20.005291
(Kazuro Kikuchi, "Characterization of semiconductor-laser phase noise and estimation of bit-error rate performance with low-speed offline digital coherent receivers," Opt. Express 20, 5291-5302 (2012))
Thank you again for your time!
Kind regards
Janko
William Rose on 14 Feb 2024
@Janko, you're welcome. Good luck with your work.