diff --git a/apps/flowgraphs/fm_demod.grc b/apps/flowgraphs/fm_demod.grc index 6397991..e215a9e 100644 --- a/apps/flowgraphs/fm_demod.grc +++ b/apps/flowgraphs/fm_demod.grc @@ -1,5 +1,5 @@ - + Thu May 5 00:22:45 2016 @@ -178,7 +178,7 @@ SDR received samples _coordinate - (781, 865) + (928, 1028) _rotation @@ -220,6 +220,33 @@ SDR received samples 250000 + + variable + + comment + + + + _enabled + True + + + _coordinate + (1040, 1028) + + + _rotation + 0 + + + id + max_modulation_freq + + + value + 3000 + + variable @@ -369,7 +396,7 @@ TX sampling rate _coordinate - (1085, 410) + (864, 412) _rotation @@ -941,6 +968,84 @@ we shift the LO a little further 100e3 + + low_pass_filter + + beta + 6.76 + + + alias + + + + comment + Using the Carson bandwidth rule for filter width: +width = 2*(deviation + max_modulation_freq). +For the majority of FM transmissions we can expect +max_modulation_freq = 3000 + + + affinity + + + + cutoff_freq + deviation+max_modulation_freq + + + decim + 1 + + + _enabled + True + + + type + fir_filter_ccf + + + _coordinate + (1064, 368) + + + _rotation + 180 + + + gain + 1 + + + id + low_pass_filter_0 + + + interp + 1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + audio_samp_rate + + + width + 3000 + + + win + firdes.WIN_HAMMING + + osmosdr_source @@ -2681,7 +2786,7 @@ we shift the LO a little further _coordinate - (877, 394) + (432, 396) _rotation @@ -2865,7 +2970,7 @@ we shift the LO a little further blks2_rational_resampler_xxx_1 - analog_quadrature_demod_cf_0 + low_pass_filter_0 0 0 @@ -2887,6 +2992,12 @@ we shift the LO a little further 0 0 + + low_pass_filter_0 + analog_quadrature_demod_cf_0 + 0 + 0 + osmosdr_source_0 satnogs_coarse_doppler_correction_cc_0 diff --git a/apps/flowgraphs/satnogs_fm_demod.py b/apps/flowgraphs/satnogs_fm_demod.py index cbbe1e7..0b6ef0b 100755 --- a/apps/flowgraphs/satnogs_fm_demod.py +++ b/apps/flowgraphs/satnogs_fm_demod.py @@ -5,7 +5,7 @@ # Title: FM Generic Demodulation # Author: Manolis Surligas (surligas@gmail.com) # Description: A generic FM demodulation block -# Generated: Wed Aug 9 13:41:22 2017 +# Generated: Thu Sep 21 10:50:12 2017 ################################################## from gnuradio import analog @@ -51,9 +51,10 @@ class satnogs_fm_demod(gr.top_block): ################################################## self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - + self.taps = taps = firdes.low_pass(12.0, samp_rate_rx, 100e3, 60000, firdes.WIN_HAMMING, 6.76) - + + self.max_modulation_freq = max_modulation_freq = 3000 self.filter_rate = filter_rate = 250000 self.deviation = deviation = 5000 self.audio_samp_rate = audio_samp_rate = 48000 @@ -79,7 +80,9 @@ class satnogs_fm_demod(gr.top_block): self.osmosdr_source_0.set_bb_gain(satnogs.handle_rx_bb_gain(rx_sdr_device, bb_gain), 0) self.osmosdr_source_0.set_antenna(satnogs.handle_rx_antenna(rx_sdr_device, antenna), 0) self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) - + + self.low_pass_filter_0 = filter.fir_filter_ccf(1, firdes.low_pass( + 1, audio_samp_rate, deviation+max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(int(samp_rate_rx/filter_rate), (xlate_filter_taps), lo_offset, samp_rate_rx) self.blks2_rational_resampler_xxx_1 = filter.rational_resampler_ccc( interpolation=24, @@ -92,14 +95,15 @@ class satnogs_fm_demod(gr.top_block): ################################################## # Connections ################################################## - self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) - self.connect((self.analog_quadrature_demod_cf_0, 0), (self.satnogs_ogg_encoder_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.analog_quadrature_demod_cf_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) - self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) - self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) - self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) - self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) + self.connect((self.analog_quadrature_demod_cf_0, 0), (self.satnogs_ogg_encoder_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.low_pass_filter_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_iq_sink_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) + self.connect((self.low_pass_filter_0, 0), (self.analog_quadrature_demod_cf_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) + self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) def get_antenna(self): return self.antenna @@ -234,6 +238,13 @@ class satnogs_fm_demod(gr.top_block): def set_taps(self, taps): self.taps = taps + def get_max_modulation_freq(self): + return self.max_modulation_freq + + def set_max_modulation_freq(self, max_modulation_freq): + self.max_modulation_freq = max_modulation_freq + self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, self.deviation+self.max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) + def get_filter_rate(self): return self.filter_rate @@ -245,6 +256,7 @@ class satnogs_fm_demod(gr.top_block): def set_deviation(self, deviation): self.deviation = deviation + self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, self.deviation+self.max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) self.analog_quadrature_demod_cf_0.set_gain((2*math.pi*self.deviation)/self.audio_samp_rate) def get_audio_samp_rate(self): @@ -252,6 +264,7 @@ class satnogs_fm_demod(gr.top_block): def set_audio_samp_rate(self, audio_samp_rate): self.audio_samp_rate = audio_samp_rate + self.low_pass_filter_0.set_taps(firdes.low_pass(1, self.audio_samp_rate, self.deviation+self.max_modulation_freq, 3000, firdes.WIN_HAMMING, 6.76)) self.analog_quadrature_demod_cf_0.set_gain((2*math.pi*self.deviation)/self.audio_samp_rate) def get_audio_gain(self):