diff --git a/apps/flowgraphs/satellites/noaa_apt_decoder.grc b/apps/flowgraphs/satellites/noaa_apt_decoder.grc
index 32bbbe3..44876bd 100644
--- a/apps/flowgraphs/satellites/noaa_apt_decoder.grc
+++ b/apps/flowgraphs/satellites/noaa_apt_decoder.grc
@@ -109,6 +109,83 @@ the quadrature demodulation
2
+
+ variable
+
+ comment
+ 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.
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (1306, 460)
+
+
+ _rotation
+ 0
+
+
+ id
+ first_stage_decimation
+
+
+ value
+ 2
+
+
+
+ variable_low_pass_filter_taps
+
+ beta
+ 6.76
+
+
+ comment
+
+
+
+ cutoff_freq
+ 0.2
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (16, 689)
+
+
+ _rotation
+ 0
+
+
+ gain
+ 1.0
+
+
+ id
+ first_stage_filter_taps
+
+
+ samp_rate
+ 1.0
+
+
+ width
+ 0.1
+
+
+ win
+ firdes.WIN_HAMMING
+
+
variable
@@ -177,7 +254,7 @@ the quadrature demodulation
width
- 0.01
+ 0.02
win
@@ -256,7 +333,7 @@ TX sampling rate
quad_rate
- samp_rate_rx / int(samp_rate_rx / initial_bandwidth)
+ samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth))
@@ -327,7 +404,7 @@ TX sampling rate
samp_rate
- (samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation
+ samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)) / audio_decimation
width
@@ -440,7 +517,7 @@ TX sampling rate
decim
- int(samp_rate_rx / initial_bandwidth)
+ int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)
_enabled
@@ -448,7 +525,7 @@ TX sampling rate
_coordinate
- (719, 123)
+ (721, 124)
_rotation
@@ -534,6 +611,65 @@ TX sampling rate
fff
+
+ freq_xlating_fir_filter_xxx
+
+ alias
+
+
+
+ center_freq
+ lo_offset
+
+
+ comment
+
+
+
+ affinity
+
+
+
+ decim
+ first_stage_decimation
+
+
+ _enabled
+ True
+
+
+ _coordinate
+ (296, 312)
+
+
+ _rotation
+ 0
+
+
+ id
+ freq_xlating_fir_filter_xxx_0
+
+
+ maxoutbuf
+ 0
+
+
+ minoutbuf
+ 0
+
+
+ samp_rate
+ samp_rate_rx
+
+
+ taps
+ first_stage_filter_taps
+
+
+ type
+ ccc
+
+
hilbert_fc
@@ -2138,7 +2274,7 @@ we shift the LO a little further
decim
- int(((samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation) / 2)
+ int((samp_rate_rx/ ( first_stage_decimation * int(samp_rate_rx/ first_stage_decimation / initial_bandwidth)) / audio_decimation)/2)
_enabled
@@ -2409,7 +2545,7 @@ we shift the LO a little further
sampling_rate
- samp_rate_rx
+ samp_rate_rx /first_stage_decimation
target_freq
@@ -2560,6 +2696,12 @@ we shift the LO a little further
0
0
+
+ freq_xlating_fir_filter_xxx_0
+ satnogs_coarse_doppler_correction_cc_0
+ 0
+ 0
+
hilbert_fc_0
blocks_complex_to_mag_0
@@ -2568,7 +2710,7 @@ we shift the LO a little further
osmosdr_source_0
- satnogs_coarse_doppler_correction_cc_0
+ freq_xlating_fir_filter_xxx_0
0
0
diff --git a/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py b/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py
index 0ae3f39..4d4d2f3 100755
--- a/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py
+++ b/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py
@@ -5,7 +5,7 @@
# Title: NOAA APT Decoder
# Author: Manolis Surligas, George Vardakis
# Description: A NOAA APT Decoder with automatic image synchronization
-# Generated: Tue Apr 11 00:15:28 2017
+# Generated: Fri Jun 23 15:41:33 2017
##################################################
from gnuradio import analog
@@ -23,28 +23,32 @@ import time
class satnogs_noaa_apt_decoder(gr.top_block):
- def __init__(self, doppler_correction_per_sec=1000, lo_offset=100e3, ppm=0, rigctl_port=4532, rx_freq=90.4e6, rx_sdr_device='usrpb200', image_file_path='/tmp/noaa.png'):
+ def __init__(self, doppler_correction_per_sec=1000, image_file_path='/tmp/noaa.png', lo_offset=100e3, ppm=0, rigctl_port=4532, rx_freq=90.4e6, rx_sdr_device='usrpb200'):
gr.top_block.__init__(self, "NOAA APT Decoder")
##################################################
# Parameters
##################################################
self.doppler_correction_per_sec = doppler_correction_per_sec
+ self.image_file_path = image_file_path
self.lo_offset = lo_offset
self.ppm = ppm
self.rigctl_port = rigctl_port
self.rx_freq = rx_freq
self.rx_sdr_device = rx_sdr_device
- self.image_file_path = image_file_path
##################################################
# Variables
##################################################
self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate']
- self.noaa_filter_taps = noaa_filter_taps = firdes.low_pass(1.0, 1.0, 0.17, 0.01, firdes.WIN_HAMMING, 6.76)
+ 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))
@@ -112,12 +118,19 @@ class satnogs_noaa_apt_decoder(gr.top_block):
def set_doppler_correction_per_sec(self, doppler_correction_per_sec):
self.doppler_correction_per_sec = doppler_correction_per_sec
+ def get_image_file_path(self):
+ return self.image_file_path
+
+ def set_image_file_path(self, image_file_path):
+ self.image_file_path = image_file_path
+
def get_lo_offset(self):
return self.lo_offset
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
@@ -151,12 +164,6 @@ class satnogs_noaa_apt_decoder(gr.top_block):
self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['bb_gain'], 0)
self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[self.rx_sdr_device]['antenna'], 0)
- def get_image_file_path(self):
- return self.image_file_path
-
- def set_image_file_path(self, image_file_path):
- self.image_file_path = image_file_path
-
def get_samp_rate_rx(self):
return self.samp_rate_rx
@@ -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():
@@ -194,6 +215,9 @@ def argument_parser():
parser.add_option(
"", "--doppler-correction-per-sec", dest="doppler_correction_per_sec", type="intx", default=1000,
help="Set doppler_correction_per_sec [default=%default]")
+ parser.add_option(
+ "", "--image-file-path", dest="image_file_path", type="string", default='/tmp/noaa.png',
+ help="Set image_file_path [default=%default]")
parser.add_option(
"", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3),
help="Set lo_offset [default=%default]")
@@ -209,9 +233,6 @@ def argument_parser():
parser.add_option(
"", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200',
help="Set rx_sdr_device [default=%default]")
- parser.add_option(
- "", "--image-file-path", dest="image_file_path", type="string", default='/tmp/noaa.png',
- help="Set image_file_path [default=%default]")
return parser
@@ -219,7 +240,7 @@ def main(top_block_cls=satnogs_noaa_apt_decoder, options=None):
if options is None:
options, _ = argument_parser().parse_args()
- tb = top_block_cls(doppler_correction_per_sec=options.doppler_correction_per_sec, lo_offset=options.lo_offset, ppm=options.ppm, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device, image_file_path=options.image_file_path)
+ tb = top_block_cls(doppler_correction_per_sec=options.doppler_correction_per_sec, image_file_path=options.image_file_path, lo_offset=options.lo_offset, ppm=options.ppm, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device)
tb.start()
tb.wait()