Perform phase resets when squashing as well as stretching

This commit is contained in:
Chris Cannam
2022-06-09 17:23:26 +01:00
parent 2298b67869
commit 78b491fb4c

View File

@@ -199,19 +199,18 @@ public:
}
double bigGap = 4000.0;
if (ratio > 1.0 &&
segmentation.residualAbove >
if (segmentation.residualAbove >
segmentation.percussiveAbove + bigGap &&
prevSegmentation.residualAbove <
prevSegmentation.percussiveAbove + bigGap) {
guidance.phaseReset.present = true;
guidance.phaseReset.f0 = std::min(segmentation.percussiveAbove,
nextSegmentation.percussiveAbove);
guidance.phaseReset.f1 = std::max(segmentation.residualAbove,
nextSegmentation.residualAbove);
if (guidance.phaseReset.f0 < 200.0) {
guidance.phaseReset.f0 = 0.0;
}
guidance.phaseReset.f1 = std::max(segmentation.residualAbove,
nextSegmentation.residualAbove);
}
double prevLower = guidance.fftBands[0].f1;