Example #1
0
def filter_4(input):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  infilter = DoubleInPointerFilter(input, False)
  infilter.input_sampling_rate = 48000
  overfilter = DoubleOversampling6points5order_4Filter()
  overfilter.input_sampling_rate = 48000
  overfilter.output_sampling_rate = 48000 * 4
  overfilter.set_input_port(0, infilter, 0)
  overdrivefilter = DoubleSimpleOverdriveFilter()
  overdrivefilter.input_sampling_rate = 48000 * 4
  overdrivefilter.set_input_port(0, overfilter, 0)
  lowpassfilter = DoubleButterworthLowPassFilter()
  lowpassfilter.input_sampling_rate = 48000 * 4
  lowpassfilter.cut_frequency = 48000
  lowpassfilter.order = 5
  lowpassfilter.set_input_port(0, overdrivefilter, 0)
  decimationfilter = DoubleDecimationFilter(1)
  decimationfilter.input_sampling_rate = 48000 * 4
  decimationfilter.output_sampling_rate = 48000
  decimationfilter.set_input_port(0, lowpassfilter, 0)
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = 48000
  outfilter.set_input_port(0, decimationfilter, 0)
  outfilter.process(input.shape[1])
  return output
def filter_8(input):
    import numpy as np
    output = np.zeros(input.shape, dtype=np.float64)

    infilter = DoubleInPointerFilter(input, False)
    infilter.set_input_sampling_rate(sample_rate)
    overfilter = DoubleOversampling6points5order_8Filter()
    overfilter.set_input_sampling_rate(sample_rate)
    overfilter.set_output_sampling_rate(sample_rate * 8)
    overfilter.set_input_port(0, infilter, 0)
    overdrivefilter = DoubleSimpleOverdriveFilter()
    overdrivefilter.set_input_sampling_rate(sample_rate * 8)
    overdrivefilter.set_input_port(0, overfilter, 0)
    lowpassfilter = DoubleButterworthLowPassFilter()
    lowpassfilter.set_input_sampling_rate(sample_rate * 8)
    lowpassfilter.set_cut_frequency(20000)
    lowpassfilter.set_order(10)
    lowpassfilter.set_input_port(0, overdrivefilter, 0)
    decimationfilter = DoubleDecimationFilter(1)
    decimationfilter.set_input_sampling_rate(sample_rate * 8)
    decimationfilter.set_output_sampling_rate(sample_rate)
    decimationfilter.set_input_port(0, lowpassfilter, 0)
    outfilter = DoubleOutPointerFilter(output, False)
    outfilter.set_input_sampling_rate(sample_rate)
    outfilter.set_input_port(0, decimationfilter, 0)
    outfilter.process(input.shape[1])
    return output