Gnuradio filtering


I’m not sure how to implement a band-pass filter. I have an
waveform with the carrier at about 2.858 MHz, and modulations between 1
kHz and 5 kHz. I wish to filter out anything above 6.5 kHz, and also
remove 60-hz noise I believe I am seeing; preferably I would like to
band-pass between say 300 Hz and 6500 Hz.

However, while the low-pass filter seems to work, the band-pass doesn’t
seem to be working as expected. I seem to loose most of my signal. I’m
not sure how to describe what’s going on, so I attached two figures
showing each filter’s response. These figures are also available at:

My code is:

     adc_rate = self.u.adc_rate()                # 64 MS/s
     usrp_decim = 250
     usrp_rate = adc_rate / usrp_decim           # 256 kS/s
     chanfilt_decim = 16
     demod_rate = usrp_rate / chanfilt_decim     # 16 kHz
     audio_decimation = 1
     audio_rate = demod_rate / audio_decimation  # 16 kHz

     if options.rx_subdev_spec is None:
         options.rx_subdev_spec = pick_subdevice(self.u)


self.subdev = usrp.selected_subdev(self.u,

     #chan_filt_coeffs = gr.firdes.band_pass (1,           # gain
     chan_filt_coeffs = gr.firdes.low_pass (1,           # gain
                                         usrp_rate,   # sampling 

6.e3, # passband
100, # stopband
self.lpfilter = gr.fir_filter_ccf

     self.magblock = gr.complex_to_mag()
     self.volume_control = gr.multiply_const_ff(self.vol)

     # now wire it all together
     self.connect (self.u, self.lpfilter)
     #self.connect (self.hpfilter, self.lpfilter)
     self.connect (self.lpfilter, self.magblock)

     if plot2:
         self.post_filt = fftsink.fft_sink_f (self, self.panel,

title=“AM Demodulated FFT”, fft_size=4096, sample_rate=audio_rate)
self.connect (self.magblock,self.post_filt)
vbox.Add (, 4, wx.EXPAND)

     if plot3:
         self.scope = scopesink.scope_sink_f(self, self.panel,

title=“AM Demodulated Time Series”, sample_rate=audio_rate)
self.connect(self.magblock, self.scope)
vbox.Add (, 4, wx.EXPAND)



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs