MCPcopy Create free account
hub / github.com/LabSound/LabSound / fftSizeForSampleLength

Method fftSizeForSampleLength

src/internal/src/HRTFPanner.cpp:586–601  ·  view source on GitHub ↗

static

Source from the content-addressed store, hash-verified

584
585//static
586uint32_t HRTFPanner::fftSizeForSampleLength(int sampleLength)
587{
588 // originally, this routine assumed 512 sample length impulse responses
589 // truncated to 256 samples, and returned an fft size of 512 for those samples.
590 // to match the reasoning, if the bus is not a power of 2 size, round down to the
591 // previous power of 2 size.
592 // return double the power of 2 size of the bus.
593 // the original logic also doubled the fft size for sample rates >= 88200,
594 // but that feels a bit nonsense, so it's not emulated here.
595
596 int s = RoundNextPow2(sampleLength);
597 if (s > sampleLength)
598 s /= 2;
599
600 return s * 2;
601}
602
603void HRTFPanner::reset()
604{

Callers

nothing calls this directly

Calls 1

RoundNextPow2Function · 0.85

Tested by

no test coverage detected