music.fraction_of¶
- music.fraction_of(freq, sample_rate=44100)[source]¶
A frequency in Hertz, as the fraction of the sample rate a design wants.
- Parameters:
- freqscalar
The frequency in Hertz.
- sample_rate
integer The sample rate the filter will run at.
- Returns:
floatfreq / sample_rate, which is in(0, 0.5)for any frequency below the Nyquist limit.
- Raises:
ValueErrorIf freq is not positive.
- Parameters:
- Return type:
Examples
>>> fraction_of(4410, sample_rate=44100) 0.1 >>> a, b = low_pass(fraction_of(1000))