def filter(input, blend=0, feedback=0, feedforward=1):
    import numpy as np

    output = np.zeros(input.shape, dtype=np.float64)

    infilter = DoubleInPointerFilter(input, False)
    infilter.set_output_sampling_rate(sample_rate)

    generator = DoubleCachedSinusGeneratorFilter(1, 1)
    generator.set_output_sampling_rate(sample_rate)
    generator.set_volume(1e-3 * sample_rate)
    generator.set_offset(1.5e-3 * sample_rate)

    delayfilter = DoubleUniversalVariableDelayLineFilter(5000)
    delayfilter.set_input_sampling_rate(sample_rate)
    delayfilter.set_input_port(0, infilter, 0)
    delayfilter.set_input_port(1, generator, 0)
    delayfilter.set_blend(blend)
    delayfilter.set_feedback(feedback)
    delayfilter.set_feedforward(feedforward)

    outfilter = DoubleOutPointerFilter(output, False)
    outfilter.set_input_sampling_rate(sample_rate)
    outfilter.set_input_port(0, delayfilter, 0)
    outfilter.process(input.shape[1])

    return output
Пример #2
0
def filter(input, blend=0, feedback=0, feedforward=1):
    import numpy as np
    output = np.zeros(input.shape, dtype=np.float64)

    infilter = DoubleInPointerFilter(input, False)
    infilter.set_output_sampling_rate(sample_rate)

    generator = DoubleCachedSinusGeneratorFilter(1, 1)
    generator.set_output_sampling_rate(sample_rate)
    generator.set_volume(1e-3 * sample_rate)
    generator.set_offset(1.5e-3 * sample_rate)

    delayfilter = DoubleUniversalVariableDelayLineFilter(5000)
    delayfilter.set_input_sampling_rate(sample_rate)
    delayfilter.set_input_port(0, infilter, 0)
    delayfilter.set_input_port(1, generator, 0)
    delayfilter.set_blend(blend)
    delayfilter.set_feedback(feedback)
    delayfilter.set_feedforward(feedforward)

    outfilter = DoubleOutPointerFilter(output, False)
    outfilter.set_input_sampling_rate(sample_rate)
    outfilter.set_input_port(0, delayfilter, 0)
    outfilter.process(input.shape[1])

    return output
Пример #3
0
def filter(input, blend=0, feedback=0, feedforward=1):
    import numpy as np
    output = np.zeros(input.shape, dtype=np.float64)

    infilter = DoubleInPointerFilter(input, False)
    infilter.set_input_sampling_rate(sample_rate)

    noisefilter = DoubleWhiteNoiseGeneratorFilter()
    noisefilter.set_input_sampling_rate(sample_rate)
    noisefilter.set_offset(50e-3 * sample_rate)
    noisefilter.set_volume(25e-3 * sample_rate)

    lownoisefilter = DoubleLowPassCoefficientsIIRFilter()
    lownoisefilter.set_input_sampling_rate(sample_rate)
    lownoisefilter.set_cut_frequency(5)
    lownoisefilter.set_input_port(0, noisefilter, 0)

    delayfilter = DoubleUniversalVariableDelayLineFilter(5000)
    delayfilter.set_input_sampling_rate(sample_rate)
    delayfilter.set_input_port(0, infilter, 0)
    delayfilter.set_input_port(1, lownoisefilter, 0)
    delayfilter.set_blend(blend)
    delayfilter.set_feedback(feedback)
    delayfilter.set_feedforward(feedforward)

    outfilter = DoubleOutPointerFilter(output, False)
    outfilter.set_input_sampling_rate(sample_rate)
    outfilter.set_input_port(0, delayfilter, 0)
    outfilter.process(input.shape[1])

    return output
Пример #4
0
def filter(input, blend=0, feedback=0, feedforward=1):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  infilter = DoubleInPointerFilter(input, False)
  infilter.set_input_sampling_rate(sample_rate)

  noisefilter = DoubleWhiteNoiseGeneratorFilter()
  noisefilter.set_input_sampling_rate(sample_rate)
  noisefilter.set_offset(50e-3 * sample_rate)
  noisefilter.set_volume(25e-3 * sample_rate)
  
  lownoisefilter = DoubleLowPassCoefficientsIIRFilter()
  lownoisefilter.set_input_sampling_rate(sample_rate)
  lownoisefilter.set_cut_frequency(5)
  lownoisefilter.set_input_port(0, noisefilter, 0)
  
  delayfilter = DoubleUniversalVariableDelayLineFilter(5000)
  delayfilter.set_input_sampling_rate(sample_rate)
  delayfilter.set_input_port(0, infilter, 0)
  delayfilter.set_input_port(1, lownoisefilter, 0)
  delayfilter.set_blend(blend)
  delayfilter.set_feedback(feedback)
  delayfilter.set_feedforward(feedforward)
  
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.set_input_sampling_rate(sample_rate)
  outfilter.set_input_port(0, delayfilter, 0)
  outfilter.process(input.shape[1])

  return output