module: voltage_noise_cpp
description: 
timing_sensitivity: 
parameters:  int en_noise, double thermal_noise, double flicker_corner
inputs:  
outputs:  double out
classes:  OneOverfPlusWhiteNoise gnoise()
static_variables:  double noise_scale
init:  
double slope;

// assume slope of 1/f noise is -10db/decade
slope = -10.0;
gnoise.set(flicker_corner,slope,Ts);
// thermal_noise given as single-sided spectral density
noise_scale = thermal_noise*sqrt(0.5/Ts);

code:  
if (en_noise == 0)
   out = 0.0;
else
   out = noise_scale*gnoise.inp();
