% x3 - data setup for data values (-1,1)
% with f(D) = f0 + f1 * D + f2 * D * D
% KB ECE 8770 Spring 1998 Lecture 11 page 11

if( K == 1)

  G = [];

  LOADED = 3;

  FIR = [ 0.2 -0.4 0.6]';

  Memory = size(FIR,1) - 1;     % channel memory size

  states = FSM( [-1 1], Memory);

  MM_max = size(states,2);      % number of symbol values

  M = MM_max;                   % number of states

  zstate = 1;                   % initial state

  x = [ -1 1 1 -1 -1];		% input sequence for N=5 example

  N = size(x,2);		% N data samples

%  x = 2 * floor(2*rand(1,N)) - 1;

  trans = FSM_trans( states, FIR);	% get state transition matrix

  y = FSM_out( x, FIR);			% get FSM output

  n = [-0.043256     -0.16656     0.012533     0.028768     -0.11465];

%  n = 0.1 * randn(1,N);			% random noise

  z = y + n;				% signal plus noise

else	% K > 1

  error( 'sorry... isi stuff only works with K=1');

  if( LOADED ~= 3)
    error( 'initialize with K = 1 first');
  end

end
