Put binForFrequency/frequencyForBin in a common place

This commit is contained in:
Chris Cannam
2022-06-13 10:08:05 +01:00
parent 05fb611544
commit 182e2b0e3b
8 changed files with 95 additions and 70 deletions

View File

@@ -294,16 +294,6 @@ protected:
static void logCout(const std::string &message) {
std::cout << "RubberBandStretcher: " << message << std::endl;
}
//!!! dupes
int binForFrequency(double f, int fftSize) const {
return int(round(f * double(fftSize) /
m_parameters.sampleRate));
}
double frequencyForBin(int b, int fftSize) const {
return (double(b) * m_parameters.sampleRate)
/ double(fftSize);
}
};
}