psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
240 stars 45 forks source link

bandPassFilter should fail if lowCutOff>highCutOff? #7

Closed MartinLiebig closed 3 years ago

MartinLiebig commented 3 years ago

If you run any Frequency filter and have lowCutOff>highCutOff, then you do not get an error. In fact this happens:

double centreFreq = (highCutoff + lowCutoff)/2.0;
double width = Math.abs(highCutoff - lowCutoff);

So what happens here is lowCutOff and highCutOff are implicitly inverted. I think this is not desired?

psambit9791 commented 3 years ago

Right. That is true.

Will take a look it at.

psambit9791 commented 3 years ago

The issue has been fixed with commit 98d55f9691ca365963de219f9390725e9b3375fd.