% perform one iteration of EM for the constrained x4 example.

% set LLSQ coefficient matrix
%
  B = get_A( b, N, Memory);

% set G and FIR
%
  if( isempty(G))
    %
    % determinstic
    %
      FIR = FIR_M * ((B*FIR_M)\(z' - B*FIR_M_p_)) + FIR_M_p_;
  else
    %
    % Gaussian
    %
      D = inv( (FIR_M'*(B'*B)*FIR_M)/var_noise + inv_Rh);
      G = FIR_M * D * FIR_M';
      d = D * (FIR_M'*B'*(z' - B * FIR_M_p_)/var_noise + inv_Rh*avg_h);
      FIR = FIR_M * d + FIR_M_p_;
  end

% set new FSM state transition cost matrix
%
  trans = FSM_trans( states, FIR);

% run the viterbi algorithm
%
  vit_C;

% save data estimates in b
%
  b = get_ex;
