43 std::unique_ptr<SincResampler>
const s1;
44 std::unique_ptr<SincResampler>
const s2;
47 TwoPassSincResampler(
double clockFrequency,
double samplingFrequency,
double highestAccurateFrequency,
double intermediateFrequency) :
48 s1(
new SincResampler(clockFrequency, intermediateFrequency, highestAccurateFrequency)),
49 s2(
new SincResampler(intermediateFrequency, samplingFrequency, highestAccurateFrequency))
61 const double halfFreq = (samplingFrequency > 44000.)
62 ? 20000. : samplingFrequency * 0.45;
67 double const intermediateFrequency = 2. * halfFreq
68 + std::sqrt(2. * halfFreq * clockFrequency
69 * (samplingFrequency - 2. * halfFreq) / samplingFrequency);
72 clockFrequency, samplingFrequency, halfFreq, intermediateFrequency);
77 return s1->input(sample) && s2->input(s1->output());
80 int output()
const override