% initialize stuff to perform EM solution for x4.m problem

% initial data estimate

% use initial FIR = [ 0 ... 0 1 0 ... 0]
%
%  FIR = zeros(size(FIR));
%  FIR( (size(FIR,1)+1)/2) = 1;
%
% try initial FIR close to the true value
%
%  FIR = FIR_save .* (1 + 0.1*(2*(rand(size(FIR_save)) > 0.5)-1));
%
% try initial FIR equal to the true value
%
  FIR = FIR_save;

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

% initial estimate of G
%
% for deterministic h
%
%  G = [];
%
% for uniform h
%
%  G = diag( var_noise./(N-[0:Memory]));
%
% for Gaussian h with initial 0's in the channel
%
%  if( ~isempty(G))
%    G = inv( diag( (N-[0:Memory]) ./ var_noise) + inv_Rh);
%  end
%
% for Gaussian h with (-1,1) initial symbols
%
  if( ~isempty(G))
    G = inv( diag( (N*ones(1,FIR_length)) ./ var_noise) + inv_Rh);
  end

% run Viterbi and initialize b
%
  vit_C;

  b = get_ex;
