% initialize stuff to perform EM solution for x4.m problem
% with uniform channel coefficient distribution

global G;

% 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 uniform h
%
  G = diag( var_noise./(N-[0:Memory]));
%
% for Gaussian h
%
%  G = inv( diag( (N-[0:Memory]) ./ var_noise) + diag(ones(length(FIR),1)/var_h) );

% run Viterbi and initialize b
%
  vit;
  b = get_ex;
