-function adaptFilterOut = adaptiveCMA(rSampled)
+function [adaptFilterOut, convergeIdx] = adaptiveCMA(rSampled)
%% adaptive filter
%% CMA
taps = 19; % ODD taps
adaptFilterOut = zeros(numSymbs, 1);
converged = 0;
convergeCount = 0;
+ convergeIdx = Inf;
for it = 1:numSymbs
if it <= (taps - 1) / 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
- converged = 1
- it
+ converged = 1;
+ convergeIdx = it;
end
adaptFilterOut(it) = xout;