module: lpf_ord1_w_clk
description: 
timing_sensitivity: posedge clk
parameters:  double fp, double gain
             double sample_freq
inputs:  double in, bool clk
outputs:  double out
classes:  Filter filt("1","1")
static_variables:  
init:  
double Ts_sampled;

if (sample_freq < 1e-30)
   {
    printf("error in 'lpf_ord1_w_clk':  sample_freq must be >= 1e-30\n");
    printf("  -> in this case, sample_freq = %5.3e\n", sample_freq);
    exit(1);
   }
Ts_sampled = 1/sample_freq;
filt.set("gain","1 + 1/(2*pi*fp)*s","gain,fp,Ts",gain,fp,Ts_sampled);

end:  
code:  
filt.inp(in);
out = filt.out;
