void get_x( void)
{
/* data setup for symbol values " A..Z",  f(D) = 1 - D */

/*  string msg = "THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG"; */

  string msg = "OLD VITERBI HAD A FARM, EI, EI, O";

  x = (double) msg;			/* input sequence */

  states = [(double)" ", (double)",", (double)"A":(double)"Z"];

  N = cols(x);		/* N data samples */
  M = cols(states);	/* M symbol values */
  K = 1;		/* find K best completely unmerged paths */

  zstate = 1;				/* zero state */

  y = x - [ states(zstate) x(1:N-1)];	/* FSM output, f(D) = 1 - D */

  n = 0.5 * rand( 1, N, "gauss");	/* random noise */

  z = y + n;				/* signal plus noise */
}


double get_yval( int _cur, int _next)
{
/* get_yval() for f(D) = 1 - D */

  return states(_next) - states(_cur);
}

double get_cost( double _zz, int _cur, int _next, int _j)
{
  double yval = get_yval( _cur, _next);

  if( yval == HUGE_VAL)
    return yval;

  return pn( _zz - yval);
}

vector get_ex( vector _index)
{
/* get_ex() for f(D) = 1 - D */

  return states( _index);
}
