45 std::unique_ptr<SincResampler>
const s1;
46 std::unique_ptr<SincResampler>
const s2;
49 TwoPassSincResampler(
double clockFrequency,
double samplingFrequency,
double highestAccurateFrequency,
double intermediateFrequency) :
50 s1(
new SincResampler(clockFrequency, intermediateFrequency, highestAccurateFrequency)),
51 s2(
new SincResampler(intermediateFrequency, samplingFrequency, highestAccurateFrequency))
63 const double halfFreq = (samplingFrequency > 44000.)
64 ? 20000. : samplingFrequency * 0.45;
69 double const intermediateFrequency = 2. * halfFreq
70 + std::sqrt(2. * halfFreq * clockFrequency
71 * (samplingFrequency - 2. * halfFreq) / samplingFrequency);
74 clockFrequency, samplingFrequency, halfFreq, intermediateFrequency);
77 bool input(int32_t sample)
override
79 return s1->input(sample) && s2->input(s1->output());
82 int32_t output()
const override