frequencyToWindowSize¶
- maelzel.snd.freqestimate.frequencyToWindowSize(freq, sr, powerof2=False, factor=2.0)[source]¶
Return the size of a window in samples which can fit the given frequency
- Parameters:
freq (
int
) – the lowest frequency to fit in the windowsr (
int
) – the sampling ratepowerof2 – if True, force the size to the next power of two
factor – the factor used to fit to account for phase shifts. Without this the window will not fit an entire cycle of the given frequency unless the signal is in perfect sync with the window.
- Return type:
int
- Returns:
the size of the window in samples