Finally I found that one single privkey.pem was damaged. I restored it fom backup and all was running again.

The same cronjob worked fine on the production server but I do not know if the certs were to be renewed. Maybe certbot-auto was already up to date.

]]>if( resetStateOnGainChange )

wz[0] = 0; wz[1] = 0;

should be

if( resetStateOnGainChange )

{wz[0] = 0; wz[1] = 0;}

y = B[0] * x + wz[0];

wz[0] = B[1] * x – A[0] * y + wz[1];

wz[1] = B[2] * x – A[1] * y;

It still uses 9 binary operators but you get rid of the 2 shift operators.

]]>Thanks for the info. I’ve been having a hard time figuring out how Matlab and C++ IIR filters go together and how to use Matlab filter design for C++ projects. Your C++ code is nice an easy to understand and get working.

The thing that I found confusing was that fdatool gives an input gain and all the C/C++ implementations I found for biquads had no way of setting this value. So I added double g; to your class BiQuad and in double BiQuad::step(double x) I put x*=g; . Now I can control the input gain. I also changed your C++ generation code in Matlab to more like

Fs = 192000; % Sampling Frequency

N = 6; % Order

Fpass = 10000; % Passband Frequency

Apass = 1; % Passband Ripple (dB)

Astop = 80; % Stopband Attenuation (dB)

% Construct an FDESIGN object and call its ELLIP method.

h = fdesign.lowpass(‘N,Fp,Ap,Ast’, N, Fpass, Apass, Astop, Fs);

Hd = design(h, ‘ellip’);

sos=Hd.sosmatrix;

scalevalues=Hd.scalevalues;

fprintf(‘n.h filen——nn’);

fprintf(‘BiQuadChain bqc;n’);

i = 0;

for s = sos.’

i = i + 1;

fprintf(‘BiQuad bq%d;n’, i);

end

fprintf(‘nn.cpp filen——nn’);

i = 0;

for s = sos.’

i = i + 1;

fprintf(‘bq%d.set( %.9e, %.9e, %.9e, %.9e, %.9e );n’, i, s(1), s(2), s(3), s(5), s(6));

end

i=0;

for g = scalevalues(1:end-1).’

i = i + 1;

fprintf(‘bq%d.gain=%.9e;n’,i,g);

end

fprintf(‘bqc’);

i = 0;

for s = sos.’

i = i + 1;

fprintf(‘.add( &bq%d )’, i);

end

fprintf(‘;n’);

That give me an output of…

.h file

——

BiQuadChain bqc;

BiQuad bq1;

BiQuad bq2;

BiQuad bq3;

.cpp file

——

.h file

——

BiQuadChain bqc;

BiQuad bq1;

BiQuad bq2;

BiQuad bq3;

.cpp file

——

bq1.set( 1.000000000e+00, -1.448553231e+00, 1.000000000e+00, -1.838841453e+00, 9.009598487e-01 );

bq2.set( 1.000000000e+00, 9.621110853e-02, 1.000000000e+00, -1.832896546e+00, 8.478630198e-01 );

bq3.set( 1.000000000e+00, -1.661029804e+00, 1.000000000e+00, -1.863639026e+00, 9.673926165e-01 );

bq1.gain=2.827097186e-01;

bq2.gain=2.008277409e-01;

bq3.gain=3.864366325e-03;

bqc.add( &bq1 ).add( &bq2 ).add( &bq3 );

Now the filter works as I had hoped. The output gain seems to be 1 so I’ve ignored that.

Thanks again.

Jonti

]]>Thank you, Tom! ]]>