mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
DPL2Decoder: Simplify cut-off frequency logic in DesignFIR
This commit is contained in:
parent
24027c1d4a
commit
751351fd20
@ -134,16 +134,13 @@ static float* DesignFIR(unsigned int n, float fc, float opt)
|
|||||||
if (n == 0)
|
if (n == 0)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
fc = MathUtil::Clamp(fc, 0.001f, 1.0f);
|
|
||||||
|
|
||||||
float* w = (float*)calloc(sizeof(float), n);
|
float* w = (float*)calloc(sizeof(float), n);
|
||||||
|
|
||||||
// Get window coefficients
|
// Get window coefficients
|
||||||
Hamming(n, w);
|
Hamming(n, w);
|
||||||
|
|
||||||
fc1 = fc;
|
|
||||||
// Cutoff frequency must be < 0.5 where 0.5 <=> Fs/2
|
// Cutoff frequency must be < 0.5 where 0.5 <=> Fs/2
|
||||||
fc1 = ((fc1 <= 1.0) && (fc1 > 0.0)) ? fc1 / 2 : 0.25f;
|
fc1 = MathUtil::Clamp(fc, 0.001f, 1.0f) / 2;
|
||||||
k1 *= fc1;
|
k1 *= fc1;
|
||||||
|
|
||||||
// Low pass filter
|
// Low pass filter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user