def METHOD_NAME(_type, freq, length, rate):
    length *= .001
    t = np.linspace(0, length, int(length*rate))
    if _type == 'square':
        return signal.square(2 * np.pi * freq * t)
    if _type == 'saw':
        return signal.sawtooth(2 * np.pi * freq * t)
    if _type == 'sine':
        return np.sin(2 * np.pi * freq * t)
    if _type == 'white_noise':
        return np.random.random(int(length * rate)) * 2 - 1
    raise InvalidValue('Invalid oscillator: %s' % _type)