Added presentation; DE-QPSK; CD with FFT; split-step Fourier
[4yp.git] / phaseNoiseCorr.m
index 6d27f74..8848032 100644 (file)
@@ -1,4 +1,4 @@
-function [rPhaseEq, phiests] = phaseNoiseCorr(r, M, blocksize)
+function [rPhaseEq, phiests] = phaseNoiseCorr(r, M, phoffset, blocksize)
   %% phase noise correction
   phiests = zeros(1, length(r));
   rPhaseEq = zeros(1, length(r));
@@ -6,10 +6,7 @@ function [rPhaseEq, phiests] = phaseNoiseCorr(r, M, blocksize)
     block = r(l : min(l + blocksize - 1, length(r)));
 
     sum_M = sum(block .^ M);
-    %% if phase of 0 symbol is 0, use:
-    phi_est = angle(sum_M) / M;
-    %% if phase of 0 symbol is pi/M, use:
-    %% phi_est = angle(-sum_M) / M;
+    phi_est = angle(sum_M .* exp(j * M * phoffset)) / M;
 
     if l > 1
       %% phase unwrapping