mdfourier-dac.py
def nonbl_saw_sweep(rate):
    """Generate a non-bandlimited saw sweep."""
    baseafreq = 20.0 / rate
    noctaves = int((1/baseafreq) // 1).bit_length() - 2
    out = []
    lastendphase = 0
    for octave in range(noctaves):
        afreq = np.geomspace(baseafreq, baseafreq * 2,
                             num=rate * 2, endpoint=False)
        phase = np.cumsum(afreq) + lastendphase
        phase -= np.floor(phase)
        out.append(phase)
        lastendphase = phase[-1]
        baseafreq *= 2.0
    return np.concatenate(out)
Generate a non-bandlimited saw sweep.
Generate a non-bandlimited saw sweep.
Generate a non - bandlimited saw sweep .
def nonbl_saw_sweep(rate):
    baseafreq = 20.0 / rate
    noctaves = int((1/baseafreq) // 1).bit_length() - 2
    out = []
    lastendphase = 0
    for octave in range(noctaves):
        afreq = np.geomspace(baseafreq, baseafreq * 2,
                             num=rate * 2, endpoint=False)
        phase = np.cumsum(afreq) + lastendphase
        phase -= np.floor(phase)
        out.append(phase)
        lastendphase = phase[-1]
        baseafreq *= 2.0
    return np.concatenate(out)
def nonbl_saw_sweep ( rate ) : baseafreq = 20.0 / rate noctaves = int ( ( 1 / baseafreq ) // 1 ) . bit_length ( ) - 2 out = [ ] lastendphase = 0 for octave in range ( noctaves ) : afreq = np . geomspace ( baseafreq , baseafreq * 2 , num = rate * 2 , endpoint = False ) phase = np . cumsum ( afreq ) + lastendphase phase -= np . floor ( phase ) out . append ( phase ) lastendphase = phase [ - 1 ] baseafreq *= 2.0 return np . concatenate ( out )
Generate a non-bandlimited saw sweep.
Generate a non - bandlimited saw sweep .
"""Generate a non-bandlimited saw sweep."""
rate