NCAF adaption coefficient

 

function [w1]=optwmc(zWin,n,w,mcAdapt,mu,order,beta,y)

% If mcAdapt specified columns requested only adapt
if isempty(mcAdapt)
normvec = sum(zWin.^2); % Norm of each column
normvec(normvec<1e-10) = 1e-10; % Ensure norm is nonzero
normmat = ones(order,1)*normvec; % Expand to matrix
w = beta*w + mu*y(n)*zWin ./ normmat; % Tap update
else
amcInds = find(mcAdapt(n,:));
normvec = sum(zWin(:, amcInds).^2); % Norm of each column
normvec(normvec<1e-10) = 1e-10; % Ensure norm is nonzero
normmat = ones(order,1)*normvec;
w(:,amcInds) = beta*w(:,amcInds) + …
mu*y(n)*zWin(:,amcInds) ./ normmat; % Tap update
end
w1=w;
end