本文整理汇总了Python中gnuradio.filter.firdes.WIN_HAMMING属性的典型用法代码示例。如果您正苦于以下问题:Python firdes.WIN_HAMMING属性的具体用法?Python firdes.WIN_HAMMING怎么用?Python firdes.WIN_HAMMING使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gnuradio.filter.firdes
的用法示例。
在下文中一共展示了firdes.WIN_HAMMING属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_samp_rate
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.gsm_controlled_rotator_cc_0.set_phase_inc(self.ppm/1.0e6*2*math.pi*self.rx_freq/self.samp_rate)
self.gsm_controlled_rotator_cc_0_0.set_phase_inc(-self.ppm/1.0e6*2*math.pi*self.tx_freq/self.samp_rate)
self.low_pass_filter_0_0.set_taps(firdes.low_pass(1, self.samp_rate, 125e3, 5e3, firdes.WIN_HAMMING, 6.76))
self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate)
self.uhd_usrp_source_0.set_samp_rate(self.samp_rate)
示例2: set_trans
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_trans(self, trans):
self.trans = trans
self.band_pass_filter_0.set_taps(firdes.complex_band_pass(1, self.samp_rate/50, -2500, 2500, self.trans, firdes.WIN_HAMMING, 6.76))
示例3: set_samp_rate
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.freq_xlating_fir_filter_xxx_0.set_taps((firdes.low_pass(1, self.samp_rate,
self.channel_spacing,self.channel_trans, firdes.WIN_BLACKMAN, 6.76)))
self.band_pass_filter_0.set_taps(firdes.complex_band_pass(1, self.samp_rate/50, -2500, 2500, self.trans, firdes.WIN_HAMMING, 6.76))
self.osmosdr_source_0.set_sample_rate(self.samp_rate)
self.qtgui_sink_x_0.set_frequency_range(self.freq-self.freq_offset, self.samp_rate/50)
self.qtgui_freq_sink_x_0.set_frequency_range(self.freq, self.samp_rate)
self.qtgui_waterfall_sink_x_0.set_frequency_range(self.freq, self.samp_rate)
示例4: set_trans_width
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_trans_width(self, trans_width):
self.trans_width = trans_width
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, self.cutoff_freq, self.trans_width, firdes.WIN_HAMMING, 6.76))
示例5: set_samp_rate
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.osmosdr_source_0.set_sample_rate(self.samp_rate)
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, self.cutoff_freq, self.trans_width, firdes.WIN_HAMMING, 6.76))
示例6: set_cutoff_freq
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_cutoff_freq(self, cutoff_freq):
self.cutoff_freq = cutoff_freq
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, self.cutoff_freq, self.trans_width, firdes.WIN_HAMMING, 6.76))
示例7: __init__
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def __init__(self):
gr.top_block.__init__(self, name="Doorbell Top Block")
# RF Config
self.threshold_min = -60
self.threshold_max = -50
self.samp_rate = samp_rate = 100e3
self.gain = gain = 30
self.freq = freq = 315e6
self.decimation = 10
# USRP
self.usrp = uhd.usrp_source("", uhd.stream_args("fc32"))
self.usrp.set_samp_rate(samp_rate)
self.usrp.set_center_freq(freq, 0)
self.usrp.set_gain(gain, 0)
self.usrp.set_antenna("TX/RX", 0)
# Low Pass Filter
self.lpf = filter.fir_filter_ccf(self.decimation,
firdes.low_pass(1, samp_rate, 50e3, 10e3, firdes.WIN_HAMMING, 6.76))
# Complex to Power (dB)
self._10log10 = blocks.nlog10_ff(10, 1, 0)
self.complex_to_mag_squared = blocks.complex_to_mag_squared(1)
# Threshold
self.threshold = blocks.threshold_ff(self.threshold_min, self.threshold_max, 0)
# Framer
self.framer = doorbell_framer()
# Connect the blocks
self.connect((self.usrp, 0), (self.lpf, 0))
self.connect((self.lpf, 0), (self.complex_to_mag_squared, 0))
self.connect((self.complex_to_mag_squared, 0), (self._10log10, 0))
self.connect((self._10log10, 0), (self.threshold, 0))
self.connect((self.threshold, 0), (self.framer, 0))
# Doorbell Framer
示例8: set_samp_rate
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, self.dect_rate, 10e3, firdes.WIN_HAMMING, 6.76))
self.osmosdr_source_0.set_sample_rate(self.samp_rate)
self.wxgui_waterfallsink2_0.set_sample_rate(self.samp_rate)
示例9: set_dect_rate
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def set_dect_rate(self, dect_rate):
self.dect_rate = dect_rate
self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.samp_rate, self.dect_rate, 10e3, firdes.WIN_HAMMING, 6.76))
self.osmosdr_source_0.set_bandwidth(self.dect_rate, 0)
示例10: __init__
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def __init__(self):
gr.top_block.__init__(self, "Top Block")
##################################################
# Variables
##################################################
self.trans_width = trans_width = 10e3
self.samp_rate = samp_rate = 1e6
self.mult_const = mult_const = 100
self.lowpass_decimation = lowpass_decimation = 10
self.freq = freq = 344940000
self.cutoff_freq = cutoff_freq = 50e3
##################################################
# Blocks
##################################################
self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + '' )
self.osmosdr_source_0.set_sample_rate(samp_rate)
self.osmosdr_source_0.set_center_freq(freq, 0)
self.osmosdr_source_0.set_freq_corr(0, 0)
self.osmosdr_source_0.set_dc_offset_mode(0, 0)
self.osmosdr_source_0.set_iq_balance_mode(0, 0)
self.osmosdr_source_0.set_gain_mode(True, 0)
self.osmosdr_source_0.set_gain(0, 0)
self.osmosdr_source_0.set_if_gain(20, 0)
self.osmosdr_source_0.set_bb_gain(20, 0)
self.osmosdr_source_0.set_antenna('', 0)
self.osmosdr_source_0.set_bandwidth(0, 0)
self.low_pass_filter_0 = filter.fir_filter_ccf(lowpass_decimation, firdes.low_pass(
1, samp_rate, cutoff_freq, trans_width, firdes.WIN_HAMMING, 6.76))
self.blocks_multiply_const_vxx_0 = blocks.multiply_const_vff((mult_const, ))
self.blocks_float_to_uchar_0 = blocks.float_to_uchar()
self.blocks_file_sink_1 = blocks.file_sink(gr.sizeof_char*1, '/tmp/grcfifo', False)
self.blocks_file_sink_1.set_unbuffered(False)
self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1)
##################################################
# Connections
##################################################
self.connect((self.blocks_complex_to_mag_0, 0), (self.blocks_multiply_const_vxx_0, 0))
self.connect((self.blocks_float_to_uchar_0, 0), (self.blocks_file_sink_1, 0))
self.connect((self.blocks_multiply_const_vxx_0, 0), (self.blocks_float_to_uchar_0, 0))
self.connect((self.low_pass_filter_0, 0), (self.blocks_complex_to_mag_0, 0))
self.connect((self.osmosdr_source_0, 0), (self.low_pass_filter_0, 0))
示例11: rebuild_filters
# 需要导入模块: from gnuradio.filter import firdes [as 别名]
# 或者: from gnuradio.filter.firdes import WIN_HAMMING [as 别名]
def rebuild_filters(self,config,value = None):
if self.cw_base == None:
return
if value == None:
value = config['bw_mode']
am_bw = (8000,3000,2000)[value]
fm_bw = (8000,6000,4000)[value]
wfm_bw = (60e3,40e3,20e3)[value]
ssb_bw = (5000,2400,1800)[value]
cw_bw = (self.cw_base*2/3,self.cw_base/2,self.cw_base/3)[value]
am_taps = firdes.low_pass(
1, self.audio_rate, am_bw, 500, firdes.WIN_HAMMING, 6.76)
fm_taps = firdes.low_pass(
1, self.audio_rate, fm_bw, 500, firdes.WIN_HAMMING, 6.76)
wfm_taps = firdes.low_pass(
1, self.if_sample_rate, wfm_bw, 4e3, firdes.WIN_HAMMING, 6.76)
ssb_taps = firdes.low_pass(
1, self.audio_rate, ssb_bw, 100, firdes.WIN_HAMMING, 6.76)
#print("CW Base: %d - %d - %d" % (self.cw_base-cw_bw,self.cw_base + cw_bw,self.audio_rate))
cw_taps = firdes.band_pass(
1, self.audio_rate, self.cw_base-cw_bw,self.cw_base+cw_bw, 100, firdes.WIN_HAMMING, 6.76)
if self.low_pass_filter_am == None:
self.low_pass_filter_am = filter.fir_filter_ccf(1, am_taps)
else:
self.low_pass_filter_am.set_taps(am_taps)
if self.low_pass_filter_fm == None:
self.low_pass_filter_fm = filter.fir_filter_ccf(1, fm_taps)
else:
self.low_pass_filter_fm.set_taps(fm_taps)
if self.low_pass_filter_wfm == None:
self.low_pass_filter_wfm = filter.fir_filter_ccf(1, wfm_taps)
else:
self.low_pass_filter_wfm.set_taps(wfm_taps)
if self.low_pass_filter_ssb == None:
self.low_pass_filter_ssb = filter.fir_filter_fff(1, ssb_taps)
else:
self.low_pass_filter_ssb.set_taps(ssb_taps)
if self.band_pass_filter_cw == None:
self.band_pass_filter_cw = filter.fir_filter_fff(1, cw_taps)
else:
self.band_pass_filter_cw.set_taps(cw_taps)
# calculate gcd using Euclid's algorithm