[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] gnuradio filtering
From: |
Eric Hill Matlis |
Subject: |
[Discuss-gnuradio] gnuradio filtering |
Date: |
Wed, 15 Nov 2006 12:28:22 -0500 (EST) |
Hi-
I'm not sure how to implement a band-pass filter. I have an am-modulated
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:
www.nd.edu/~ematlis/z.gnuradio/am_lpfilter.jpg
www.nd.edu/~ematlis/z.gnuradio/am_band_pass_filter.jpg
My code is:
adc_rate = self.u.adc_rate() # 64 MS/s
usrp_decim = 250
self.u.set_decim_rate(usrp_decim)
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.u.set_mux(usrp.determine_rx_mux_value(self.u,
options.rx_subdev_spec))
self.subdev = usrp.selected_subdev(self.u, options.rx_subdev_spec)
#chan_filt_coeffs = gr.firdes.band_pass (1, # gain
chan_filt_coeffs = gr.firdes.low_pass (1, # gain
usrp_rate, # sampling rate
#3e2,
6.e3, # passband cutoff
100, # stopband cutoff
gr.firdes.WIN_HANN)
self.lpfilter = gr.fir_filter_ccf
(chanfilt_decim,chan_filt_coeffs)
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 (self.post_filt.win, 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 (self.scope.win, 4, wx.EXPAND)
thanks!
eric
am_lpfilter.jpg
Description: JPEG image
am_band_pass_filter.jpg
Description: JPEG image
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Discuss-gnuradio] gnuradio filtering,
Eric Hill Matlis <=