projects
/
4yp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Working Kerr effect; PDM; speedups; removed unused files
[4yp.git]
/
adaptiveCMA.m
diff --git
a/adaptiveCMA.m
b/adaptiveCMA.m
index
084eab4
..
41b1e48
100644
(file)
--- a/
adaptiveCMA.m
+++ b/
adaptiveCMA.m
@@
-1,4
+1,4
@@
-function
adaptFilterOut
= adaptiveCMA(rSampled)
+function
[adaptFilterOut, convergeIdx]
= adaptiveCMA(rSampled)
%% adaptive filter
%% CMA
taps = 19; % ODD taps
%% adaptive filter
%% CMA
taps = 19; % ODD taps
@@
-17,6
+17,7
@@
function adaptFilterOut = adaptiveCMA(rSampled)
adaptFilterOut = zeros(numSymbs, 1);
converged = 0;
convergeCount = 0;
adaptFilterOut = zeros(numSymbs, 1);
converged = 0;
convergeCount = 0;
+ convergeIdx = Inf;
for it = 1:numSymbs
if it <= (taps - 1) / 2;
for it = 1:numSymbs
if it <= (taps - 1) / 2;
@@
-30,14
+31,14
@@
function adaptFilterOut = adaptiveCMA(rSampled)
xout = sum(hxx .* xp);
ex = 1 - abs(xout) ^ 2;
xout = sum(hxx .* xp);
ex = 1 - abs(xout) ^ 2;
- if abs(ex) <
1e-3
+ if abs(ex) <
0.01
convergeCount = convergeCount + 1;
else
convergeCount = 0;
end
if ~converged && convergeCount >= 10
convergeCount = convergeCount + 1;
else
convergeCount = 0;
end
if ~converged && convergeCount >= 10
- converged = 1
- it
+ converged = 1
;
+ convergeIdx = it;
end
adaptFilterOut(it) = xout;
end
adaptFilterOut(it) = xout;