DC filter cutoff at 0.5Hz

This commit is contained in:
Ken Cooke 2017-08-24 11:20:22 -07:00
parent 4a253023ee
commit 684b7fee5a

View file

@ -25,10 +25,10 @@ static inline int32_t saturateQ30(int32_t x) {
}
//
// First-order DC-blocking filter, with zero at 1.0 and pole at 0.99994
// First-order DC-blocking filter, with zero at 1.0 and pole at 0.9999
//
// -3dB @ 0.5 Hz (48KHz)
// -3dB @ 0.2 Hz (24KHz)
// -3dB @ 1.0 Hz (48KHz)
// -3dB @ 0.5 Hz (24KHz)
//
// input in Q15, output in Q30
//
@ -41,7 +41,7 @@ public:
x <<= 15; // scale to Q30
x -= _dcOffset; // remove DC
_dcOffset += x >> 14; // pole = (1.0 - 2^-14) = 0.99994
_dcOffset += x >> 13; // pole = (1.0 - 2^-13) = 0.9999
}
};