J
Jamie
Hi,
I am using a digital lowpass filter fed with random real numbers, and
once in awhile the output of the filter will spike to zero for awhile,
while the input numbers stay positive. In a 5minute period with a
1200Hz sample rate and 50:1 cutoff ratio (24Hz -3dB output) there are
about 10 spikes to zero on the output. Any ideas what could cause the
filter to spike like this? I've tried floats and doubles and both cause
spikes.
cheers,
Jamie
Here is the filter code:
public float lowPassFilter50to1(float next_input_value)
{
//ie. 1st order, 1kHz -3dB lowpass, 50kHz sampling filter
this.next_input_value = next_input_value;
float gain = (float)16.89454484;
xv[0] = xv[1];
xv[1] = next_input_value / gain;
yv[0] = yv[1];
yv[1] = (xv[0] + xv[1]) + ((float)0.8816185924 * yv[0]);
next_output = yv[1];
return next_output;
}
I am using a digital lowpass filter fed with random real numbers, and
once in awhile the output of the filter will spike to zero for awhile,
while the input numbers stay positive. In a 5minute period with a
1200Hz sample rate and 50:1 cutoff ratio (24Hz -3dB output) there are
about 10 spikes to zero on the output. Any ideas what could cause the
filter to spike like this? I've tried floats and doubles and both cause
spikes.
cheers,
Jamie
Here is the filter code:
public float lowPassFilter50to1(float next_input_value)
{
//ie. 1st order, 1kHz -3dB lowpass, 50kHz sampling filter
this.next_input_value = next_input_value;
float gain = (float)16.89454484;
xv[0] = xv[1];
xv[1] = next_input_value / gain;
yv[0] = yv[1];
yv[1] = (xv[0] + xv[1]) + ((float)0.8816185924 * yv[0]);
next_output = yv[1];
return next_output;
}