module: itpp_mod_source_example
description: 
parameters:  double frequency, double amplitude
             double phase, double mean
inputs:  double vin
outputs:  double vout
classes:  itpp::Sine_Source sinsrc1(frequency*Ts,mean,amplitude,phase),
          itpp::vec out_vec()
static_variables: int count, int num_samples
init:
using namespace itpp;

count = 0;

int i;  

num_samples = 20e3;
vec temp_vec;
temp_vec = sinsrc1(num_samples);

out_vec.set_length(num_samples);
for (i = 0; i < num_samples; i++)
   out_vec.set(i,temp_vec.get(i));

end:  
code:  

if (count >= num_samples)
  count = num_samples-1; 
vout = out_vec.get(count++)*vin;

// uncomment below to get sample-by-sample update
//vout = sinsrc1()*vin;