当前位置: 首页>>代码示例>>Python>>正文


Python DoubleInPointerFilter.input_sampling_rate方法代码示例

本文整理汇总了Python中ATK.Core.DoubleInPointerFilter.input_sampling_rate方法的典型用法代码示例。如果您正苦于以下问题:Python DoubleInPointerFilter.input_sampling_rate方法的具体用法?Python DoubleInPointerFilter.input_sampling_rate怎么用?Python DoubleInPointerFilter.input_sampling_rate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ATK.Core.DoubleInPointerFilter的用法示例。


在下文中一共展示了DoubleInPointerFilter.input_sampling_rate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter(noise, input, blend=0, feedback=0, feedforward=1):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

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

  noisefilter = DoubleInPointerFilter(noise, False)
  noisefilter.input_sampling_rate = sample_rate

  lownoisefilter = DoubleSecondOrderLowPassFilter()
  lownoisefilter.input_sampling_rate = sample_rate
  lownoisefilter.cut_frequency = 5
  lownoisefilter.set_input_port(0, noisefilter, 0)
  
  delayfilter = DoubleUniversalVariableDelayLineFilter(5000)
  delayfilter.input_sampling_rate = sample_rate
  delayfilter.set_input_port(0, infilter, 0)
  delayfilter.set_input_port(1, lownoisefilter, 0)
  delayfilter.blend = blend
  delayfilter.feedback = feedback
  delayfilter.feedforward = feedforward
  
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = sample_rate
  outfilter.set_input_port(0, delayfilter, 0)
  outfilter.process(input.shape[1])

  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:31,代码来源:PyATKDelay_chorus_test.py

示例2: max_colored_filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def max_colored_filter(input, ratio=4, threshold=1, softness=1, quality=1, color=1, max_reduction=-10):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)
  
  input2 = input**2
  in2filter = DoubleInPointerFilter(input2, False)
  in2filter.input_sampling_rate = sample_rate
  
  infilter = DoubleInPointerFilter(input, False)
  infilter.input_sampling_rate = sample_rate
  
  gainfilter = DoubleGainMaxColoredExpanderFilter(1)
  gainfilter.input_sampling_rate = sample_rate
  gainfilter.set_input_port(0, in2filter, 0)
  gainfilter.threshold = threshold
  gainfilter.ratio = ratio
  gainfilter.color = color
  gainfilter.softness = softness
  gainfilter.quality = quality
  gainfilter.max_reduction = 10 ** (max_reduction / 20.)
  
  applygainfilter = DoubleApplyGainFilter(1)
  applygainfilter.input_sampling_rate = sample_rate
  applygainfilter.set_input_port(0, gainfilter, 0)
  applygainfilter.set_input_port(1, infilter, 0)
  
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = sample_rate
  outfilter.set_input_port(0, applygainfilter, 0)
  outfilter.process(input.shape[1])
  
  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:34,代码来源:PyATKDynamic_coloredexpandergain_test.py

示例3: filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter(input, ratio=4, threshold=1, softness=1):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  input2 = input**2
  in2filter = DoubleInPointerFilter(input2, False)
  in2filter.input_sampling_rate = sample_rate

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

  gainfilter = DoubleGainExpanderFilter(1)
  gainfilter.input_sampling_rate = sample_rate
  gainfilter.set_input_port(0, in2filter, 0)
  gainfilter.threshold = threshold
  gainfilter.ratio = ratio
  gainfilter.softness = softness

  applygainfilter = DoubleApplyGainFilter(1)
  applygainfilter.input_sampling_rate = sample_rate
  applygainfilter.set_input_port(0, gainfilter, 0)
  applygainfilter.set_input_port(1, infilter, 0)

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

  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:31,代码来源:PyATKDynamic_expandergain_test.py

示例4: process

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def process(input_l, input_r):
  # Populate the outputs
  output_l = np.zeros(size, dtype=np.float64)
  output_r = np.zeros(size, dtype=np.float64)

  # Create the inputs of the pipeline from the numpy arrays
  infilter_l = DoubleInPointerFilter(input_l, False)
  infilter_l.input_sampling_rate = sample_rate
  infilter_r = DoubleInPointerFilter(input_r, False)
  infilter_r.input_sampling_rate = sample_rate

  # Create the intermediate buffer and connect it to the inputs
  buffer = DoubleBufferFilter(2)
  buffer.input_sampling_rate = sample_rate
  buffer.set_input_port(0, infilter_l, 0)
  buffer.set_input_port(1, infilter_r, 0)

  # Create the outputs and connect them to the buffer
  outfilter_l = DoubleOutPointerFilter(output_l, False)
  outfilter_l.input_sampling_rate = sample_rate
  outfilter_l.set_input_port(0, buffer, 1)

  outfilter_r = DoubleOutPointerFilter(output_r, False)
  outfilter_r.input_sampling_rate = sample_rate
  outfilter_r.set_input_port(0, buffer, 0)

  # Create the sink of the pipeline
  sink = PipelineGlobalSinkFilter()
  sink.input_sampling_rate = sample_rate
  sink.add_filter(outfilter_l)
  sink.add_filter(outfilter_r)

  # Process the pipeline
  sink.process(size)
  return (output_l, output_r)
开发者ID:mbrucher,项目名称:AudioTK,代码行数:37,代码来源:PyATKTools_Buffer_test.py

示例5: filter_4

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter_4(input):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  inputfilter = DoubleInPointerFilter(input, False)
  inputfilter.input_sampling_rate = sample_rate
  overfilter = DoubleOversampling6points5order_4Filter()
  overfilter.input_sampling_rate = sample_rate
  overfilter.output_sampling_rate = sample_rate * 4
  overfilter.set_input_port(0, inputfilter, 0)
  overdrivefilter = DoubleSD1OverdriveFilter()
  overdrivefilter.input_sampling_rate = sample_rate * 4
  overdrivefilter.set_input_port(0, overfilter, 0)
  overdrivefilter.drive = 0.9
  lowpassfilter = DoubleButterworthLowPassFilter()
  lowpassfilter.input_sampling_rate = sample_rate * 4
  lowpassfilter.cut_frequency = sample_rate
  lowpassfilter.order = 5
  lowpassfilter.set_input_port(0, overdrivefilter, 0)
  decimationfilter = DoubleDecimationFilter(1)
  decimationfilter.input_sampling_rate = sample_rate * 4
  decimationfilter.output_sampling_rate = sample_rate
  decimationfilter.set_input_port(0, lowpassfilter, 0)
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = sample_rate
  outfilter.set_input_port(0, decimationfilter, 0)
  outfilter.process(input.shape[1])
  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:30,代码来源:PyATKDistortion_sd1_overdrive_test.py

示例6: filter_4

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
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 = DoubleEnhancedKorenTriodeFilter.build_standard_filter()
  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
开发者ID:mbrucher,项目名称:AudioTK,代码行数:29,代码来源:PyATKPreamplifier_enhanced_tube_filter_test.py

示例7: filter_32

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter_32(input):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  infilter = DoubleInPointerFilter(input, False)
  infilter.input_sampling_rate = 48000
  overfilter = DoubleOversampling6points5order_32Filter()
  overfilter.input_sampling_rate = 48000
  overfilter.output_sampling_rate = 48000 * 32
  overfilter.set_input_port(0, infilter, 0)
  overdrivefilter = DoubleDiodeClipperFilter()
  overdrivefilter.input_sampling_rate = 48000 * 32
  overdrivefilter.set_input_port(0, overfilter, 0)
  lowpassfilter = DoubleButterworthLowPassFilter()
  lowpassfilter.input_sampling_rate = 48000 * 32
  lowpassfilter.cut_frequency = 48000
  lowpassfilter.order = 5
  lowpassfilter.set_input_port(0, overdrivefilter, 0)
  decimationfilter = DoubleDecimationFilter(1)
  decimationfilter.input_sampling_rate = 48000 * 32
  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
开发者ID:mbrucher,项目名称:AudioTK,代码行数:29,代码来源:PyATKDistortion_diode_clipper_test.py

示例8: filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter(input, ingain_ch1=0, ingain_ch2=0, ingain_ch3=0, ingain_ch4=0,
    outgain_ch1=0, outgain_ch2=0, outgain_ch3=0, outgain_ch4=0,
    feedback_ch1=0, feedback_ch2=0, feedback_ch3=0, feedback_ch4=0):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

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

  delayfilter = DoubleQuadHouseholderFeedbackDelayNetworkFilter(10000)
  delayfilter.input_sampling_rate = sample_rate
  delayfilter.set_input_port(0, infilter, 0)
  delayfilter.set_delay(0, 4800) #50ms
  delayfilter.set_delay(1, 3600) #37.5ms
  delayfilter.set_delay(2, 2400) #25
  delayfilter.set_delay(3, 1200) #12.5ms
  delayfilter.set_ingain(0, ingain_ch1)
  delayfilter.set_ingain(1, ingain_ch2)
  delayfilter.set_ingain(2, ingain_ch3)
  delayfilter.set_ingain(3, ingain_ch4)
  delayfilter.set_outgain(0, outgain_ch1)
  delayfilter.set_outgain(1, outgain_ch2)
  delayfilter.set_outgain(2, outgain_ch3)
  delayfilter.set_outgain(3, outgain_ch4)
  delayfilter.set_feedback(0, feedback_ch1)
  delayfilter.set_feedback(1, feedback_ch2)
  delayfilter.set_feedback(2, feedback_ch3)
  delayfilter.set_feedback(3, feedback_ch4)
  
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = sample_rate
  outfilter.set_input_port(0, delayfilter, 0)
  outfilter.process(input.shape[1])

  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:37,代码来源:PyATKDelay_householderfdn_test.py

示例9: learn

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
  def learn(self, input, ref):
    import numpy as np
    output = np.zeros(input.shape, dtype=np.float64)

    infilter = DoubleInPointerFilter(input, False)
    infilter.input_sampling_rate = fs
    reffilter = DoubleInPointerFilter(ref, False)
    reffilter.input_sampling_rate = fs
    self.lms.set_input_port(0, infilter, 0)
    self.lms.set_input_port(1, reffilter, 0)
    outfilter = DoubleOutPointerFilter(output, False)
    outfilter.input_sampling_rate = fs
    outfilter.set_input_port(0, self.lms, 0)
    outfilter.process(input.shape[1])

    return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:18,代码来源:PyATKAdaptive_lms_filter_noise_test.py

示例10: DoubleInPointerFilter_wrong_retrieve_test

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def DoubleInPointerFilter_wrong_retrieve_test():
  import numpy as np
  from ATK.Core import DoubleInPointerFilter
  d = np.ascontiguousarray(np.arange(1000, dtype=np.float64)[None,:])
  filter = DoubleInPointerFilter(d, False)
  filter.input_sampling_rate = 48000
  filter.process(1000)
  filter.get_output_array(1)
开发者ID:mbrucher,项目名称:AudioTK,代码行数:10,代码来源:PyATKPointer_test.py

示例11: filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter(inputl, inputr, blend_ch1=0, blend_ch2=0,
    feedback_ch1_ch1=0, feedback_ch1_ch2=0, feedback_ch2_ch1=0, feedback_ch2_ch2=0,
    feedforward_ch1_ch1=1, feedforward_ch1_ch2=0, feedforward_ch2_ch1=0, feedforward_ch2_ch2=1):
  import numpy as np
  outputl = np.zeros(inputl.shape, dtype=np.float64)
  outputr = np.zeros(inputl.shape, dtype=np.float64)

  infilterL = DoubleInPointerFilter(inputl, False)
  infilterL.input_sampling_rate = sample_rate
  infilterR = DoubleInPointerFilter(inputr, False)
  infilterR.input_sampling_rate = sample_rate

  delayfilter = DoubleDualMultipleUniversalFixedDelayLineFilter(5000)
  delayfilter.input_sampling_rate = sample_rate
  delayfilter.set_input_port(0, infilterL, 0)
  delayfilter.set_input_port(1, infilterR, 0)
  delayfilter.set_delay(0,4800) #50ms
  delayfilter.set_delay(1,3600) #37.5ms
  delayfilter.set_blend(0,blend_ch1)
  delayfilter.set_blend(1,blend_ch2)
  delayfilter.set_feedback(0,0,feedback_ch1_ch1)
  delayfilter.set_feedback(0,1,feedback_ch1_ch2)
  delayfilter.set_feedback(1,0,feedback_ch2_ch1)
  delayfilter.set_feedback(1,1,feedback_ch2_ch2)
  delayfilter.set_feedforward(0,0,feedforward_ch1_ch1)
  delayfilter.set_feedforward(0,1,feedforward_ch1_ch2)
  delayfilter.set_feedforward(1,0,feedforward_ch2_ch1)
  delayfilter.set_feedforward(1,1,feedforward_ch2_ch2)
  
  outfilterl = DoubleOutPointerFilter(outputl, False)
  outfilterl.input_sampling_rate = sample_rate
  outfilterl.set_input_port(0, delayfilter, 0)

  outfilterr = DoubleOutPointerFilter(outputr, False)
  outfilterr.input_sampling_rate = sample_rate
  outfilterr.set_input_port(0, delayfilter, 1)
  
  pipelineend = PipelineGlobalSinkFilter()
  pipelineend.input_sampling_rate = sample_rate
  pipelineend.add_filter(outfilterl)
  pipelineend.add_filter(outfilterr)
  pipelineend.process(inputl.shape[1])

  return outputl, outputr
开发者ID:mbrucher,项目名称:AudioTK,代码行数:46,代码来源:PyATKDelay_stereouniversaldelay_test.py

示例12: filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter(input, reference):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  infilter = DoubleInPointerFilter(input, False)
  infilter.input_sampling_rate = 48000
  reffilter = DoubleInPointerFilter(reference, False)
  reffilter.input_sampling_rate = 48000
  rls = DoubleBlockLMSFilter(100)
  rls.input_sampling_rate = 48000
  rls.memory = 0.999
  rls.mu = 0.0001
  rls.set_input_port(0, infilter, 0)
  rls.set_input_port(1, reffilter, 0)
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = 48000
  outfilter.set_input_port(0, rls, 0)
  outfilter.process(input.shape[1])

  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:22,代码来源:PyATKAdaptive_blocklms_test.py

示例13: process

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
  def process(self, input):
    self.rls.learning = False

    import numpy as np
    output = np.zeros(input.shape, dtype=np.float64)
    
    infilter = DoubleInPointerFilter(input, False)
    infilter.input_sampling_rate = fs
    self.rls.set_input_port(0, infilter, 0)
    outfilter = DoubleOutPointerFilter(output, False)
    outfilter.input_sampling_rate = fs
    outfilter.set_input_port(0, self.rls, 0)
    outfilter.process(input.shape[1])

    return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:17,代码来源:PyATKAdaptive_rls_filter_noise_test.py

示例14: tone_filter

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def tone_filter(input):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)

  infilter = DoubleInPointerFilter(input, False)
  infilter.input_sampling_rate = sampling
  tonefilter = DoubleSD1ToneFilter()
  tonefilter.input_sampling_rate = sampling
  tonefilter.set_input_port(0, infilter, 0)
  tonefilter.tone = 0.5
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = sampling
  outfilter.set_input_port(0, tonefilter, 0)
  outfilter.process(input.shape[1])
  return output, tonefilter.coefficients_in, tonefilter.coefficients_out
开发者ID:mbrucher,项目名称:AudioTK,代码行数:17,代码来源:PyATKEQ_sd1_tone_test.py

示例15: filter_asym

# 需要导入模块: from ATK.Core import DoubleInPointerFilter [as 别名]
# 或者: from ATK.Core.DoubleInPointerFilter import input_sampling_rate [as 别名]
def filter_asym(input):
  import numpy as np
  output = np.zeros(input.shape, dtype=np.float64)
  
  inputfilter = DoubleInPointerFilter(input, False)
  inputfilter.input_sampling_rate = sample_rate
  shaperfilter = DoubleHalfTanhShaperFilter()
  shaperfilter.input_sampling_rate = sample_rate
  shaperfilter.coefficient = 2
  shaperfilter.set_input_port(0, inputfilter, 0)
  
  outfilter = DoubleOutPointerFilter(output, False)
  outfilter.input_sampling_rate = sample_rate
  outfilter.set_input_port(0, shaperfilter, 0)
  outfilter.process(input.shape[1])
  return output
开发者ID:mbrucher,项目名称:AudioTK,代码行数:18,代码来源:PyATKDistortion_tanhshaper_test.py


注:本文中的ATK.Core.DoubleInPointerFilter.input_sampling_rate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。