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

Method fftSizeForSampleRate

src/internal/src/HRTFPanner.cpp:576–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576uint32_t HRTFPanner::fftSizeForSampleRate(float sampleRate)
577{
578 // The HRTF impulse responses (loaded as audio resources) are 512 sample-frames @44.1KHz.
579 // Currently, we truncate the impulse responses to half this size, but an FFT-size of twice impulse response size is needed (for convolution).
580 // So for sample rates around 44.1KHz an FFT size of 512 is good. We double the FFT-size only for sample rates at least double this.
581 ASSERT(sampleRate >= 44100 && sampleRate <= 96000.0);
582 return (sampleRate < 88200.0) ? 512 : 1024;
583}
584
585//static
586uint32_t HRTFPanner::fftSizeForSampleLength(int sampleLength)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected