From a5d637bcba5cc34fef8a92117fb90704b7d229bd Mon Sep 17 00:00:00 2001 From: jens Date: Tue, 28 Jun 2022 18:44:48 +0200 Subject: [PATCH] - clean working copy for leaving SVN --- ask_tx.grc | 3360 ++++++++++++++++++++++++++++++++++++++++++++++ auto_tuner.grc | 2 +- decode_1800.grc | 2465 ++++++++++++++++++++++++++++++++++ epy_module_0.py | 1 + fm_mod_uhd.py | 258 ++++ pocsag_audio.grc | 8 + spur_tx.grc | 2132 +++-------------------------- top_block.py | 246 ++++ tx_playback.grc | 1372 +++++++++++++++++++ 9 files changed, 7905 insertions(+), 1939 deletions(-) create mode 100644 ask_tx.grc create mode 100644 decode_1800.grc create mode 100644 epy_module_0.py create mode 100755 fm_mod_uhd.py create mode 100755 top_block.py create mode 100644 tx_playback.grc diff --git a/ask_tx.grc b/ask_tx.grc new file mode 100644 index 0000000..3a9f225 --- /dev/null +++ b/ask_tx.grc @@ -0,0 +1,3360 @@ + + + + Thu Nov 29 20:53:48 2018 + + options + + author + + + + window_size + 1920,1200 + + + category + [GRC Hier Blocks] + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 20) + + + _rotation + 0 + + + generate_options + wx_gui + + + hier_block_src_path + .: + + + id + top_block + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + sizing_mode + fixed + + + thread_safe_setters + + + + title + + + + placement + (0,0) + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (496, 20) + + + _rotation + 0 + + + id + baud_rate + + + value + 4000 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (288, 20) + + + _rotation + 0 + + + id + dsp_rate + + + value + 48000 + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 433800000 + + + _enabled + True + + + _coordinate + (952, 44) + + + _rotation + 0 + + + grid_pos + + + + id + f_ctr + + + label + Coarse + + + max + 433900000 + + + min + 433700000 + + + notebook + + + + num_steps + 100 + + + style + wx.SL_HORIZONTAL + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 0 + + + _enabled + True + + + _coordinate + (824, 44) + + + _rotation + 0 + + + grid_pos + + + + id + f_fine + + + label + Fine + + + max + 1000e3 + + + min + -1000e3 + + + notebook + + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (424, 116) + + + _rotation + 0 + + + id + f_tune + + + value + f_ctr + offset_Hz + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (392, 20) + + + _rotation + 0 + + + id + offset_Hz + + + value + 235e3 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (176, 20) + + + _rotation + 0 + + + id + samp_rate + + + value + 2e6 + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 50 + + + _enabled + True + + + _coordinate + (648, 124) + + + _rotation + 0 + + + grid_pos + + + + id + tx_power + + + label + TX-Power + + + max + 80 + + + min + 0 + + + notebook + + + + num_steps + 80 + + + style + wx.SL_HORIZONTAL + + + + analog_const_source_x + + alias + + + + comment + + + + const + 0 + + + affinity + + + + _enabled + 1 + + + _coordinate + (200, 644) + + + _rotation + 0 + + + id + analog_const_source_x_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + float + + + + analog_sig_source_x + + amp + 0.5 + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + freq + offset_Hz + f_fine + + + _coordinate + (752, 348) + + + _rotation + 0 + + + id + analog_sig_source_x_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + offset + 0 + + + type + complex + + + samp_rate + samp_rate + + + waveform + analog.GR_COS_WAVE + + + + blocks_add_const_vxx + + alias + + + + comment + + + + const + -48 + + + affinity + + + + _enabled + True + + + _coordinate + (304, 484) + + + _rotation + 0 + + + id + blocks_add_const_vxx_0 + + + type + float + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_char_to_float + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (160, 548) + + + _rotation + 0 + + + id + blocks_char_to_float_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + scale + 1 + + + vlen + 1 + + + + blocks_file_source + + begin_tag + pmt.PMT_NIL + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + file + /home/jens/Schalter.bits.test.kurz.dat + + + _coordinate + (48, 396) + + + _rotation + 0 + + + id + blocks_file_source_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + byte + + + repeat + True + + + vlen + 1 + + + + blocks_magphase_to_complex + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (440, 544) + + + _rotation + 0 + + + id + blocks_magphase_to_complex_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_multiply_xx + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1016, 528) + + + _rotation + 0 + + + id + blocks_multiply_xx_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + num_inputs + 2 + + + vlen + 1 + + + + import + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (24, 148) + + + _rotation + 0 + + + id + import_0 + + + import + import numpy + + + + interp_fir_filter_xxx + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (512, 636) + + + _rotation + 0 + + + id + interp_fir_filter_xxx_0 + + + interp + int(samp_rate/baud_rate) + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_delay + 0 + + + taps + numpy.ones(int(samp_rate/baud_rate)) + + + type + ccf + + + + low_pass_filter + + beta + 6.76 + + + alias + + + + comment + + + + affinity + + + + cutoff_freq + 2*baud_rate + + + decim + 1 + + + _enabled + True + + + type + fir_filter_ccf + + + _coordinate + (768, 596) + + + _rotation + 0 + + + gain + 1 + + + id + low_pass_filter_0 + + + interp + 1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + samp_rate + + + width + baud_rate + + + win + firdes.WIN_HAMMING + + + + uhd_usrp_sink + + alias + + + + ant0 + TX/RX + + + bw0 + 0 + + + center_freq0 + f_ctr + + + norm_gain0 + False + + + gain0 + tx_power + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + norm_gain10 + False + + + gain10 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + norm_gain11 + False + + + gain11 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + norm_gain12 + False + + + gain12 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + norm_gain13 + False + + + gain13 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + norm_gain14 + False + + + gain14 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + norm_gain15 + False + + + gain15 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + norm_gain16 + False + + + gain16 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + norm_gain17 + False + + + gain17 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + norm_gain18 + False + + + gain18 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + norm_gain19 + False + + + gain19 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + norm_gain1 + False + + + gain1 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + norm_gain20 + False + + + gain20 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + norm_gain21 + False + + + gain21 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + norm_gain22 + False + + + gain22 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + norm_gain23 + False + + + gain23 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + norm_gain24 + False + + + gain24 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + norm_gain25 + False + + + gain25 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + norm_gain26 + False + + + gain26 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + norm_gain27 + False + + + gain27 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + norm_gain28 + False + + + gain28 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + norm_gain29 + False + + + gain29 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + norm_gain2 + False + + + gain2 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + norm_gain30 + False + + + gain30 + 0 + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + norm_gain31 + False + + + gain31 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + norm_gain3 + False + + + gain3 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + norm_gain4 + False + + + gain4 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + norm_gain5 + False + + + gain5 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + norm_gain6 + False + + + gain6 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + norm_gain7 + False + + + gain7 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + norm_gain8 + False + + + gain8 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + norm_gain9 + False + + + gain9 + 0 + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + True + + + _coordinate + (1184, 308) + + + _rotation + 0 + + + id + uhd_usrp_sink_0 + + + type + fc32 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + nchan + 1 + + + num_mboards + 1 + + + samp_rate + samp_rate + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + len_tag_name + + + + otw + + + + + uhd_usrp_source + + alias + + + + ant0 + RX2 + + + bw0 + 0 + + + center_freq0 + f_ctr + + + dc_offs_enb0 + True + + + iq_imbal_enb0 + True + + + norm_gain0 + False + + + gain0 + 30 + + + lo_export0 + False + + + lo_source0 + internal + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + dc_offs_enb10 + "" + + + iq_imbal_enb10 + "" + + + norm_gain10 + False + + + gain10 + 0 + + + lo_export10 + False + + + lo_source10 + internal + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + dc_offs_enb11 + "" + + + iq_imbal_enb11 + "" + + + norm_gain11 + False + + + gain11 + 0 + + + lo_export11 + False + + + lo_source11 + internal + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + dc_offs_enb12 + "" + + + iq_imbal_enb12 + "" + + + norm_gain12 + False + + + gain12 + 0 + + + lo_export12 + False + + + lo_source12 + internal + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + dc_offs_enb13 + "" + + + iq_imbal_enb13 + "" + + + norm_gain13 + False + + + gain13 + 0 + + + lo_export13 + False + + + lo_source13 + internal + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + dc_offs_enb14 + "" + + + iq_imbal_enb14 + "" + + + norm_gain14 + False + + + gain14 + 0 + + + lo_export14 + False + + + lo_source14 + internal + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + dc_offs_enb15 + "" + + + iq_imbal_enb15 + "" + + + norm_gain15 + False + + + gain15 + 0 + + + lo_export15 + False + + + lo_source15 + internal + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + dc_offs_enb16 + "" + + + iq_imbal_enb16 + "" + + + norm_gain16 + False + + + gain16 + 0 + + + lo_export16 + False + + + lo_source16 + internal + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + dc_offs_enb17 + "" + + + iq_imbal_enb17 + "" + + + norm_gain17 + False + + + gain17 + 0 + + + lo_export17 + False + + + lo_source17 + internal + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + dc_offs_enb18 + "" + + + iq_imbal_enb18 + "" + + + norm_gain18 + False + + + gain18 + 0 + + + lo_export18 + False + + + lo_source18 + internal + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + dc_offs_enb19 + "" + + + iq_imbal_enb19 + "" + + + norm_gain19 + False + + + gain19 + 0 + + + lo_export19 + False + + + lo_source19 + internal + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + dc_offs_enb1 + "" + + + iq_imbal_enb1 + "" + + + norm_gain1 + False + + + gain1 + 0 + + + lo_export1 + False + + + lo_source1 + internal + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + dc_offs_enb20 + "" + + + iq_imbal_enb20 + "" + + + norm_gain20 + False + + + gain20 + 0 + + + lo_export20 + False + + + lo_source20 + internal + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + dc_offs_enb21 + "" + + + iq_imbal_enb21 + "" + + + norm_gain21 + False + + + gain21 + 0 + + + lo_export21 + False + + + lo_source21 + internal + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + dc_offs_enb22 + "" + + + iq_imbal_enb22 + "" + + + norm_gain22 + False + + + gain22 + 0 + + + lo_export22 + False + + + lo_source22 + internal + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + dc_offs_enb23 + "" + + + iq_imbal_enb23 + "" + + + norm_gain23 + False + + + gain23 + 0 + + + lo_export23 + False + + + lo_source23 + internal + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + dc_offs_enb24 + "" + + + iq_imbal_enb24 + "" + + + norm_gain24 + False + + + gain24 + 0 + + + lo_export24 + False + + + lo_source24 + internal + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + dc_offs_enb25 + "" + + + iq_imbal_enb25 + "" + + + norm_gain25 + False + + + gain25 + 0 + + + lo_export25 + False + + + lo_source25 + internal + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + dc_offs_enb26 + "" + + + iq_imbal_enb26 + "" + + + norm_gain26 + False + + + gain26 + 0 + + + lo_export26 + False + + + lo_source26 + internal + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + dc_offs_enb27 + "" + + + iq_imbal_enb27 + "" + + + norm_gain27 + False + + + gain27 + 0 + + + lo_export27 + False + + + lo_source27 + internal + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + dc_offs_enb28 + "" + + + iq_imbal_enb28 + "" + + + norm_gain28 + False + + + gain28 + 0 + + + lo_export28 + False + + + lo_source28 + internal + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + dc_offs_enb29 + "" + + + iq_imbal_enb29 + "" + + + norm_gain29 + False + + + gain29 + 0 + + + lo_export29 + False + + + lo_source29 + internal + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + dc_offs_enb2 + "" + + + iq_imbal_enb2 + "" + + + norm_gain2 + False + + + gain2 + 0 + + + lo_export2 + False + + + lo_source2 + internal + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + dc_offs_enb30 + "" + + + iq_imbal_enb30 + "" + + + norm_gain30 + False + + + gain30 + 0 + + + lo_export30 + False + + + lo_source30 + internal + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + dc_offs_enb31 + "" + + + iq_imbal_enb31 + "" + + + norm_gain31 + False + + + gain31 + 0 + + + lo_export31 + False + + + lo_source31 + internal + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + dc_offs_enb3 + "" + + + iq_imbal_enb3 + "" + + + norm_gain3 + False + + + gain3 + 0 + + + lo_export3 + False + + + lo_source3 + internal + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + dc_offs_enb4 + "" + + + iq_imbal_enb4 + "" + + + norm_gain4 + False + + + gain4 + 0 + + + lo_export4 + False + + + lo_source4 + internal + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + dc_offs_enb5 + "" + + + iq_imbal_enb5 + "" + + + norm_gain5 + False + + + gain5 + 0 + + + lo_export5 + False + + + lo_source5 + internal + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + dc_offs_enb6 + "" + + + iq_imbal_enb6 + "" + + + norm_gain6 + False + + + gain6 + 0 + + + lo_export6 + False + + + lo_source6 + internal + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + dc_offs_enb7 + "" + + + iq_imbal_enb7 + "" + + + norm_gain7 + False + + + gain7 + 0 + + + lo_export7 + False + + + lo_source7 + internal + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + dc_offs_enb8 + "" + + + iq_imbal_enb8 + "" + + + norm_gain8 + False + + + gain8 + 0 + + + lo_export8 + False + + + lo_source8 + internal + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + dc_offs_enb9 + "" + + + iq_imbal_enb9 + "" + + + norm_gain9 + False + + + gain9 + 0 + + + lo_export9 + False + + + lo_source9 + internal + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + 1 + + + _coordinate + (104, 236) + + + _rotation + 0 + + + id + uhd_usrp_source_0 + + + maxoutbuf + 0 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + minoutbuf + 0 + + + nchan + 1 + + + num_mboards + 1 + + + type + fc32 + + + samp_rate + samp_rate + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + otw + + + + + wxgui_fftsink2 + + avg_alpha + 0.2 + + + average + True + + + baseband_freq + f_ctr + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (1184, 540) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_0 + + + notebook + + + + peak_hold + False + + + ref_level + -10 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + TX 1 + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0.2 + + + average + True + + + baseband_freq + f_ctr + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (392, 204) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_0_0 + + + notebook + + + + peak_hold + False + + + ref_level + -10 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + RX 1 + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + analog_const_source_x_0 + blocks_magphase_to_complex_0 + 0 + 1 + + + analog_sig_source_x_0 + blocks_multiply_xx_0 + 0 + 0 + + + blocks_add_const_vxx_0 + blocks_magphase_to_complex_0 + 0 + 0 + + + blocks_char_to_float_0 + blocks_add_const_vxx_0 + 0 + 0 + + + blocks_file_source_0 + blocks_char_to_float_0 + 0 + 0 + + + blocks_magphase_to_complex_0 + interp_fir_filter_xxx_0 + 0 + 0 + + + blocks_multiply_xx_0 + uhd_usrp_sink_0 + 0 + 0 + + + blocks_multiply_xx_0 + wxgui_fftsink2_0_0 + 0 + 0 + + + interp_fir_filter_xxx_0 + low_pass_filter_0 + 0 + 0 + + + low_pass_filter_0 + blocks_multiply_xx_0 + 0 + 1 + + + uhd_usrp_source_0 + wxgui_fftsink2_0_0_0 + 0 + 0 + + diff --git a/auto_tuner.grc b/auto_tuner.grc index aa98c46..5a26e34 100644 --- a/auto_tuner.grc +++ b/auto_tuner.grc @@ -3194,7 +3194,7 @@ dev - remote=tcp://192.168.1.100:55132,remote:driver=uhd + remote=tcp://192.168.1.125:55132,remote:driver=uhd _enabled diff --git a/decode_1800.grc b/decode_1800.grc new file mode 100644 index 0000000..7c7e61a --- /dev/null +++ b/decode_1800.grc @@ -0,0 +1,2465 @@ + + + + Thu Nov 29 20:53:48 2018 + + options + + author + + + + window_size + 1920,1200 + + + category + [GRC Hier Blocks] + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 20) + + + _rotation + 0 + + + generate_options + wx_gui + + + hier_block_src_path + .: + + + id + top_block + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + sizing_mode + fixed + + + thread_safe_setters + + + + title + + + + placement + (0,0) + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (496, 20) + + + _rotation + 0 + + + id + baud_rate + + + value + 3000 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (288, 20) + + + _rotation + 0 + + + id + dsp_rate + + + value + samp_rate/4 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (176, 100) + + + _rotation + 0 + + + id + f_tune + + + value + 1836e6 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (392, 20) + + + _rotation + 0 + + + id + offset_Hz + + + value + 535e3 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (176, 20) + + + _rotation + 0 + + + id + samp_rate + + + value + 4000000 + + + + variable_low_pass_filter_taps + + beta + 6.76 + + + comment + + + + cutoff_freq + 200e3 + + + _enabled + True + + + _coordinate + (136, 340) + + + _rotation + 0 + + + gain + 1.0 + + + id + variable_low_pass_filter_taps_0 + + + samp_rate + samp_rate + + + width + 50e3 + + + win + firdes.WIN_HAMMING + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 0 + + + _enabled + True + + + _coordinate + (328, 316) + + + _rotation + 0 + + + grid_pos + + + + id + variable_slider_0 + + + label + Freq Fine + + + max + +samp_rate/16 + + + min + -samp_rate/16 + + + notebook + + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 0 + + + _enabled + True + + + _coordinate + (464, 316) + + + _rotation + 0 + + + grid_pos + + + + id + variable_slider_1 + + + label + Freq Coarse + + + max + +samp_rate/2 + + + min + -samp_rate/2 + + + notebook + + + + num_steps + 1000 + + + style + wx.SL_HORIZONTAL + + + + analog_quadrature_demod_cf + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (744, 28) + + + _rotation + 0 + + + gain + 1 + + + id + analog_quadrature_demod_cf_0_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + baz_delay + + alias + + + + comment + + + + affinity + + + + delay + 1 + + + _enabled + 0 + + + _coordinate + (664, 588) + + + _rotation + 0 + + + id + baz_delay_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + num_ports + 1 + + + type + complex + + + vlen + 1 + + + + blocks_complex_to_mag + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (1040, 640) + + + _rotation + 0 + + + id + blocks_complex_to_mag_1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + blocks_conjugate_cc + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (664, 656) + + + _rotation + 0 + + + id + blocks_conjugate_cc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + blocks_multiply_xx + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (904, 624) + + + _rotation + 0 + + + id + blocks_multiply_xx_0_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + num_inputs + 2 + + + vlen + 1 + + + + freq_xlating_fir_filter_xxx + + alias + + + + center_freq + variable_slider_0 + variable_slider_1 + + + comment + + + + affinity + + + + decim + int(samp_rate/dsp_rate) + + + _enabled + True + + + _coordinate + (336, 204) + + + _rotation + 0 + + + id + freq_xlating_fir_filter_xxx_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + samp_rate + + + taps + variable_low_pass_filter_taps_0 + + + type + ccc + + + + uhd_usrp_source + + alias + + + + ant0 + TX/RX + + + bw0 + 0 + + + center_freq0 + f_tune + + + dc_offs_enb0 + True + + + iq_imbal_enb0 + True + + + norm_gain0 + False + + + gain0 + 40 + + + lo_export0 + False + + + lo_source0 + internal + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + dc_offs_enb10 + "" + + + iq_imbal_enb10 + "" + + + norm_gain10 + False + + + gain10 + 0 + + + lo_export10 + False + + + lo_source10 + internal + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + dc_offs_enb11 + "" + + + iq_imbal_enb11 + "" + + + norm_gain11 + False + + + gain11 + 0 + + + lo_export11 + False + + + lo_source11 + internal + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + dc_offs_enb12 + "" + + + iq_imbal_enb12 + "" + + + norm_gain12 + False + + + gain12 + 0 + + + lo_export12 + False + + + lo_source12 + internal + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + dc_offs_enb13 + "" + + + iq_imbal_enb13 + "" + + + norm_gain13 + False + + + gain13 + 0 + + + lo_export13 + False + + + lo_source13 + internal + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + dc_offs_enb14 + "" + + + iq_imbal_enb14 + "" + + + norm_gain14 + False + + + gain14 + 0 + + + lo_export14 + False + + + lo_source14 + internal + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + dc_offs_enb15 + "" + + + iq_imbal_enb15 + "" + + + norm_gain15 + False + + + gain15 + 0 + + + lo_export15 + False + + + lo_source15 + internal + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + dc_offs_enb16 + "" + + + iq_imbal_enb16 + "" + + + norm_gain16 + False + + + gain16 + 0 + + + lo_export16 + False + + + lo_source16 + internal + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + dc_offs_enb17 + "" + + + iq_imbal_enb17 + "" + + + norm_gain17 + False + + + gain17 + 0 + + + lo_export17 + False + + + lo_source17 + internal + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + dc_offs_enb18 + "" + + + iq_imbal_enb18 + "" + + + norm_gain18 + False + + + gain18 + 0 + + + lo_export18 + False + + + lo_source18 + internal + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + dc_offs_enb19 + "" + + + iq_imbal_enb19 + "" + + + norm_gain19 + False + + + gain19 + 0 + + + lo_export19 + False + + + lo_source19 + internal + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + dc_offs_enb1 + "" + + + iq_imbal_enb1 + "" + + + norm_gain1 + False + + + gain1 + 0 + + + lo_export1 + False + + + lo_source1 + internal + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + dc_offs_enb20 + "" + + + iq_imbal_enb20 + "" + + + norm_gain20 + False + + + gain20 + 0 + + + lo_export20 + False + + + lo_source20 + internal + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + dc_offs_enb21 + "" + + + iq_imbal_enb21 + "" + + + norm_gain21 + False + + + gain21 + 0 + + + lo_export21 + False + + + lo_source21 + internal + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + dc_offs_enb22 + "" + + + iq_imbal_enb22 + "" + + + norm_gain22 + False + + + gain22 + 0 + + + lo_export22 + False + + + lo_source22 + internal + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + dc_offs_enb23 + "" + + + iq_imbal_enb23 + "" + + + norm_gain23 + False + + + gain23 + 0 + + + lo_export23 + False + + + lo_source23 + internal + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + dc_offs_enb24 + "" + + + iq_imbal_enb24 + "" + + + norm_gain24 + False + + + gain24 + 0 + + + lo_export24 + False + + + lo_source24 + internal + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + dc_offs_enb25 + "" + + + iq_imbal_enb25 + "" + + + norm_gain25 + False + + + gain25 + 0 + + + lo_export25 + False + + + lo_source25 + internal + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + dc_offs_enb26 + "" + + + iq_imbal_enb26 + "" + + + norm_gain26 + False + + + gain26 + 0 + + + lo_export26 + False + + + lo_source26 + internal + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + dc_offs_enb27 + "" + + + iq_imbal_enb27 + "" + + + norm_gain27 + False + + + gain27 + 0 + + + lo_export27 + False + + + lo_source27 + internal + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + dc_offs_enb28 + "" + + + iq_imbal_enb28 + "" + + + norm_gain28 + False + + + gain28 + 0 + + + lo_export28 + False + + + lo_source28 + internal + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + dc_offs_enb29 + "" + + + iq_imbal_enb29 + "" + + + norm_gain29 + False + + + gain29 + 0 + + + lo_export29 + False + + + lo_source29 + internal + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + dc_offs_enb2 + "" + + + iq_imbal_enb2 + "" + + + norm_gain2 + False + + + gain2 + 0 + + + lo_export2 + False + + + lo_source2 + internal + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + dc_offs_enb30 + "" + + + iq_imbal_enb30 + "" + + + norm_gain30 + False + + + gain30 + 0 + + + lo_export30 + False + + + lo_source30 + internal + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + dc_offs_enb31 + "" + + + iq_imbal_enb31 + "" + + + norm_gain31 + False + + + gain31 + 0 + + + lo_export31 + False + + + lo_source31 + internal + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + dc_offs_enb3 + "" + + + iq_imbal_enb3 + "" + + + norm_gain3 + False + + + gain3 + 0 + + + lo_export3 + False + + + lo_source3 + internal + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + dc_offs_enb4 + "" + + + iq_imbal_enb4 + "" + + + norm_gain4 + False + + + gain4 + 0 + + + lo_export4 + False + + + lo_source4 + internal + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + dc_offs_enb5 + "" + + + iq_imbal_enb5 + "" + + + norm_gain5 + False + + + gain5 + 0 + + + lo_export5 + False + + + lo_source5 + internal + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + dc_offs_enb6 + "" + + + iq_imbal_enb6 + "" + + + norm_gain6 + False + + + gain6 + 0 + + + lo_export6 + False + + + lo_source6 + internal + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + dc_offs_enb7 + "" + + + iq_imbal_enb7 + "" + + + norm_gain7 + False + + + gain7 + 0 + + + lo_export7 + False + + + lo_source7 + internal + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + dc_offs_enb8 + "" + + + iq_imbal_enb8 + "" + + + norm_gain8 + False + + + gain8 + 0 + + + lo_export8 + False + + + lo_source8 + internal + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + dc_offs_enb9 + "" + + + iq_imbal_enb9 + "" + + + norm_gain9 + False + + + gain9 + 0 + + + lo_export9 + False + + + lo_source9 + internal + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + 1 + + + _coordinate + (80, 188) + + + _rotation + 0 + + + id + uhd_usrp_source_0 + + + maxoutbuf + 0 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + minoutbuf + 0 + + + nchan + 1 + + + num_mboards + 1 + + + type + fc32 + + + samp_rate + samp_rate + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + otw + + + + + wxgui_fftsink2 + + avg_alpha + 0.2 + + + average + True + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (888, 108) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0 + + + notebook + + + + peak_hold + False + + + ref_level + -10 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + dsp_rate + + + title + TX 2 + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0.2 + + + average + True + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (664, 76) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_0 + + + notebook + + + + peak_hold + False + + + ref_level + -10 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + dsp_rate + + + title + TX 1 + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_fftsink2 + + avg_alpha + 0.2 + + + average + True + + + baseband_freq + 0 + + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (1232, 556) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0_1 + + + notebook + + + + peak_hold + False + + + ref_level + -10 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + dsp_rate + + + title + Baudrate + + + type + float + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + wxgui_scopesink2 + + ac_couple + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (1128, 12) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_scopesink2_0 + + + notebook + + + + num_inputs + 1 + + + samp_rate + dsp_rate + + + t_scale + 0 + + + title + Scope Plot + + + trig_mode + wxgui.TRIG_MODE_AUTO + + + type + float + + + v_offset + 0 + + + v_scale + 0 + + + win_size + + + + xy_mode + False + + + y_axis_label + Counts + + + + analog_quadrature_demod_cf_0_0 + wxgui_scopesink2_0 + 0 + 0 + + + baz_delay_0 + blocks_conjugate_cc_0 + 0 + 0 + + + blocks_complex_to_mag_1 + wxgui_fftsink2_0_1 + 0 + 0 + + + blocks_conjugate_cc_0 + blocks_multiply_xx_0_0 + 0 + 1 + + + blocks_multiply_xx_0_0 + blocks_complex_to_mag_1 + 0 + 0 + + + freq_xlating_fir_filter_xxx_0 + analog_quadrature_demod_cf_0_0 + 0 + 0 + + + freq_xlating_fir_filter_xxx_0 + wxgui_fftsink2_0_0 + 0 + 0 + + + uhd_usrp_source_0 + freq_xlating_fir_filter_xxx_0 + 0 + 0 + + diff --git a/epy_module_0.py b/epy_module_0.py new file mode 100644 index 0000000..8816ea0 --- /dev/null +++ b/epy_module_0.py @@ -0,0 +1 @@ +# this module will be imported in the into your flowgraph \ No newline at end of file diff --git a/fm_mod_uhd.py b/fm_mod_uhd.py new file mode 100755 index 0000000..311252b --- /dev/null +++ b/fm_mod_uhd.py @@ -0,0 +1,258 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: UHD Wide-band FM Modulator +# Author: Example +# Description: Loopback test +# Generated: Sat Jul 13 12:16:01 2019 +################################################## + +from distutils.version import StrictVersion + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print "Warning: failed to XInitThreads()" + +from PyQt5 import Qt, QtCore +from gnuradio import analog +from gnuradio import blocks +from gnuradio import eng_notation +from gnuradio import gr +from gnuradio import uhd +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from gnuradio.qtgui import Range, RangeWidget +from optparse import OptionParser +import sys +import time +from gnuradio import qtgui + + +class fm_mod_uhd(gr.top_block, Qt.QWidget): + + def __init__(self, audio_rate=50000, freq=2.45e9, freq_offset=0, samp_rate=500e3): + gr.top_block.__init__(self, "UHD Wide-band FM Modulator") + Qt.QWidget.__init__(self) + self.setWindowTitle("UHD Wide-band FM Modulator") + qtgui.util.check_set_qss() + try: + self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc')) + except: + pass + self.top_scroll_layout = Qt.QVBoxLayout() + self.setLayout(self.top_scroll_layout) + self.top_scroll = Qt.QScrollArea() + self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame) + self.top_scroll_layout.addWidget(self.top_scroll) + self.top_scroll.setWidgetResizable(True) + self.top_widget = Qt.QWidget() + self.top_scroll.setWidget(self.top_widget) + self.top_layout = Qt.QVBoxLayout(self.top_widget) + self.top_grid_layout = Qt.QGridLayout() + self.top_layout.addLayout(self.top_grid_layout) + + self.settings = Qt.QSettings("GNU Radio", "fm_mod_uhd") + self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray)) + + + ################################################## + # Parameters + ################################################## + self.audio_rate = audio_rate + self.freq = freq + self.freq_offset = freq_offset + self.samp_rate = samp_rate + + ################################################## + # Variables + ################################################## + self.tun_tx_gain = tun_tx_gain = 20 + self.tun_freq = tun_freq = 105.4e6 + self.tone_ampl = tone_ampl = 0.15 + self.tone2 = tone2 = 220 + self.tone1 = tone1 = 440 + + ################################################## + # Blocks + ################################################## + self._tun_tx_gain_range = Range(0, 40, 1, 20, 200) + self._tun_tx_gain_win = RangeWidget(self._tun_tx_gain_range, self.set_tun_tx_gain, 'UHD Tx Gain', "counter_slider", float) + self.top_grid_layout.addWidget(self._tun_tx_gain_win, 4, 0, 1, 2) + for r in range(4, 5): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self._tun_freq_range = Range(88.5e6, 108e6, 0.5e6, 105.4e6, 200) + self._tun_freq_win = RangeWidget(self._tun_freq_range, self.set_tun_freq, 'UHD Freq (Hz)', "counter_slider", float) + self.top_grid_layout.addWidget(self._tun_freq_win, 3, 0, 1, 4) + for r in range(3, 4): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self._tone_ampl_range = Range(0, 1, .001, 0.15, 200) + self._tone_ampl_win = RangeWidget(self._tone_ampl_range, self.set_tone_ampl, 'Tone Amplitude', "counter_slider", float) + self.top_grid_layout.addWidget(self._tone_ampl_win, 1, 2, 1, 2) + for r in range(1, 2): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self._tone2_range = Range(0, 880, 1, 220, 200) + self._tone2_win = RangeWidget(self._tone2_range, self.set_tone2, 'Tone 2', "counter_slider", float) + self.top_grid_layout.addWidget(self._tone2_win, 0, 2, 1, 2) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(2, 4): + self.top_grid_layout.setColumnStretch(c, 1) + self._tone1_range = Range(0, 880, 1, 440, 200) + self._tone1_win = RangeWidget(self._tone1_range, self.set_tone1, 'Tone 1', "counter_slider", float) + self.top_grid_layout.addWidget(self._tone1_win, 0, 0, 1, 2) + for r in range(0, 1): + self.top_grid_layout.setRowStretch(r, 1) + for c in range(0, 2): + self.top_grid_layout.setColumnStretch(c, 1) + self.uhd_usrp_sink_0 = uhd.usrp_sink( + ",".join(("", "")), + uhd.stream_args( + cpu_format="fc32", + channels=range(1), + ), + ) + self.uhd_usrp_sink_0.set_samp_rate(samp_rate) + self.uhd_usrp_sink_0.set_center_freq(tun_freq, 0) + self.uhd_usrp_sink_0.set_gain(tun_tx_gain, 0) + self.uhd_usrp_sink_0.set_antenna('TX/RX', 0) + self.blocks_add_xx = blocks.add_vff(1) + self.analog_wfm_tx_0 = analog.wfm_tx( + audio_rate=audio_rate, + quad_rate=int(samp_rate), + tau=75e-6, + max_dev=75e3, + fh=-1.0, + ) + self.analog_sig_source_x_1 = analog.sig_source_f(audio_rate, analog.GR_COS_WAVE, tone2, tone_ampl, 0) + self.analog_sig_source_x_0 = analog.sig_source_f(audio_rate, analog.GR_COS_WAVE, tone1, tone_ampl, 0) + + + + ################################################## + # Connections + ################################################## + self.connect((self.analog_sig_source_x_0, 0), (self.blocks_add_xx, 0)) + self.connect((self.analog_sig_source_x_1, 0), (self.blocks_add_xx, 1)) + self.connect((self.analog_wfm_tx_0, 0), (self.uhd_usrp_sink_0, 0)) + self.connect((self.blocks_add_xx, 0), (self.analog_wfm_tx_0, 0)) + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "fm_mod_uhd") + self.settings.setValue("geometry", self.saveGeometry()) + event.accept() + + def get_audio_rate(self): + return self.audio_rate + + def set_audio_rate(self, audio_rate): + self.audio_rate = audio_rate + self.analog_sig_source_x_1.set_sampling_freq(self.audio_rate) + self.analog_sig_source_x_0.set_sampling_freq(self.audio_rate) + + def get_freq(self): + return self.freq + + def set_freq(self, freq): + self.freq = freq + + def get_freq_offset(self): + return self.freq_offset + + def set_freq_offset(self, freq_offset): + self.freq_offset = freq_offset + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate) + + def get_tun_tx_gain(self): + return self.tun_tx_gain + + def set_tun_tx_gain(self, tun_tx_gain): + self.tun_tx_gain = tun_tx_gain + self.uhd_usrp_sink_0.set_gain(self.tun_tx_gain, 0) + + + def get_tun_freq(self): + return self.tun_freq + + def set_tun_freq(self, tun_freq): + self.tun_freq = tun_freq + self.uhd_usrp_sink_0.set_center_freq(self.tun_freq, 0) + + def get_tone_ampl(self): + return self.tone_ampl + + def set_tone_ampl(self, tone_ampl): + self.tone_ampl = tone_ampl + self.analog_sig_source_x_1.set_amplitude(self.tone_ampl) + self.analog_sig_source_x_0.set_amplitude(self.tone_ampl) + + def get_tone2(self): + return self.tone2 + + def set_tone2(self, tone2): + self.tone2 = tone2 + self.analog_sig_source_x_1.set_frequency(self.tone2) + + def get_tone1(self): + return self.tone1 + + def set_tone1(self, tone1): + self.tone1 = tone1 + self.analog_sig_source_x_0.set_frequency(self.tone1) + + +def argument_parser(): + description = 'Loopback test' + parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) + parser.add_option( + "", "--audio-rate", dest="audio_rate", type="intx", default=50000, + help="Set Audio Rate [default=%default]") + parser.add_option( + "-f", "--freq", dest="freq", type="eng_float", default=eng_notation.num_to_str(2.45e9), + help="Set Default Frequency [default=%default]") + parser.add_option( + "-o", "--freq-offset", dest="freq_offset", type="eng_float", default=eng_notation.num_to_str(0), + help="Set Rx Frequency Offset [default=%default]") + parser.add_option( + "", "--samp-rate", dest="samp_rate", type="eng_float", default=eng_notation.num_to_str(500e3), + help="Set Sample Rate [default=%default]") + return parser + + +def main(top_block_cls=fm_mod_uhd, options=None): + if options is None: + options, _ = argument_parser().parse_args() + + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls(audio_rate=options.audio_rate, freq=options.freq, freq_offset=options.freq_offset, samp_rate=options.samp_rate) + tb.start() + tb.show() + + def quitting(): + tb.stop() + tb.wait() + qapp.aboutToQuit.connect(quitting) + qapp.exec_() + + +if __name__ == '__main__': + main() diff --git a/pocsag_audio.grc b/pocsag_audio.grc index 436a659..cf75461 100644 --- a/pocsag_audio.grc +++ b/pocsag_audio.grc @@ -341,6 +341,10 @@ _rotation 0 + + numGapBits + 10 + id jay_bit_slicer_0 @@ -357,6 +361,10 @@ minoutbuf 0 + + doPrintPackets + 1 + sampleRate audio_rate diff --git a/spur_tx.grc b/spur_tx.grc index 634f02c..917fe05 100644 --- a/spur_tx.grc +++ b/spur_tx.grc @@ -525,14 +525,30 @@ - uhd_usrp_sink + soapy_sink + + args + + alias + + amp_gain0 + 0 + ant0 - TX/RX + + + + dc_offset_auto_mode0 + False + + + gain_auto_mode0 + False bw0 @@ -543,217 +559,57 @@ f_tune - norm_gain0 - True - - - gain0 - power_tx_dB - - - ant10 - - - - bw10 + dc_offset0 0 - center_freq10 + correction0 0 - norm_gain10 + fine_tune0 False - gain10 + overall_gain0 + power_tx_dB*40 + + + iamp_gain0 0 - ant11 - - - - bw11 + balance0 0 - center_freq11 + nco_freq0 0 - norm_gain11 - False - - - gain11 + pad_gain0 0 - ant12 - - - - bw12 + pga_gain0 0 - center_freq12 - 0 - - - norm_gain12 - False - - - gain12 - 0 - - - ant13 - - - - bw13 - 0 - - - center_freq13 - 0 - - - norm_gain13 - False - - - gain13 - 0 - - - ant14 - - - - bw14 - 0 - - - center_freq14 - 0 - - - norm_gain14 - False - - - gain14 - 0 - - - ant15 - - - - bw15 - 0 - - - center_freq15 - 0 - - - norm_gain15 - False - - - gain15 - 0 - - - ant16 - - - - bw16 - 0 - - - center_freq16 - 0 - - - norm_gain16 - False - - - gain16 - 0 - - - ant17 - - - - bw17 - 0 - - - center_freq17 - 0 - - - norm_gain17 - False - - - gain17 - 0 - - - ant18 - - - - bw18 - 0 - - - center_freq18 - 0 - - - norm_gain18 - False - - - gain18 - 0 - - - ant19 - - - - bw19 - 0 - - - center_freq19 - 0 - - - norm_gain19 - False - - - gain19 + vga_gain0 0 ant1 + + dc_offset_auto_mode1 + False + + + gain_auto_mode1 + False + bw1 0 @@ -763,417 +619,45 @@ 0 - norm_gain1 - False - - - gain1 + dc_offset1 0 - ant20 + correction1 + 0 + + + fine_tune1 + False + + + overall_gain1 + 0 + + + iamp_gain1 + 0 + + + balance1 + 0 + + + nco_freq1 + 0 + + + pad_gain1 + 0 + + + pga_gain1 + 0 + + + clock_source - - bw20 - 0 - - - center_freq20 - 0 - - - norm_gain20 - False - - - gain20 - 0 - - - ant21 - - - - bw21 - 0 - - - center_freq21 - 0 - - - norm_gain21 - False - - - gain21 - 0 - - - ant22 - - - - bw22 - 0 - - - center_freq22 - 0 - - - norm_gain22 - False - - - gain22 - 0 - - - ant23 - - - - bw23 - 0 - - - center_freq23 - 0 - - - norm_gain23 - False - - - gain23 - 0 - - - ant24 - - - - bw24 - 0 - - - center_freq24 - 0 - - - norm_gain24 - False - - - gain24 - 0 - - - ant25 - - - - bw25 - 0 - - - center_freq25 - 0 - - - norm_gain25 - False - - - gain25 - 0 - - - ant26 - - - - bw26 - 0 - - - center_freq26 - 0 - - - norm_gain26 - False - - - gain26 - 0 - - - ant27 - - - - bw27 - 0 - - - center_freq27 - 0 - - - norm_gain27 - False - - - gain27 - 0 - - - ant28 - - - - bw28 - 0 - - - center_freq28 - 0 - - - norm_gain28 - False - - - gain28 - 0 - - - ant29 - - - - bw29 - 0 - - - center_freq29 - 0 - - - norm_gain29 - False - - - gain29 - 0 - - - ant2 - - - - bw2 - 0 - - - center_freq2 - 0 - - - norm_gain2 - False - - - gain2 - 0 - - - ant30 - - - - bw30 - 0 - - - center_freq30 - 0 - - - norm_gain30 - False - - - gain30 - 0 - - - ant31 - - - - bw31 - 0 - - - center_freq31 - 0 - - - norm_gain31 - False - - - gain31 - 0 - - - ant3 - - - - bw3 - 0 - - - center_freq3 - 0 - - - norm_gain3 - False - - - gain3 - 0 - - - ant4 - - - - bw4 - 0 - - - center_freq4 - 0 - - - norm_gain4 - False - - - gain4 - 0 - - - ant5 - - - - bw5 - 0 - - - center_freq5 - 0 - - - norm_gain5 - False - - - gain5 - 0 - - - ant6 - - - - bw6 - 0 - - - center_freq6 - 0 - - - norm_gain6 - False - - - gain6 - 0 - - - ant7 - - - - bw7 - 0 - - - center_freq7 - 0 - - - norm_gain7 - False - - - gain7 - 0 - - - ant8 - - - - bw8 - 0 - - - center_freq8 - 0 - - - norm_gain8 - False - - - gain8 - 0 - - - ant9 - - - - bw9 - 0 - - - center_freq9 - 0 - - - norm_gain9 - False - - - gain9 - 0 - - - clock_rate - 0.0 - comment @@ -1183,12 +667,8 @@ - dev_addr - "" - - - dev_args - "" + dev + "driver=remote,remote=moon,remote:driver=uhd" _enabled @@ -1196,7 +676,7 @@ _coordinate - (544, 228) + (520, 252) _rotation @@ -1204,159 +684,63 @@ id - uhd_usrp_sink_0 + soapy_sink_0 type fc32 - clock_source0 + length_tag_name - sd_spec0 - - - - time_source0 - - - - clock_source1 - - - - sd_spec1 - - - - time_source1 - - - - clock_source2 - - - - sd_spec2 - - - - time_source2 - - - - clock_source3 - - - - sd_spec3 - - - - time_source3 - - - - clock_source4 - - - - sd_spec4 - - - - time_source4 - - - - clock_source5 - - - - sd_spec5 - - - - time_source5 - - - - clock_source6 - - - - sd_spec6 - - - - time_source6 - - - - clock_source7 - - - - sd_spec7 - - - - time_source7 - + clock_rate + 0 nchan 1 - - num_mboards - 1 - samp_rate samp_rate - - hide_cmd_port - False - - - hide_lo_controls - True - - - stream_args - - - - stream_chans - [] - - - sync - - - - len_tag_name - - - - otw - - - uhd_usrp_source + soapy_source + + sdrplay_agc_setpoint + -30 + + + args + + + + sdrplay_biastee + true + alias + + amp_gain0 + 0 + ant0 RX2 + + dc_offset_auto_mode0 + False + + + gain_auto_mode0 + False + bw0 0 @@ -1366,393 +750,73 @@ rx_ftune - dc_offs_enb0 - True + dc_offset0 + 0 - iq_imbal_enb0 - True + correction0 + 0 - norm_gain0 + fine_tune0 False - gain0 + overall_gain0 50 - lo_export0 - False + ifgr_gain + 59 - lo_source0 - internal - - - ant10 - - - - bw10 + balance0 0 - center_freq10 + lna_gain0 0 - dc_offs_enb10 - "" - - - iq_imbal_enb10 - "" - - - norm_gain10 - False - - - gain10 + mix_gain0 0 - lo_export10 - False - - - lo_source10 - internal - - - ant11 - - - - bw11 + nco_freq0 0 - center_freq11 + pga_gain0 0 - dc_offs_enb11 - "" + rfgr_gain + 9 - iq_imbal_enb11 - "" - - - norm_gain11 - False - - - gain11 + tia_gain0 0 - lo_export11 - False - - - lo_source11 - internal - - - ant12 - - - - bw12 + tuner_gain0 0 - center_freq12 + vga_gain0 0 - - dc_offs_enb12 - "" - - - iq_imbal_enb12 - "" - - - norm_gain12 - False - - - gain12 - 0 - - - lo_export12 - False - - - lo_source12 - internal - - - ant13 - - - - bw13 - 0 - - - center_freq13 - 0 - - - dc_offs_enb13 - "" - - - iq_imbal_enb13 - "" - - - norm_gain13 - False - - - gain13 - 0 - - - lo_export13 - False - - - lo_source13 - internal - - - ant14 - - - - bw14 - 0 - - - center_freq14 - 0 - - - dc_offs_enb14 - "" - - - iq_imbal_enb14 - "" - - - norm_gain14 - False - - - gain14 - 0 - - - lo_export14 - False - - - lo_source14 - internal - - - ant15 - - - - bw15 - 0 - - - center_freq15 - 0 - - - dc_offs_enb15 - "" - - - iq_imbal_enb15 - "" - - - norm_gain15 - False - - - gain15 - 0 - - - lo_export15 - False - - - lo_source15 - internal - - - ant16 - - - - bw16 - 0 - - - center_freq16 - 0 - - - dc_offs_enb16 - "" - - - iq_imbal_enb16 - "" - - - norm_gain16 - False - - - gain16 - 0 - - - lo_export16 - False - - - lo_source16 - internal - - - ant17 - - - - bw17 - 0 - - - center_freq17 - 0 - - - dc_offs_enb17 - "" - - - iq_imbal_enb17 - "" - - - norm_gain17 - False - - - gain17 - 0 - - - lo_export17 - False - - - lo_source17 - internal - - - ant18 - - - - bw18 - 0 - - - center_freq18 - 0 - - - dc_offs_enb18 - "" - - - iq_imbal_enb18 - "" - - - norm_gain18 - False - - - gain18 - 0 - - - lo_export18 - False - - - lo_source18 - internal - - - ant19 - - - - bw19 - 0 - - - center_freq19 - 0 - - - dc_offs_enb19 - "" - - - iq_imbal_enb19 - "" - - - norm_gain19 - False - - - gain19 - 0 - - - lo_export19 - False - - - lo_source19 - internal - ant1 + + dc_offset_auto_mode1 + False + + + gain_auto_mode1 + False + bw1 0 @@ -1762,753 +826,57 @@ 0 - dc_offs_enb1 - "" - - - iq_imbal_enb1 - "" - - - norm_gain1 - False - - - gain1 + dc_offset1 0 - lo_export1 + correction1 + 0 + + + fine_tune1 False - lo_source1 - internal + overall_gain1 + 0 - ant20 + tia_gain1 + 0 + + + balance1 + 0 + + + lna_gain1 + 0 + + + mix_gain1 + 0 + + + nco_freq1 + 0 + + + pga_gain1 + 0 + + + tuner_gain1 + 0 + + + vga_gain1 + 0 + + + clock_source - - bw20 - 0 - - - center_freq20 - 0 - - - dc_offs_enb20 - "" - - - iq_imbal_enb20 - "" - - - norm_gain20 - False - - - gain20 - 0 - - - lo_export20 - False - - - lo_source20 - internal - - - ant21 - - - - bw21 - 0 - - - center_freq21 - 0 - - - dc_offs_enb21 - "" - - - iq_imbal_enb21 - "" - - - norm_gain21 - False - - - gain21 - 0 - - - lo_export21 - False - - - lo_source21 - internal - - - ant22 - - - - bw22 - 0 - - - center_freq22 - 0 - - - dc_offs_enb22 - "" - - - iq_imbal_enb22 - "" - - - norm_gain22 - False - - - gain22 - 0 - - - lo_export22 - False - - - lo_source22 - internal - - - ant23 - - - - bw23 - 0 - - - center_freq23 - 0 - - - dc_offs_enb23 - "" - - - iq_imbal_enb23 - "" - - - norm_gain23 - False - - - gain23 - 0 - - - lo_export23 - False - - - lo_source23 - internal - - - ant24 - - - - bw24 - 0 - - - center_freq24 - 0 - - - dc_offs_enb24 - "" - - - iq_imbal_enb24 - "" - - - norm_gain24 - False - - - gain24 - 0 - - - lo_export24 - False - - - lo_source24 - internal - - - ant25 - - - - bw25 - 0 - - - center_freq25 - 0 - - - dc_offs_enb25 - "" - - - iq_imbal_enb25 - "" - - - norm_gain25 - False - - - gain25 - 0 - - - lo_export25 - False - - - lo_source25 - internal - - - ant26 - - - - bw26 - 0 - - - center_freq26 - 0 - - - dc_offs_enb26 - "" - - - iq_imbal_enb26 - "" - - - norm_gain26 - False - - - gain26 - 0 - - - lo_export26 - False - - - lo_source26 - internal - - - ant27 - - - - bw27 - 0 - - - center_freq27 - 0 - - - dc_offs_enb27 - "" - - - iq_imbal_enb27 - "" - - - norm_gain27 - False - - - gain27 - 0 - - - lo_export27 - False - - - lo_source27 - internal - - - ant28 - - - - bw28 - 0 - - - center_freq28 - 0 - - - dc_offs_enb28 - "" - - - iq_imbal_enb28 - "" - - - norm_gain28 - False - - - gain28 - 0 - - - lo_export28 - False - - - lo_source28 - internal - - - ant29 - - - - bw29 - 0 - - - center_freq29 - 0 - - - dc_offs_enb29 - "" - - - iq_imbal_enb29 - "" - - - norm_gain29 - False - - - gain29 - 0 - - - lo_export29 - False - - - lo_source29 - internal - - - ant2 - - - - bw2 - 0 - - - center_freq2 - 0 - - - dc_offs_enb2 - "" - - - iq_imbal_enb2 - "" - - - norm_gain2 - False - - - gain2 - 0 - - - lo_export2 - False - - - lo_source2 - internal - - - ant30 - - - - bw30 - 0 - - - center_freq30 - 0 - - - dc_offs_enb30 - "" - - - iq_imbal_enb30 - "" - - - norm_gain30 - False - - - gain30 - 0 - - - lo_export30 - False - - - lo_source30 - internal - - - ant31 - - - - bw31 - 0 - - - center_freq31 - 0 - - - dc_offs_enb31 - "" - - - iq_imbal_enb31 - "" - - - norm_gain31 - False - - - gain31 - 0 - - - lo_export31 - False - - - lo_source31 - internal - - - ant3 - - - - bw3 - 0 - - - center_freq3 - 0 - - - dc_offs_enb3 - "" - - - iq_imbal_enb3 - "" - - - norm_gain3 - False - - - gain3 - 0 - - - lo_export3 - False - - - lo_source3 - internal - - - ant4 - - - - bw4 - 0 - - - center_freq4 - 0 - - - dc_offs_enb4 - "" - - - iq_imbal_enb4 - "" - - - norm_gain4 - False - - - gain4 - 0 - - - lo_export4 - False - - - lo_source4 - internal - - - ant5 - - - - bw5 - 0 - - - center_freq5 - 0 - - - dc_offs_enb5 - "" - - - iq_imbal_enb5 - "" - - - norm_gain5 - False - - - gain5 - 0 - - - lo_export5 - False - - - lo_source5 - internal - - - ant6 - - - - bw6 - 0 - - - center_freq6 - 0 - - - dc_offs_enb6 - "" - - - iq_imbal_enb6 - "" - - - norm_gain6 - False - - - gain6 - 0 - - - lo_export6 - False - - - lo_source6 - internal - - - ant7 - - - - bw7 - 0 - - - center_freq7 - 0 - - - dc_offs_enb7 - "" - - - iq_imbal_enb7 - "" - - - norm_gain7 - False - - - gain7 - 0 - - - lo_export7 - False - - - lo_source7 - internal - - - ant8 - - - - bw8 - 0 - - - center_freq8 - 0 - - - dc_offs_enb8 - "" - - - iq_imbal_enb8 - "" - - - norm_gain8 - False - - - gain8 - 0 - - - lo_export8 - False - - - lo_source8 - internal - - - ant9 - - - - bw9 - 0 - - - center_freq9 - 0 - - - dc_offs_enb9 - "" - - - iq_imbal_enb9 - "" - - - norm_gain9 - False - - - gain9 - 0 - - - lo_export9 - False - - - lo_source9 - internal - - - clock_rate - 0.0 - comment @@ -2518,20 +886,20 @@ - dev_addr - "" + sdrplay_dabnotch + false - dev_args - "" + dev + "driver=remote,remote=moon,remote:driver=uhd" _enabled - True + 0 _coordinate - (248, 476) + (232, 468) _rotation @@ -2539,108 +907,20 @@ id - uhd_usrp_source_0 + soapy_source_0 + + + sdrplay_if_mode + Zero-IF + + + clock_rate + 0 maxoutbuf 0 - - clock_source0 - - - - sd_spec0 - - - - time_source0 - - - - clock_source1 - - - - sd_spec1 - - - - time_source1 - - - - clock_source2 - - - - sd_spec2 - - - - time_source2 - - - - clock_source3 - - - - sd_spec3 - - - - time_source3 - - - - clock_source4 - - - - sd_spec4 - - - - time_source4 - - - - clock_source5 - - - - sd_spec5 - - - - time_source5 - - - - clock_source6 - - - - sd_spec6 - - - - time_source6 - - - - clock_source7 - - - - sd_spec7 - - - - time_source7 - - minoutbuf 0 @@ -2649,42 +929,18 @@ nchan 1 - - num_mboards - 1 - type fc32 + + sdrplay_rfnotch + false + samp_rate samp_rate - - hide_cmd_port - False - - - hide_lo_controls - True - - - stream_args - - - - stream_chans - [] - - - sync - - - - otw - - wxgui_fftsink2 @@ -2714,7 +970,7 @@ _enabled - True + 0 fft_size @@ -2791,12 +1047,12 @@ analog_sig_source_x_0 - uhd_usrp_sink_0 + soapy_sink_0 0 0 - uhd_usrp_source_0 + soapy_source_0 wxgui_fftsink2_0 0 0 diff --git a/top_block.py b/top_block.py new file mode 100755 index 0000000..d077b64 --- /dev/null +++ b/top_block.py @@ -0,0 +1,246 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: Top Block +# Generated: Sat Apr 18 16:20:12 2020 +################################################## + + +if __name__ == '__main__': + import ctypes + import sys + if sys.platform.startswith('linux'): + try: + x11 = ctypes.cdll.LoadLibrary('libX11.so') + x11.XInitThreads() + except: + print "Warning: failed to XInitThreads()" + +from gnuradio import analog +from gnuradio import eng_notation +from gnuradio import gr +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from gnuradio.wxgui import forms +from grc_gnuradio import wxgui as grc_wxgui +from optparse import OptionParser +import soapy +import wx + + +class top_block(grc_wxgui.top_block_gui): + + def __init__(self): + grc_wxgui.top_block_gui.__init__(self, title="Top Block") + _icon_path = "/usr/share/icons/hicolor/32x32/apps/gnuradio-grc.png" + self.SetIcon(wx.Icon(_icon_path, wx.BITMAP_TYPE_ANY)) + + ################################################## + # Variables + ################################################## + self.f_ctr_fine = f_ctr_fine = 0e3 + self.f_ctr_coarse = f_ctr_coarse = 500e6 + self.samp_rate = samp_rate = 2e6 + self.rx_ftune = rx_ftune = 500e6 + self.power_tx_dB = power_tx_dB = 0 + self.offset_Hz = offset_Hz = 0 + self.f_tune = f_tune = f_ctr_coarse + f_ctr_fine + self.f_fine = f_fine = 0 + + ################################################## + # Blocks + ################################################## + _power_tx_dB_sizer = wx.BoxSizer(wx.VERTICAL) + self._power_tx_dB_text_box = forms.text_box( + parent=self.GetWin(), + sizer=_power_tx_dB_sizer, + value=self.power_tx_dB, + callback=self.set_power_tx_dB, + label='Tx-Power', + converter=forms.float_converter(), + proportion=0, + ) + self._power_tx_dB_slider = forms.slider( + parent=self.GetWin(), + sizer=_power_tx_dB_sizer, + value=self.power_tx_dB, + callback=self.set_power_tx_dB, + minimum=0, + maximum=1, + num_steps=100, + style=wx.SL_HORIZONTAL, + cast=float, + proportion=1, + ) + self.Add(_power_tx_dB_sizer) + self.soapy_sink_0 = \ + soapy.sink(1, "driver=remote,remote=moon,remote:driver=uhd", '', samp_rate, "fc32", '') + + + + + self.soapy_sink_0.set_frequency(0, f_tune) + self.soapy_sink_0.set_gain(0, power_tx_dB*40) + self.soapy_sink_0.set_gain_mode(0, False) + + self._rx_ftune_chooser = forms.drop_down( + parent=self.GetWin(), + value=self.rx_ftune, + callback=self.set_rx_ftune, + label='rx_ftune', + choices=[100e6, 200e6, 300e6, 433.92e6, 500e6, 700e6, 900e6], + labels=['100 MHz','200 MHz','300 MHz','400 MHz','500 MHz','700 MHz','900 MHz'], + ) + self.Add(self._rx_ftune_chooser) + _f_fine_sizer = wx.BoxSizer(wx.VERTICAL) + self._f_fine_text_box = forms.text_box( + parent=self.GetWin(), + sizer=_f_fine_sizer, + value=self.f_fine, + callback=self.set_f_fine, + label='f_fine', + converter=forms.float_converter(), + proportion=0, + ) + self._f_fine_slider = forms.slider( + parent=self.GetWin(), + sizer=_f_fine_sizer, + value=self.f_fine, + callback=self.set_f_fine, + minimum=-100e3, + maximum=100e3, + num_steps=200, + style=wx.SL_HORIZONTAL, + cast=float, + proportion=1, + ) + self.Add(_f_fine_sizer) + _f_ctr_fine_sizer = wx.BoxSizer(wx.VERTICAL) + self._f_ctr_fine_text_box = forms.text_box( + parent=self.GetWin(), + sizer=_f_ctr_fine_sizer, + value=self.f_ctr_fine, + callback=self.set_f_ctr_fine, + label='f_ctr_fine', + converter=forms.float_converter(), + proportion=0, + ) + self._f_ctr_fine_slider = forms.slider( + parent=self.GetWin(), + sizer=_f_ctr_fine_sizer, + value=self.f_ctr_fine, + callback=self.set_f_ctr_fine, + minimum=-1000e3, + maximum=1000e3, + num_steps=100, + style=wx.SL_HORIZONTAL, + cast=float, + proportion=1, + ) + self.Add(_f_ctr_fine_sizer) + _f_ctr_coarse_sizer = wx.BoxSizer(wx.VERTICAL) + self._f_ctr_coarse_text_box = forms.text_box( + parent=self.GetWin(), + sizer=_f_ctr_coarse_sizer, + value=self.f_ctr_coarse, + callback=self.set_f_ctr_coarse, + label='f_ctr_coarse', + converter=forms.float_converter(), + proportion=0, + ) + self._f_ctr_coarse_slider = forms.slider( + parent=self.GetWin(), + sizer=_f_ctr_coarse_sizer, + value=self.f_ctr_coarse, + callback=self.set_f_ctr_coarse, + minimum=88e6, + maximum=1000e6, + num_steps=20, + style=wx.SL_HORIZONTAL, + cast=float, + proportion=1, + ) + self.Add(_f_ctr_coarse_sizer) + self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, 0, 0.5, 0) + + + + ################################################## + # Connections + ################################################## + self.connect((self.analog_sig_source_x_0, 0), (self.soapy_sink_0, 0)) + + def get_f_ctr_fine(self): + return self.f_ctr_fine + + def set_f_ctr_fine(self, f_ctr_fine): + self.f_ctr_fine = f_ctr_fine + self.set_f_tune(self.f_ctr_coarse + self.f_ctr_fine) + self._f_ctr_fine_slider.set_value(self.f_ctr_fine) + self._f_ctr_fine_text_box.set_value(self.f_ctr_fine) + + def get_f_ctr_coarse(self): + return self.f_ctr_coarse + + def set_f_ctr_coarse(self, f_ctr_coarse): + self.f_ctr_coarse = f_ctr_coarse + self.set_f_tune(self.f_ctr_coarse + self.f_ctr_fine) + self._f_ctr_coarse_slider.set_value(self.f_ctr_coarse) + self._f_ctr_coarse_text_box.set_value(self.f_ctr_coarse) + + def get_samp_rate(self): + return self.samp_rate + + def set_samp_rate(self, samp_rate): + self.samp_rate = samp_rate + self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate) + + def get_rx_ftune(self): + return self.rx_ftune + + def set_rx_ftune(self, rx_ftune): + self.rx_ftune = rx_ftune + self._rx_ftune_chooser.set_value(self.rx_ftune) + + def get_power_tx_dB(self): + return self.power_tx_dB + + def set_power_tx_dB(self, power_tx_dB): + self.power_tx_dB = power_tx_dB + self._power_tx_dB_slider.set_value(self.power_tx_dB) + self._power_tx_dB_text_box.set_value(self.power_tx_dB) + + self.soapy_sink_0.set_gain(0, self.power_tx_dB*40) + + def get_offset_Hz(self): + return self.offset_Hz + + def set_offset_Hz(self, offset_Hz): + self.offset_Hz = offset_Hz + + def get_f_tune(self): + return self.f_tune + + def set_f_tune(self, f_tune): + self.f_tune = f_tune + self.soapy_sink_0.set_frequency(0, self.f_tune) + + def get_f_fine(self): + return self.f_fine + + def set_f_fine(self, f_fine): + self.f_fine = f_fine + self._f_fine_slider.set_value(self.f_fine) + self._f_fine_text_box.set_value(self.f_fine) + + +def main(top_block_cls=top_block, options=None): + + tb = top_block_cls() + tb.Start(True) + tb.Wait() + + +if __name__ == '__main__': + main() diff --git a/tx_playback.grc b/tx_playback.grc new file mode 100644 index 0000000..8abc98a --- /dev/null +++ b/tx_playback.grc @@ -0,0 +1,1372 @@ + + + + Fri Jan 4 18:03:35 2019 + + options + + author + + + + window_size + + + + category + [GRC Hier Blocks] + + + comment + + + + description + + + + _enabled + True + + + _coordinate + (8, 8) + + + _rotation + 0 + + + generate_options + wx_gui + + + hier_block_src_path + .: + + + id + top_block + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + prompt + + + run + True + + + sizing_mode + fixed + + + thread_safe_setters + + + + title + + + + placement + (0,0) + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (248, 92) + + + _rotation + 0 + + + id + f_tune + + + value + offset_Hz + f_tune_src + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (416, 20) + + + _rotation + 0 + + + id + f_tune_src + + + value + 434200000 + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 60 + + + _enabled + True + + + _coordinate + (800, 68) + + + _rotation + 0 + + + grid_pos + + + + id + if_gain + + + label + IF-Gain + + + max + 80 + + + min + 0 + + + notebook + + + + num_steps + 8 + + + style + wx.SL_HORIZONTAL + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (248, 20) + + + _rotation + 0 + + + id + offset_Hz + + + value + 0 + + + + variable_slider + + comment + + + + converver + float_converter + + + value + 30 + + + _enabled + True + + + _coordinate + (664, 68) + + + _rotation + 0 + + + grid_pos + + + + id + power_tx_dB + + + label + Tx-Power + + + max + 60 + + + min + 0 + + + notebook + + + + num_steps + 60 + + + style + wx.SL_HORIZONTAL + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (528, 20) + + + _rotation + 0 + + + id + samp_rate + + + value + 2e6 + + + + blocks_file_source + + begin_tag + pmt.PMT_NIL + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + file + /home/jens/gqrx_20190626_181742_434200000_2000000_fc.raw + + + _coordinate + (136, 260) + + + _rotation + 0 + + + id + blocks_file_source_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + type + complex + + + repeat + True + + + vlen + 1 + + + + blocks_multiply_const_vxx + + alias + + + + comment + + + + const + 10**(if_gain/20) + + + affinity + + + + _enabled + True + + + _coordinate + (352, 276) + + + _rotation + 0 + + + id + blocks_multiply_const_vxx_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + uhd_usrp_sink + + alias + + + + ant0 + TX/RX + + + bw0 + 0 + + + center_freq0 + f_tune + + + norm_gain0 + False + + + gain0 + power_tx_dB + + + ant10 + + + + bw10 + 0 + + + center_freq10 + 0 + + + norm_gain10 + False + + + gain10 + 0 + + + ant11 + + + + bw11 + 0 + + + center_freq11 + 0 + + + norm_gain11 + False + + + gain11 + 0 + + + ant12 + + + + bw12 + 0 + + + center_freq12 + 0 + + + norm_gain12 + False + + + gain12 + 0 + + + ant13 + + + + bw13 + 0 + + + center_freq13 + 0 + + + norm_gain13 + False + + + gain13 + 0 + + + ant14 + + + + bw14 + 0 + + + center_freq14 + 0 + + + norm_gain14 + False + + + gain14 + 0 + + + ant15 + + + + bw15 + 0 + + + center_freq15 + 0 + + + norm_gain15 + False + + + gain15 + 0 + + + ant16 + + + + bw16 + 0 + + + center_freq16 + 0 + + + norm_gain16 + False + + + gain16 + 0 + + + ant17 + + + + bw17 + 0 + + + center_freq17 + 0 + + + norm_gain17 + False + + + gain17 + 0 + + + ant18 + + + + bw18 + 0 + + + center_freq18 + 0 + + + norm_gain18 + False + + + gain18 + 0 + + + ant19 + + + + bw19 + 0 + + + center_freq19 + 0 + + + norm_gain19 + False + + + gain19 + 0 + + + ant1 + + + + bw1 + 0 + + + center_freq1 + 0 + + + norm_gain1 + False + + + gain1 + 0 + + + ant20 + + + + bw20 + 0 + + + center_freq20 + 0 + + + norm_gain20 + False + + + gain20 + 0 + + + ant21 + + + + bw21 + 0 + + + center_freq21 + 0 + + + norm_gain21 + False + + + gain21 + 0 + + + ant22 + + + + bw22 + 0 + + + center_freq22 + 0 + + + norm_gain22 + False + + + gain22 + 0 + + + ant23 + + + + bw23 + 0 + + + center_freq23 + 0 + + + norm_gain23 + False + + + gain23 + 0 + + + ant24 + + + + bw24 + 0 + + + center_freq24 + 0 + + + norm_gain24 + False + + + gain24 + 0 + + + ant25 + + + + bw25 + 0 + + + center_freq25 + 0 + + + norm_gain25 + False + + + gain25 + 0 + + + ant26 + + + + bw26 + 0 + + + center_freq26 + 0 + + + norm_gain26 + False + + + gain26 + 0 + + + ant27 + + + + bw27 + 0 + + + center_freq27 + 0 + + + norm_gain27 + False + + + gain27 + 0 + + + ant28 + + + + bw28 + 0 + + + center_freq28 + 0 + + + norm_gain28 + False + + + gain28 + 0 + + + ant29 + + + + bw29 + 0 + + + center_freq29 + 0 + + + norm_gain29 + False + + + gain29 + 0 + + + ant2 + + + + bw2 + 0 + + + center_freq2 + 0 + + + norm_gain2 + False + + + gain2 + 0 + + + ant30 + + + + bw30 + 0 + + + center_freq30 + 0 + + + norm_gain30 + False + + + gain30 + 0 + + + ant31 + + + + bw31 + 0 + + + center_freq31 + 0 + + + norm_gain31 + False + + + gain31 + 0 + + + ant3 + + + + bw3 + 0 + + + center_freq3 + 0 + + + norm_gain3 + False + + + gain3 + 0 + + + ant4 + + + + bw4 + 0 + + + center_freq4 + 0 + + + norm_gain4 + False + + + gain4 + 0 + + + ant5 + + + + bw5 + 0 + + + center_freq5 + 0 + + + norm_gain5 + False + + + gain5 + 0 + + + ant6 + + + + bw6 + 0 + + + center_freq6 + 0 + + + norm_gain6 + False + + + gain6 + 0 + + + ant7 + + + + bw7 + 0 + + + center_freq7 + 0 + + + norm_gain7 + False + + + gain7 + 0 + + + ant8 + + + + bw8 + 0 + + + center_freq8 + 0 + + + norm_gain8 + False + + + gain8 + 0 + + + ant9 + + + + bw9 + 0 + + + center_freq9 + 0 + + + norm_gain9 + False + + + gain9 + 0 + + + clock_rate + 0.0 + + + comment + + + + affinity + + + + dev_addr + "" + + + dev_args + "" + + + _enabled + True + + + _coordinate + (544, 228) + + + _rotation + 0 + + + id + uhd_usrp_sink_0 + + + type + fc32 + + + clock_source0 + + + + sd_spec0 + + + + time_source0 + + + + clock_source1 + + + + sd_spec1 + + + + time_source1 + + + + clock_source2 + + + + sd_spec2 + + + + time_source2 + + + + clock_source3 + + + + sd_spec3 + + + + time_source3 + + + + clock_source4 + + + + sd_spec4 + + + + time_source4 + + + + clock_source5 + + + + sd_spec5 + + + + time_source5 + + + + clock_source6 + + + + sd_spec6 + + + + time_source6 + + + + clock_source7 + + + + sd_spec7 + + + + time_source7 + + + + nchan + 1 + + + num_mboards + 1 + + + samp_rate + samp_rate + + + hide_cmd_port + False + + + hide_lo_controls + True + + + stream_args + + + + stream_chans + [] + + + sync + + + + len_tag_name + + + + otw + + + + + wxgui_fftsink2 + + avg_alpha + 0 + + + average + False + + + baseband_freq + f_tune + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + freqvar + None + + + _coordinate + (560, 356) + + + _rotation + 0 + + + grid_pos + + + + id + wxgui_fftsink2_0 + + + notebook + + + + peak_hold + False + + + ref_level + 0 + + + ref_scale + 2.0 + + + fft_rate + 15 + + + samp_rate + samp_rate + + + title + FFT Plot + + + type + complex + + + win_size + + + + win + None + + + y_divs + 10 + + + y_per_div + 10 + + + + blocks_file_source_0 + blocks_multiply_const_vxx_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + uhd_usrp_sink_0 + 0 + 0 + + + blocks_multiply_const_vxx_0 + wxgui_fftsink2_0 + 0 + 0 + +