module: clock_for_noise_test
description: 
parameters:  int num_samples, double double_interp_val
inputs:  
outputs:  double_interp out, double_interp reset
classes:  
static_variables: int counter, int state; 
init:  
out = -1.0;
counter = 0;
state = 0;
reset = -1.0;

code:  

if (counter >= num_samples && state == 0)
   {
    counter = 0;
    state = 1;
    out = double_interp_val;
   }
else if (counter >= 2*num_samples && state == 1)
   {
    counter = 0;
    state = 0;
    out = -double_interp_val;
   }
else if (counter == 0.5*num_samples && state == 1)
   {
    reset = 1.0;
   }
else if (counter == 1.5*num_samples && state == 1)
   {
    reset = -1.0;
   }
else if (counter == 1)
   {
    if (state == 1)
       out = 1.0;
    else
       out = -1.0;
   }
counter++;
