24constexpr auto twoPi = 2 * 3.14159265358979323846;
38 const int exponent =
std::round(std::log2(numSamples / idealHopSize));
41 const auto numFrames = 1 << exponent;
42 return 1. * numSamples / numFrames;
51 , mNumFrames { mHopSize > 0 ? static_cast<int>(
std::
round(
52 audio.GetNumSamples() / mHopSize)) :
54 , mNumSamples {
audio.GetNumSamples() }
69 const auto numToRead =
end - start;
79 frame.begin(), frame.end(),
mWindow.begin(), frame.begin(),
80 std::multiplies<float>());
virtual void ReadFloats(float *buffer, long long where, size_t numFrames) const =0
virtual double GetSampleRate() const =0
const long long mNumSamples
bool GetNextFrame(PffftFloatVector &frame)
int GetSampleRate() const
StftFrameProvider(const MirAudioReader &source)
const MirAudioReader & mAudio
double GetFrameRate() const
const std::vector< float > mWindow
double GetHopSize(int sampleRate, long long numSamples)
int GetFrameSize(int sampleRate)
std::vector< float > GetNormalizedHann(int size)
constexpr auto IsPowOfTwo(int x)
constexpr auto sampleRate
const char * end(const char *str) noexcept
fastfloat_really_inline void round(adjusted_mantissa &am, callback cb) noexcept
A vector of floats guaranteeing alignment as demanded by pffft.