Add staged filtering on NOAA decoder
This commit is contained in:
parent
e9f7051985
commit
f4e4bdba9b
|
@ -109,6 +109,83 @@ the quadrature demodulation</value>
|
|||
<value>2</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>variable</key>
|
||||
<param>
|
||||
<key>comment</key>
|
||||
<value>The first stage decimation tries to decrease
|
||||
the sampling rate of the device in order to keep
|
||||
the CPU utilization of the next processing blocks
|
||||
in acceptable levels especially for embedded devices.</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(1306, 460)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>id</key>
|
||||
<value>first_stage_decimation</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>value</key>
|
||||
<value>2</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>variable_low_pass_filter_taps</key>
|
||||
<param>
|
||||
<key>beta</key>
|
||||
<value>6.76</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>comment</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>cutoff_freq</key>
|
||||
<value>0.2</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(16, 689)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>gain</key>
|
||||
<value>1.0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>id</key>
|
||||
<value>first_stage_filter_taps</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>samp_rate</key>
|
||||
<value>1.0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>width</key>
|
||||
<value>0.1</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>win</key>
|
||||
<value>firdes.WIN_HAMMING</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>variable</key>
|
||||
<param>
|
||||
|
@ -256,7 +333,7 @@ TX sampling rate</value>
|
|||
</param>
|
||||
<param>
|
||||
<key>quad_rate</key>
|
||||
<value>samp_rate_rx / int(samp_rate_rx / initial_bandwidth)</value>
|
||||
<value>samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth))</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
|
@ -327,7 +404,7 @@ TX sampling rate</value>
|
|||
</param>
|
||||
<param>
|
||||
<key>samp_rate</key>
|
||||
<value>(samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation</value>
|
||||
<value>samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)) / audio_decimation</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>width</key>
|
||||
|
@ -440,7 +517,7 @@ TX sampling rate</value>
|
|||
</param>
|
||||
<param>
|
||||
<key>decim</key>
|
||||
<value>int(samp_rate_rx / initial_bandwidth)</value>
|
||||
<value>int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
|
@ -448,7 +525,7 @@ TX sampling rate</value>
|
|||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(719, 123)</value>
|
||||
<value>(721, 124)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
|
@ -534,6 +611,65 @@ TX sampling rate</value>
|
|||
<value>fff</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>freq_xlating_fir_filter_xxx</key>
|
||||
<param>
|
||||
<key>alias</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>center_freq</key>
|
||||
<value>lo_offset</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>comment</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>affinity</key>
|
||||
<value></value>
|
||||
</param>
|
||||
<param>
|
||||
<key>decim</key>
|
||||
<value>first_stage_decimation</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
<value>True</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_coordinate</key>
|
||||
<value>(296, 312)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_rotation</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>id</key>
|
||||
<value>freq_xlating_fir_filter_xxx_0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>maxoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>minoutbuf</key>
|
||||
<value>0</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>samp_rate</key>
|
||||
<value>samp_rate_rx</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>taps</key>
|
||||
<value>first_stage_filter_taps</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>type</key>
|
||||
<value>ccc</value>
|
||||
</param>
|
||||
</block>
|
||||
<block>
|
||||
<key>hilbert_fc</key>
|
||||
<param>
|
||||
|
@ -2138,7 +2274,7 @@ we shift the LO a little further</value>
|
|||
</param>
|
||||
<param>
|
||||
<key>decim</key>
|
||||
<value>int(((samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation) / 2)</value>
|
||||
<value>int((samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)) / audio_decimation)/2)</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>_enabled</key>
|
||||
|
@ -2409,7 +2545,7 @@ we shift the LO a little further</value>
|
|||
</param>
|
||||
<param>
|
||||
<key>sampling_rate</key>
|
||||
<value>samp_rate_rx</value>
|
||||
<value>samp_rate_rx /first_stage_decimation</value>
|
||||
</param>
|
||||
<param>
|
||||
<key>target_freq</key>
|
||||
|
@ -2560,6 +2696,12 @@ we shift the LO a little further</value>
|
|||
<source_key>0</source_key>
|
||||
<sink_key>0</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>freq_xlating_fir_filter_xxx_0</source_block_id>
|
||||
<sink_block_id>satnogs_coarse_doppler_correction_cc_0</sink_block_id>
|
||||
<source_key>0</source_key>
|
||||
<sink_key>0</sink_key>
|
||||
</connection>
|
||||
<connection>
|
||||
<source_block_id>hilbert_fc_0</source_block_id>
|
||||
<sink_block_id>blocks_complex_to_mag_0</sink_block_id>
|
||||
|
@ -2568,7 +2710,7 @@ we shift the LO a little further</value>
|
|||
</connection>
|
||||
<connection>
|
||||
<source_block_id>osmosdr_source_0</source_block_id>
|
||||
<sink_block_id>satnogs_coarse_doppler_correction_cc_0</sink_block_id>
|
||||
<sink_block_id>freq_xlating_fir_filter_xxx_0</sink_block_id>
|
||||
<source_key>0</source_key>
|
||||
<sink_key>0</sink_key>
|
||||
</connection>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# Title: NOAA APT Decoder
|
||||
# Author: Manolis Surligas, George Vardakis
|
||||
# Description: A NOAA APT Decoder with automatic image synchronization
|
||||
# Generated: Fri Jun 23 02:28:46 2017
|
||||
# Generated: Fri Jun 23 15:41:33 2017
|
||||
##################################################
|
||||
|
||||
from gnuradio import analog
|
||||
|
@ -45,6 +45,10 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
self.noaa_filter_taps = noaa_filter_taps = firdes.low_pass(1.0, 1.0, 0.17, 0.02, firdes.WIN_HAMMING, 6.76)
|
||||
|
||||
self.initial_bandwidth = initial_bandwidth = 100e3
|
||||
|
||||
self.first_stage_filter_taps = first_stage_filter_taps = firdes.low_pass(1.0, 1.0, 0.2, 0.1, firdes.WIN_HAMMING, 6.76)
|
||||
|
||||
self.first_stage_decimation = first_stage_decimation = 2
|
||||
self.audio_decimation = audio_decimation = 2
|
||||
|
||||
##################################################
|
||||
|
@ -52,7 +56,7 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
##################################################
|
||||
self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500)
|
||||
self.satnogs_noaa_apt_sink_0 = satnogs.noaa_apt_sink(image_file_path, 2080, 1500, True, False, False)
|
||||
self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx)
|
||||
self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx /first_stage_decimation)
|
||||
self.rational_resampler_xxx_0_0 = filter.rational_resampler_fff(
|
||||
interpolation=4160,
|
||||
decimation=9600,
|
||||
|
@ -61,7 +65,7 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
)
|
||||
self.rational_resampler_xxx_0 = filter.rational_resampler_fff(
|
||||
interpolation=9600,
|
||||
decimation=int(((samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation) / 2),
|
||||
decimation=int((samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)) / audio_decimation)/2),
|
||||
taps=None,
|
||||
fractional_bw=None,
|
||||
)
|
||||
|
@ -79,15 +83,16 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0)
|
||||
|
||||
self.hilbert_fc_0 = filter.hilbert_fc(65, firdes.WIN_HAMMING, 6.76)
|
||||
self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(first_stage_decimation, (first_stage_filter_taps), lo_offset, samp_rate_rx)
|
||||
self.fir_filter_xxx_1 = filter.fir_filter_fff(2, ([0.5, 0.5]))
|
||||
self.fir_filter_xxx_1.declare_sample_delay(0)
|
||||
self.fir_filter_xxx_0 = filter.fir_filter_ccc(int(samp_rate_rx / initial_bandwidth), (noaa_filter_taps))
|
||||
self.fir_filter_xxx_0 = filter.fir_filter_ccc(int(samp_rate_rx/ first_stage_decimation / initial_bandwidth), (noaa_filter_taps))
|
||||
self.fir_filter_xxx_0.declare_sample_delay(0)
|
||||
self.blocks_complex_to_mag_0 = blocks.complex_to_mag(1)
|
||||
self.band_pass_filter_0 = filter.fir_filter_fff(1, firdes.band_pass(
|
||||
6, (samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
6, samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)) / audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
self.analog_wfm_rcv_0 = analog.wfm_rcv(
|
||||
quad_rate=samp_rate_rx / int(samp_rate_rx / initial_bandwidth),
|
||||
quad_rate=samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)),
|
||||
audio_decimation=audio_decimation,
|
||||
)
|
||||
|
||||
|
@ -100,8 +105,9 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
self.connect((self.blocks_complex_to_mag_0, 0), (self.rational_resampler_xxx_0_0, 0))
|
||||
self.connect((self.fir_filter_xxx_0, 0), (self.analog_wfm_rcv_0, 0))
|
||||
self.connect((self.fir_filter_xxx_1, 0), (self.rational_resampler_xxx_0, 0))
|
||||
self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
|
||||
self.connect((self.hilbert_fc_0, 0), (self.blocks_complex_to_mag_0, 0))
|
||||
self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0))
|
||||
self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0))
|
||||
self.connect((self.rational_resampler_xxx_0, 0), (self.hilbert_fc_0, 0))
|
||||
self.connect((self.rational_resampler_xxx_0_0, 0), (self.satnogs_noaa_apt_sink_0, 0))
|
||||
self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.fir_filter_xxx_0, 0))
|
||||
|
@ -124,6 +130,7 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
def set_lo_offset(self, lo_offset):
|
||||
self.lo_offset = lo_offset
|
||||
self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0)
|
||||
self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset)
|
||||
|
||||
def get_ppm(self):
|
||||
return self.ppm
|
||||
|
@ -164,7 +171,7 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
self.samp_rate_rx = samp_rate_rx
|
||||
self.osmosdr_source_0.set_sample_rate(self.samp_rate_rx)
|
||||
self.osmosdr_source_0.set_bandwidth(self.samp_rate_rx, 0)
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, (self.samp_rate_rx / int(self.samp_rate_rx / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, self.samp_rate_rx/ ( self.first_stage_decimation * int(self.samp_rate_rx/ self.first_stage_decimation / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
|
||||
def get_noaa_filter_taps(self):
|
||||
return self.noaa_filter_taps
|
||||
|
@ -178,14 +185,28 @@ class satnogs_noaa_apt_decoder(gr.top_block):
|
|||
|
||||
def set_initial_bandwidth(self, initial_bandwidth):
|
||||
self.initial_bandwidth = initial_bandwidth
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, (self.samp_rate_rx / int(self.samp_rate_rx / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, self.samp_rate_rx/ ( self.first_stage_decimation * int(self.samp_rate_rx/ self.first_stage_decimation / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
|
||||
def get_first_stage_filter_taps(self):
|
||||
return self.first_stage_filter_taps
|
||||
|
||||
def set_first_stage_filter_taps(self, first_stage_filter_taps):
|
||||
self.first_stage_filter_taps = first_stage_filter_taps
|
||||
self.freq_xlating_fir_filter_xxx_0.set_taps((self.first_stage_filter_taps))
|
||||
|
||||
def get_first_stage_decimation(self):
|
||||
return self.first_stage_decimation
|
||||
|
||||
def set_first_stage_decimation(self, first_stage_decimation):
|
||||
self.first_stage_decimation = first_stage_decimation
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, self.samp_rate_rx/ ( self.first_stage_decimation * int(self.samp_rate_rx/ self.first_stage_decimation / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
|
||||
def get_audio_decimation(self):
|
||||
return self.audio_decimation
|
||||
|
||||
def set_audio_decimation(self, audio_decimation):
|
||||
self.audio_decimation = audio_decimation
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, (self.samp_rate_rx / int(self.samp_rate_rx / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
self.band_pass_filter_0.set_taps(firdes.band_pass(6, self.samp_rate_rx/ ( self.first_stage_decimation * int(self.samp_rate_rx/ self.first_stage_decimation / self.initial_bandwidth)) / self.audio_decimation, 500, 4.2e3, 200, firdes.WIN_HAMMING, 6.76))
|
||||
|
||||
|
||||
def argument_parser():
|
||||
|
|
Loading…
Reference in New Issue