Page 1 of 1

Crash on filtering generated sine wave

Posted: Sun Aug 07, 2005 3:09 pm
by John Sigurdson
I'm trying to estimate the roll off in dB for the bandpass filter by generating a 100 Hz sine wave and then setting the bandpass low cutoff just above 100Hz (150 Hz) and hi cut off at some 10s of kHz. But every time I try to bandpass filter the generated sine wave, DPlot crashes.

Details, I generate a sine wave with Y=sin(x) in degrees from 0 to 36000 degrees with one point every 5 degrees, the correct sine wave is generated. Then, I modify the X axis with X = X/36000 so that the X axis is labled from zero to 1 and modify axis lables to X as seconds and Y as psi.

An FFT on this sine wave yields a proper frequency spectrum with a single peak at 100 Hz. However, if I attempt to filter that sine wave with a bandpass filter with any settings - e.g., w/the low cut off set to 150 Hz and the high cut off set to 40000 Hz, Dplot crashes and disappears altogether.

The bandpass filter works well at the settings mentions and many others for other waveforms and recorded real data, so I cannot figure out what's going wrong.

John

Posted: Sun Aug 07, 2005 3:21 pm
by DPlotAdmin
John,
The bandpass filter works well at the settings mentions and many others for other waveforms and recorded real data, so I cannot figure out what's going wrong.


Me either, for now, but the semi-good news is I get the same results. Will let you know as soon as this is fixed. Thanks for pointing out the problem.

Posted: Tue Aug 09, 2005 12:52 am
by DPlotAdmin
John,
The bandpass filter can become unstable (in other words blow up with an overflow error) if either the low or high frequencies are greater than half the sampling rate (in your case half of 7200 Hz). I've updated the input dialog to complain in this case. If run from a macro the filter will simply fail w/o a crash. You can get the update using Help>Check for Updates.

Posted: Tue Aug 09, 2005 3:01 am
by John Sigurdson
Dave,

Thanks for the solution and quick reply. Much appreciated.

John