本文整理匯總了Python中ATK.Tools.DoubleDecimationFilter.input_sampling_rate方法的典型用法代碼示例。如果您正苦於以下問題:Python DoubleDecimationFilter.input_sampling_rate方法的具體用法?Python DoubleDecimationFilter.input_sampling_rate怎麽用?Python DoubleDecimationFilter.input_sampling_rate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ATK.Tools.DoubleDecimationFilter
的用法示例。
在下文中一共展示了DoubleDecimationFilter.input_sampling_rate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: filter_4
# 需要導入模塊: from ATK.Tools import DoubleDecimationFilter [as 別名]
# 或者: from ATK.Tools.DoubleDecimationFilter 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
示例2: filter_32
# 需要導入模塊: from ATK.Tools import DoubleDecimationFilter [as 別名]
# 或者: from ATK.Tools.DoubleDecimationFilter 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
示例3: filter_4
# 需要導入模塊: from ATK.Tools import DoubleDecimationFilter [as 別名]
# 或者: from ATK.Tools.DoubleDecimationFilter 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
示例4: Decimation_test
# 需要導入模塊: from ATK.Tools import DoubleDecimationFilter [as 別名]
# 或者: from ATK.Tools.DoubleDecimationFilter import input_sampling_rate [as 別名]
def Decimation_test():
import numpy as np
from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter
from ATK.Tools import DoubleDecimationFilter
from numpy.testing import assert_almost_equal
input = np.sin(np.arange(2000, dtype=np.float64)[None,:] * 1000 * 2 * np.pi / 96000)
output = np.ascontiguousarray(np.zeros(1000, dtype=np.float64)[None,:])
inputfilter = DoubleInPointerFilter(input, False)
decimationfilter = DoubleDecimationFilter(1)
outputfilter = DoubleOutPointerFilter(output, False)
inputfilter.output_sampling_rate = 96000
decimationfilter.input_sampling_rate = 96000
decimationfilter.output_sampling_rate = 48000
outputfilter.input_sampling_rate = 48000
decimationfilter.set_input_port(0, inputfilter, 0)
outputfilter.set_input_port(0, decimationfilter, 0)
outputfilter.process(1000)
assert_almost_equal(input[:,::2], output)