diff --git a/CMakeLists.txt b/CMakeLists.txt index b3e50e1..7ad4839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Project setup ######################################################################## -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(gr-satnogs CXX C) enable_testing() @@ -29,16 +29,28 @@ set (CMAKE_CXX_STANDARD 11) add_definitions(-std=c++11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") +#install to PyBOMBS target prefix if defined +if(DEFINED ENV{PYBOMBS_PREFIX}) +#IGNORE set(CMAKE_INSTALL_PREFIX $ENV{PYBOMBS_PREFIX}) + message(STATUS "PyBOMBS installed GNU Radio. Setting CMAKE_INSTALL_PREFIX to $ENV{PYBOMBS_PREFIX}") +endif() + #select the release build type by default to get optimization flags if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") +#IGNORE set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: defaulting to release.") endif(NOT CMAKE_BUILD_TYPE) -set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") +#IGNORE set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "") #make sure our local CMake Modules path comes first list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) +# Set the version information here +set(VERSION_INFO_MAJOR_VERSION 1) +set(VERSION_INFO_API_COMPAT 0) +set(VERSION_INFO_MINOR_VERSION 1) +set(VERSION_INFO_MAINT_VERSION git) + ######################################################################## # Compiler specific setup ######################################################################## @@ -115,13 +127,35 @@ find_package (Threads REQUIRED) ######################################################################## find_package(CppUnit) find_package(Doxygen) +find_package(Volk REQUIRED) +find_package(OggVorbis REQUIRED) +find_package(PNG REQUIRED) + +######################################################################## +# Include or not into the module blocks for debugging +######################################################################## +option(INCLUDE_DEBUG_BLOCKS "Enable/Disable blocks that are used for debugging purposes" ON) + + +######################################################################## +# Find gr-satnogs external build dependencies +######################################################################## +if(${INCLUDE_DEBUG_BLOCKS}) + find_package(Nova) + if(NOT NOVA_FOUND) + message(FATAL_ERROR "libnova required to compile satnogs") + endif() +endif() # Search for GNU Radio and its components and versions. Add any # components required to the list of GR_REQUIRED_COMPONENTS (in all # caps such as FILTER or FFT) and change the version to the minimum # API compatible version required. -set(GR_REQUIRED_COMPONENTS RUNTIME) -find_package(Gnuradio "3.7.2" REQUIRED) +set(GR_REQUIRED_COMPONENTS RUNTIME FFT) +set(GR_REQUIRED_COMPONENTS RUNTIME FILTER) +find_package(Gnuradio "3.7.7" REQUIRED) +list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_SOURCE_DIR}/cmake/Modules) +include(GrVersion) if(NOT CPPUNIT_FOUND) message(FATAL_ERROR "CppUnit required to compile satnogs") @@ -147,6 +181,7 @@ include_directories( ${Boost_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS} ${GNURADIO_ALL_INCLUDE_DIRS} + ${NOVA_INCLUDE_DIRS} ) link_directories( diff --git a/README.md b/README.md index bab7b67..28dded6 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,17 @@ for decoding signals from various scientific and academic sattelites. ## Install ### Requirements -1. GNU Radio ( > 3.7.2 ) -2. CMake ( > 3.1) -3. G++ (with C++11 support) -4. VOLK -5. git -6. gr-osmocom (optional, for using the flowgraphs) +* GNU Radio ( > 3.7.7 ) +* CMake ( > 3.1) +* G++ (with C++11 support) +* VOLK +* libogg +* libvorbis +* git + +**Optional** +* gr-osmocom (for using the flowgraphs with real SDR hardware) +* libnova (for building the debug blocks) ### Installation @@ -24,6 +29,33 @@ for decoding signals from various scientific and academic sattelites. If this is the first time you are building the gr-satnogs module run `sudo ldconfig` +#### Advanced +By default, the **SatNOGS** module will use the default installation prefix. +This highly depends on the Linux distribution. You can use the `CMAKE_INSTALL_PREFIX` +variable to alter the default installation path. +E.g: + +`cmake -DCMAKE_INSTALL_PREFIX=/usr ..` + +Also, by default the build system enables a set of blocks used for debugging +during the development. The enable/disable switch is controled through the +`INCLUDE_DEBUG_BLOCKS` boolean variable. If for example, you want to disable the +debugging blocks, the **CMake** command would be: + +`cmake -DINCLUDE_DEBUG_BLOCKS=OFF ..` + +Another common control option is the library sugffix of the Linux distribution. +There are distributions like Fedora, openSUSE, e.t.c that the their 64-bit version +use the `lib64` folder to store the 64-bit versions of their dynamic libraries. +On the other hand, distributions like Ubuntu do the exact opposite. They use +`lib` directory for the libraries of the native architecture and place the 32-bit versions +on the `lib32` directory. In any case the correct library directory suffix +can be specified with the `LIB_SUFFIX` variable. For example: + +`cmake -DLIB_SUFFIX=64 -DCMAKE_INSTALL_PREFIX=/usr -DINCLUDE_DEBUG_BLOCKS=OFF ..` + +will install the libraries at the `/usr/lib64` directory. + ## Website For more indormation about SatNOGS please visit our [site](https://satnogs.org/). diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 26a9f2c..f944868 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -19,8 +19,12 @@ include(GrPython) +add_subdirectory(flowgraphs/satellites) +add_subdirectory(scripts) + GR_PYTHON_INSTALL( PROGRAMS - flowgraphs/upsat_transceiver_cli.py + flowgraphs/satnogs_fm_demod.py + flowgraphs/satnogs_generic_iq_receiver.py DESTINATION bin ) diff --git a/apps/flowgraphs/fm_demod.grc b/apps/flowgraphs/fm_demod.grc index ed84873..ef2ecb7 100644 --- a/apps/flowgraphs/fm_demod.grc +++ b/apps/flowgraphs/fm_demod.grc @@ -1,16 +1,16 @@ - + Thu May 5 00:22:45 2016 options author - + Manolis Surligas (surligas@gmail.com) window_size - + 3000, 3000 category @@ -22,7 +22,7 @@ description - + A generic FM demodulation block _enabled @@ -38,7 +38,7 @@ generate_options - qt_gui + no_gui hier_block_src_path @@ -46,7 +46,7 @@ id - fm_demod + satnogs_fm_demod max_nouts @@ -66,7 +66,7 @@ run_options - prompt + run run @@ -78,124 +78,7 @@ title - - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (480, 21) - - - _rotation - 0 - - - id - audio_decimation - - - value - 2 - - - - variable_qtgui_range - - comment - - - - value - 0.9 - - - _enabled - True - - - _coordinate - (1048, 249) - - - gui_hint - - - - _rotation - 0 - - - id - audio_gain - - - label - Audio Gain - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.01 - - - stop - 8 - - - rangeType - float - - - widget - counter_slider - - - - variable - - comment - - - - _enabled - True - - - _coordinate - (480, 93) - - - _rotation - 0 - - - id - audio_samp_rate - - - value - 44100 + FM Generic Demodulation @@ -212,7 +95,63 @@ SDR received samples _coordinate - (232, 21) + (1704, 796) + + + _rotation + 0 + + + id + audio_gain + + + value + satnogs.fm_demod_settings[rx_sdr_device]['audio_gain'] + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (1704, 52) + + + _rotation + 0 + + + id + audio_samp_rate + + + value + 48000 + + + + variable + + comment + Decimation factor +for the RX after the +SDR received samples + + + _enabled + 0 + + + _coordinate + (1704, 348) _rotation @@ -224,161 +163,7 @@ SDR received samples value - 10 - - - - variable_qtgui_range - - comment - - - - value - 100e6 - - - _enabled - True - - - _coordinate - (1048, 24) - - - gui_hint - - - - _rotation - 0 - - - id - freq - - - label - RX Frequency - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 92e6 - - - step - 100e3 - - - stop - 105e6 - - - rangeType - float - - - widget - counter_slider - - - - variable_qtgui_range - - comment - - - - value - 10 - - - _enabled - True - - - _coordinate - (1048, 137) - - - gui_hint - - - - _rotation - 0 - - - id - gain - - - label - RX RF Gain - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 40 - - - rangeType - float - - - widget - counter_slider - - - - variable - - comment - To avoid the SDR carrier at the DC -we shift the LO a little further - - - _enabled - True - - - _coordinate - (832, 18) - - - _rotation - 0 - - - id - lo_offset - - - value - 100e3 + satnogs.fm_demod_settings[rx_sdr_device]['decimation_rx'] @@ -393,7 +178,61 @@ we shift the LO a little further _coordinate - (360, 21) + (1480, 988) + + + _rotation + 0 + + + id + deviation + + + value + 5000 + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (1704, 260) + + + _rotation + 0 + + + id + filter_rate + + + value + 250000 + + + + variable + + comment + + + + _enabled + 0 + + + _coordinate + (1704, 508) _rotation @@ -412,7 +251,8 @@ we shift the LO a little further variable comment - + SDR device +TX sampling rate _enabled @@ -420,7 +260,7 @@ we shift the LO a little further _coordinate - (8, 160) + (1704, 956) _rotation @@ -432,7 +272,7 @@ we shift the LO a little further value - 10e6 + satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] @@ -455,7 +295,7 @@ we shift the LO a little further _coordinate - (664, 18) + (48, 716) _rotation @@ -483,164 +323,34 @@ we shift the LO a little further - analog_sig_source_x - - amp - 1 - - - alias - - + variable comment - - affinity - - _enabled - 1 - - - freq - -lo_offset - - - _coordinate - (296, 192) - - - _rotation - 0 - - - id - analog_sig_source_x_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - offset - 0 - - - type - complex - - - samp_rate - samp_rate_rx - - - waveform - analog.GR_COS_WAVE - - - - analog_wfm_rcv - - audio_decimation - audio_decimation - - - alias - - - - comment - - - - affinity - - - - _enabled - 1 - - - _coordinate - (712, 501) - - - _rotation - 0 - - - id - analog_wfm_rcv_0 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - quad_rate - quadrature_rate - - - - audio_sink - - alias - - - - comment - - - - affinity - - - - device_name - - - - _enabled - 1 - - - _coordinate - (776, 668) - - - _rotation - 180 - - - id - audio_sink_0 - - - num_inputs - 1 - - - ok_to_block True - samp_rate - audio_samp_rate + _coordinate + (1704, 164) + + + _rotation + 0 + + + id + xlate_filter_taps + + + value + firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) - blocks_multiply_const_vxx + analog_quadrature_demod_cf alias @@ -650,20 +360,157 @@ we shift the LO a little further - const - audio_gain + affinity + + + + _enabled + True + + + _coordinate + (1088, 564) + + + _rotation + 180 + + + gain + (2*math.pi*deviation)/audio_samp_rate + + + id + analog_quadrature_demod_cf_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + + rational_resampler_xxx + + alias + + + + comment + affinity + + decim + 125 + _enabled - 1 + True + + + fbw + 0 _coordinate - (968, 668) + (1272, 268) + + + _rotation + 0 + + + id + blks2_rational_resampler_xxx_1 + + + interp + 24 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + taps + [] + + + type + ccc + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (64, 984) + + + _rotation + 0 + + + id + doppler_correction_per_sec + + + label + + + + short_id + + + + type + intx + + + value + 1000 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (744, 988) _rotation @@ -671,74 +518,23 @@ we shift the LO a little further id - blocks_multiply_const_vxx_0 + file_path + + + label + + + + short_id + type - float + string - maxoutbuf - 0 - - - minoutbuf - 0 - - - vlen - 1 - - - - blocks_multiply_xx - - alias - - - - comment - - - - affinity - - - - _enabled - 1 - - - _coordinate - (568, 264) - - - _rotation - 0 - - - id - blocks_multiply_xx_0 - - - type - complex - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - num_inputs - 2 - - - vlen - 1 + value + test.wav @@ -761,7 +557,7 @@ we shift the LO a little further decim - decimation_rx + int(samp_rate_rx/filter_rate) _enabled @@ -769,7 +565,7 @@ we shift the LO a little further _coordinate - (496, 487) + (680, 268) _rotation @@ -793,13 +589,57 @@ we shift the LO a little further taps - taps + xlate_filter_taps type ccc + + parameter + + alias + + + + comment + To avoid the SDR carrier at the DC +we shift the LO a little further + + + _enabled + True + + + _coordinate + (1704, 608) + + + _rotation + 0 + + + id + lo_offset + + + label + + + + short_id + + + + type + eng_float + + + value + 100e3 + + osmosdr_source @@ -808,11 +648,11 @@ we shift the LO a little further ant0 - + satnogs.hw_rx_settings[rx_sdr_device]['antenna'] bb_gain0 - 20 + satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'] bw0 @@ -820,15 +660,15 @@ we shift the LO a little further dc_offset_mode0 - 0 + 2 corr0 - 0 + ppm freq0 - freq - lo_offset + rx_freq - lo_offset gain_mode0 @@ -836,7 +676,7 @@ we shift the LO a little further if_gain0 - 20 + satnogs.hw_rx_settings[rx_sdr_device]['if_gain'] iq_balance_mode0 @@ -844,7 +684,7 @@ we shift the LO a little further gain0 - gain + satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'] ant10 @@ -2096,7 +1936,7 @@ we shift the LO a little further args - + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] _enabled @@ -2104,7 +1944,7 @@ we shift the LO a little further _coordinate - (104, 229) + (16, 376) _rotation @@ -2208,7 +2048,7 @@ we shift the LO a little further - pfb_arb_resampler_xxx + parameter alias @@ -2217,17 +2057,13 @@ we shift the LO a little further comment - - affinity - - _enabled - 1 + True _coordinate - (904, 487) + (1104, 996) _rotation @@ -2235,330 +2071,156 @@ we shift the LO a little further id - pfb_arb_resampler_xxx_0 + ppm - maxoutbuf - 0 + label + - minoutbuf - 0 - - - nfilts - 32 - - - rrate - audio_samp_rate / (quadrature_rate * 1.0 / audio_decimation) - - - samp_delay - 0 - - - atten - 100 - - - taps - firdes.low_pass_2(32, 32, 0.8, 0.1, 100) + short_id + type - fff + intx + + + value + 0 - qtgui_freq_sink_x - - autoscale - False - - - average - 1.0 - - - bw - samp_rate_rx - + parameter alias - - fc - 0 - comment - ctrlpanel + _enabled True - - affinity - - - - _enabled - 1 - - - fftsize - 1024 - _coordinate - (896, 262) - - - gui_hint - + (472, 984) _rotation 0 - - grid - True - id - qtgui_freq_sink_x_0 + rigctl_port - legend - True - - - alpha1 - 1.0 - - - color1 - "blue" - - - label1 + label - width1 - 1 - - - alpha10 - 1.0 - - - color10 - "dark blue" - - - label10 + short_id - - width10 - 1 - - - alpha2 - 1.0 - - - color2 - "red" - - - label2 - - - - width2 - 1 - - - alpha3 - 1.0 - - - color3 - "green" - - - label3 - - - - width3 - 1 - - - alpha4 - 1.0 - - - color4 - "black" - - - label4 - - - - width4 - 1 - - - alpha5 - 1.0 - - - color5 - "cyan" - - - label5 - - - - width5 - 1 - - - alpha6 - 1.0 - - - color6 - "magenta" - - - label6 - - - - width6 - 1 - - - alpha7 - 1.0 - - - color7 - "yellow" - - - label7 - - - - width7 - 1 - - - alpha8 - 1.0 - - - color8 - "dark red" - - - label8 - - - - width8 - 1 - - - alpha9 - 1.0 - - - color9 - "dark green" - - - label9 - - - - width9 - 1 - - - maxoutbuf - 0 - - - minoutbuf - 0 - - - name - "" - - - nconnections - 1 - - - showports - True - - - freqhalf - True - - - tr_chan - 0 - - - tr_level - 0.0 - - - tr_mode - qtgui.TRIG_MODE_FREE - - - tr_tag - "" - type - complex + intx - update_time - 0.01 - - - wintype - firdes.WIN_BLACKMAN_hARRIS - - - ymax - 10 - - - ymin - -140 + value + 4532 - satnogs_doppler_correction_cc + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (616, 984) + + + _rotation + 0 + + + id + rx_freq + + + label + + + + short_id + + + + type + eng_float + + + value + 100e6 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (312, 984) + + + _rotation + 0 + + + id + rx_sdr_device + + + label + + + + short_id + + + + type + string + + + value + usrpb200 + + + + satnogs_coarse_doppler_correction_cc alias @@ -2571,17 +2233,13 @@ we shift the LO a little further affinity - - corrections_per_sec - 1000 - _enabled - 1 + True _coordinate - (280, 464) + (352, 276) _rotation @@ -2589,7 +2247,7 @@ we shift the LO a little further id - satnogs_doppler_correction_cc_0 + satnogs_coarse_doppler_correction_cc_0 maxoutbuf @@ -2605,7 +2263,50 @@ we shift the LO a little further target_freq - freq + rx_freq + + + + satnogs_ogg_encoder + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + filename + file_path + + + _coordinate + (920, 548) + + + _rotation + 180 + + + id + satnogs_ogg_encoder_0 + + + quality + 1.0 + + + samp_rate + audio_samp_rate @@ -2628,7 +2329,7 @@ we shift the LO a little further _coordinate - (24, 446) + (16, 204) _rotation @@ -2642,10 +2343,6 @@ we shift the LO a little further addr "127.0.0.1" - - port - 4532 - mtu 1500 @@ -2658,64 +2355,156 @@ we shift the LO a little further minoutbuf 0 + + mode + False + + + port + rigctl_port + + + interval + 1000 + + + + satnogs_waterfall_sink + + alias + + + + center_freq + 0.0 + + + comment + + + + affinity + + + + _enabled + True + + + fft_size + 1024 + + + filename + waterfall_file_path + + + _coordinate + (1488, 248) + + + _rotation + 0 + + + id + satnogs_waterfall_sink_0 + + + mode + 1 + + + pps + 10 + + + samp_rate + audio_samp_rate + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (872, 988) + + + _rotation + 0 + + + id + waterfall_file_path + + + label + + + + short_id + + + + type + string + + + value + /tmp/waterfall.dat + - analog_sig_source_x_0 - blocks_multiply_xx_0 + analog_quadrature_demod_cf_0 + satnogs_ogg_encoder_0 0 0 - analog_wfm_rcv_0 - pfb_arb_resampler_xxx_0 + blks2_rational_resampler_xxx_1 + analog_quadrature_demod_cf_0 0 0 - blocks_multiply_const_vxx_0 - audio_sink_0 - 0 - 0 - - - blocks_multiply_xx_0 - qtgui_freq_sink_x_0 + blks2_rational_resampler_xxx_1 + satnogs_waterfall_sink_0 0 0 freq_xlating_fir_filter_xxx_0 - analog_wfm_rcv_0 + blks2_rational_resampler_xxx_1 0 0 osmosdr_source_0 - blocks_multiply_xx_0 - 0 - 1 - - - osmosdr_source_0 - satnogs_doppler_correction_cc_0 + satnogs_coarse_doppler_correction_cc_0 0 0 - pfb_arb_resampler_xxx_0 - blocks_multiply_const_vxx_0 - 0 - 0 - - - satnogs_doppler_correction_cc_0 + satnogs_coarse_doppler_correction_cc_0 freq_xlating_fir_filter_xxx_0 0 0 satnogs_tcp_rigctl_msg_source_0 - satnogs_doppler_correction_cc_0 + satnogs_coarse_doppler_correction_cc_0 freq freq diff --git a/apps/flowgraphs/generic_iq_receiver.grc b/apps/flowgraphs/generic_iq_receiver.grc new file mode 100644 index 0000000..b0b91e0 --- /dev/null +++ b/apps/flowgraphs/generic_iq_receiver.grc @@ -0,0 +1,2635 @@ + + + + Thu May 5 00:22:45 2016 + + options + + author + Manolis Surligas (surligas@gmail.com) + + + window_size + + + + category + Custom + + + comment + + + + description + A generic FM demodulation block + + + _enabled + True + + + _coordinate + (8, 8) + + + _rotation + 0 + + + generate_options + no_gui + + + hier_block_src_path + .: + + + id + satnogs_generic_iq_receiver + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + run + + + run + True + + + thread_safe_setters + + + + title + Generic IQ samples receiver + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (568, 508) + + + _rotation + 0 + + + id + audio_decimation + + + value + 2 + + + + variable + + comment + Decimation factor +for the RX after the +SDR received samples + + + _enabled + True + + + _coordinate + (336, 612) + + + _rotation + 0 + + + id + audio_gain + + + value + satnogs.fm_demod_settings[rx_sdr_device]['audio_gain'] + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (568, 580) + + + _rotation + 0 + + + id + audio_samp_rate + + + value + 44100 + + + + variable + + comment + Decimation factor +for the RX after the +SDR received samples + + + _enabled + True + + + _coordinate + (192, 612) + + + _rotation + 0 + + + id + decimation_rx + + + value + satnogs.fm_demod_settings[rx_sdr_device]['decimation_rx'] + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (432, 476) + + + _rotation + 0 + + + id + quadrature_rate + + + value + samp_rate_rx / decimation_rx + + + + variable + + comment + SDR device +TX sampling rate + + + _enabled + True + + + _coordinate + (192, 484) + + + _rotation + 0 + + + id + samp_rate_rx + + + value + satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] + + + + variable_low_pass_filter_taps + + beta + 6.76 + + + comment + + + + cutoff_freq + 100e3 + + + _enabled + 1 + + + _coordinate + (560, 648) + + + _rotation + 0 + + + gain + 12.0 + + + id + taps + + + samp_rate + samp_rate_rx + + + width + 60000 + + + win + firdes.WIN_HAMMING + + + + analog_sig_source_x + + amp + 1 + + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + freq + -lo_offset + + + _coordinate + (312, 24) + + + _rotation + 0 + + + id + analog_sig_source_x_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + offset + 0 + + + type + complex + + + samp_rate + samp_rate_rx + + + waveform + analog.GR_COS_WAVE + + + + blocks_file_sink + + append + False + + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + file + file_path + + + _coordinate + (1136, 284) + + + _rotation + 0 + + + id + blocks_file_sink_0 + + + type + complex + + + unbuffered + True + + + vlen + 1 + + + + blocks_multiply_xx + + alias + + + + comment + + + + affinity + + + + _enabled + 0 + + + _coordinate + (568, 64) + + + _rotation + 0 + + + id + blocks_multiply_xx_0 + + + type + complex + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + num_inputs + 2 + + + vlen + 1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (64, 860) + + + _rotation + 0 + + + id + doppler_correction_per_sec + + + label + + + + short_id + + + + type + intx + + + value + 1000 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (64, 620) + + + _rotation + 0 + + + id + file_path + + + label + + + + short_id + + + + type + string + + + value + test.wav + + + + freq_xlating_fir_filter_xxx + + alias + + + + center_freq + lo_offset + + + comment + + + + affinity + + + + decim + decimation_rx + + + _enabled + 1 + + + _coordinate + (896, 280) + + + _rotation + 0 + + + id + freq_xlating_fir_filter_xxx_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + samp_rate_rx + + + taps + taps + + + type + ccc + + + + parameter + + alias + + + + comment + To avoid the SDR carrier at the DC +we shift the LO a little further + + + _enabled + True + + + _coordinate + (328, 476) + + + _rotation + 0 + + + id + lo_offset + + + label + + + + short_id + + + + type + eng_float + + + value + 100e3 + + + + osmosdr_source + + alias + + + + ant0 + satnogs.hw_rx_settings[rx_sdr_device]['antenna'] + + + bb_gain0 + satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'] + + + bw0 + samp_rate_rx + + + dc_offset_mode0 + 2 + + + corr0 + 0 + + + freq0 + rx_freq - lo_offset + + + gain_mode0 + False + + + if_gain0 + satnogs.hw_rx_settings[rx_sdr_device]['if_gain'] + + + iq_balance_mode0 + 0 + + + gain0 + satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'] + + + ant10 + + + + bb_gain10 + 20 + + + bw10 + 0 + + + dc_offset_mode10 + 0 + + + corr10 + 0 + + + freq10 + 100e6 + + + gain_mode10 + False + + + if_gain10 + 20 + + + iq_balance_mode10 + 0 + + + gain10 + 10 + + + ant11 + + + + bb_gain11 + 20 + + + bw11 + 0 + + + dc_offset_mode11 + 0 + + + corr11 + 0 + + + freq11 + 100e6 + + + gain_mode11 + False + + + if_gain11 + 20 + + + iq_balance_mode11 + 0 + + + gain11 + 10 + + + ant12 + + + + bb_gain12 + 20 + + + bw12 + 0 + + + dc_offset_mode12 + 0 + + + corr12 + 0 + + + freq12 + 100e6 + + + gain_mode12 + False + + + if_gain12 + 20 + + + iq_balance_mode12 + 0 + + + gain12 + 10 + + + ant13 + + + + bb_gain13 + 20 + + + bw13 + 0 + + + dc_offset_mode13 + 0 + + + corr13 + 0 + + + freq13 + 100e6 + + + gain_mode13 + False + + + if_gain13 + 20 + + + iq_balance_mode13 + 0 + + + gain13 + 10 + + + ant14 + + + + bb_gain14 + 20 + + + bw14 + 0 + + + dc_offset_mode14 + 0 + + + corr14 + 0 + + + freq14 + 100e6 + + + gain_mode14 + False + + + if_gain14 + 20 + + + iq_balance_mode14 + 0 + + + gain14 + 10 + + + ant15 + + + + bb_gain15 + 20 + + + bw15 + 0 + + + dc_offset_mode15 + 0 + + + corr15 + 0 + + + freq15 + 100e6 + + + gain_mode15 + False + + + if_gain15 + 20 + + + iq_balance_mode15 + 0 + + + gain15 + 10 + + + ant16 + + + + bb_gain16 + 20 + + + bw16 + 0 + + + dc_offset_mode16 + 0 + + + corr16 + 0 + + + freq16 + 100e6 + + + gain_mode16 + False + + + if_gain16 + 20 + + + iq_balance_mode16 + 0 + + + gain16 + 10 + + + ant17 + + + + bb_gain17 + 20 + + + bw17 + 0 + + + dc_offset_mode17 + 0 + + + corr17 + 0 + + + freq17 + 100e6 + + + gain_mode17 + False + + + if_gain17 + 20 + + + iq_balance_mode17 + 0 + + + gain17 + 10 + + + ant18 + + + + bb_gain18 + 20 + + + bw18 + 0 + + + dc_offset_mode18 + 0 + + + corr18 + 0 + + + freq18 + 100e6 + + + gain_mode18 + False + + + if_gain18 + 20 + + + iq_balance_mode18 + 0 + + + gain18 + 10 + + + ant19 + + + + bb_gain19 + 20 + + + bw19 + 0 + + + dc_offset_mode19 + 0 + + + corr19 + 0 + + + freq19 + 100e6 + + + gain_mode19 + False + + + if_gain19 + 20 + + + iq_balance_mode19 + 0 + + + gain19 + 10 + + + ant1 + + + + bb_gain1 + 20 + + + bw1 + 0 + + + dc_offset_mode1 + 0 + + + corr1 + 0 + + + freq1 + 100e6 + + + gain_mode1 + False + + + if_gain1 + 20 + + + iq_balance_mode1 + 0 + + + gain1 + 10 + + + ant20 + + + + bb_gain20 + 20 + + + bw20 + 0 + + + dc_offset_mode20 + 0 + + + corr20 + 0 + + + freq20 + 100e6 + + + gain_mode20 + False + + + if_gain20 + 20 + + + iq_balance_mode20 + 0 + + + gain20 + 10 + + + ant21 + + + + bb_gain21 + 20 + + + bw21 + 0 + + + dc_offset_mode21 + 0 + + + corr21 + 0 + + + freq21 + 100e6 + + + gain_mode21 + False + + + if_gain21 + 20 + + + iq_balance_mode21 + 0 + + + gain21 + 10 + + + ant22 + + + + bb_gain22 + 20 + + + bw22 + 0 + + + dc_offset_mode22 + 0 + + + corr22 + 0 + + + freq22 + 100e6 + + + gain_mode22 + False + + + if_gain22 + 20 + + + iq_balance_mode22 + 0 + + + gain22 + 10 + + + ant23 + + + + bb_gain23 + 20 + + + bw23 + 0 + + + dc_offset_mode23 + 0 + + + corr23 + 0 + + + freq23 + 100e6 + + + gain_mode23 + False + + + if_gain23 + 20 + + + iq_balance_mode23 + 0 + + + gain23 + 10 + + + ant24 + + + + bb_gain24 + 20 + + + bw24 + 0 + + + dc_offset_mode24 + 0 + + + corr24 + 0 + + + freq24 + 100e6 + + + gain_mode24 + False + + + if_gain24 + 20 + + + iq_balance_mode24 + 0 + + + gain24 + 10 + + + ant25 + + + + bb_gain25 + 20 + + + bw25 + 0 + + + dc_offset_mode25 + 0 + + + corr25 + 0 + + + freq25 + 100e6 + + + gain_mode25 + False + + + if_gain25 + 20 + + + iq_balance_mode25 + 0 + + + gain25 + 10 + + + ant26 + + + + bb_gain26 + 20 + + + bw26 + 0 + + + dc_offset_mode26 + 0 + + + corr26 + 0 + + + freq26 + 100e6 + + + gain_mode26 + False + + + if_gain26 + 20 + + + iq_balance_mode26 + 0 + + + gain26 + 10 + + + ant27 + + + + bb_gain27 + 20 + + + bw27 + 0 + + + dc_offset_mode27 + 0 + + + corr27 + 0 + + + freq27 + 100e6 + + + gain_mode27 + False + + + if_gain27 + 20 + + + iq_balance_mode27 + 0 + + + gain27 + 10 + + + ant28 + + + + bb_gain28 + 20 + + + bw28 + 0 + + + dc_offset_mode28 + 0 + + + corr28 + 0 + + + freq28 + 100e6 + + + gain_mode28 + False + + + if_gain28 + 20 + + + iq_balance_mode28 + 0 + + + gain28 + 10 + + + ant29 + + + + bb_gain29 + 20 + + + bw29 + 0 + + + dc_offset_mode29 + 0 + + + corr29 + 0 + + + freq29 + 100e6 + + + gain_mode29 + False + + + if_gain29 + 20 + + + iq_balance_mode29 + 0 + + + gain29 + 10 + + + ant2 + + + + bb_gain2 + 20 + + + bw2 + 0 + + + dc_offset_mode2 + 0 + + + corr2 + 0 + + + freq2 + 100e6 + + + gain_mode2 + False + + + if_gain2 + 20 + + + iq_balance_mode2 + 0 + + + gain2 + 10 + + + ant30 + + + + bb_gain30 + 20 + + + bw30 + 0 + + + dc_offset_mode30 + 0 + + + corr30 + 0 + + + freq30 + 100e6 + + + gain_mode30 + False + + + if_gain30 + 20 + + + iq_balance_mode30 + 0 + + + gain30 + 10 + + + ant31 + + + + bb_gain31 + 20 + + + bw31 + 0 + + + dc_offset_mode31 + 0 + + + corr31 + 0 + + + freq31 + 100e6 + + + gain_mode31 + False + + + if_gain31 + 20 + + + iq_balance_mode31 + 0 + + + gain31 + 10 + + + ant3 + + + + bb_gain3 + 20 + + + bw3 + 0 + + + dc_offset_mode3 + 0 + + + corr3 + 0 + + + freq3 + 100e6 + + + gain_mode3 + False + + + if_gain3 + 20 + + + iq_balance_mode3 + 0 + + + gain3 + 10 + + + ant4 + + + + bb_gain4 + 20 + + + bw4 + 0 + + + dc_offset_mode4 + 0 + + + corr4 + 0 + + + freq4 + 100e6 + + + gain_mode4 + False + + + if_gain4 + 20 + + + iq_balance_mode4 + 0 + + + gain4 + 10 + + + ant5 + + + + bb_gain5 + 20 + + + bw5 + 0 + + + dc_offset_mode5 + 0 + + + corr5 + 0 + + + freq5 + 100e6 + + + gain_mode5 + False + + + if_gain5 + 20 + + + iq_balance_mode5 + 0 + + + gain5 + 10 + + + ant6 + + + + bb_gain6 + 20 + + + bw6 + 0 + + + dc_offset_mode6 + 0 + + + corr6 + 0 + + + freq6 + 100e6 + + + gain_mode6 + False + + + if_gain6 + 20 + + + iq_balance_mode6 + 0 + + + gain6 + 10 + + + ant7 + + + + bb_gain7 + 20 + + + bw7 + 0 + + + dc_offset_mode7 + 0 + + + corr7 + 0 + + + freq7 + 100e6 + + + gain_mode7 + False + + + if_gain7 + 20 + + + iq_balance_mode7 + 0 + + + gain7 + 10 + + + ant8 + + + + bb_gain8 + 20 + + + bw8 + 0 + + + dc_offset_mode8 + 0 + + + corr8 + 0 + + + freq8 + 100e6 + + + gain_mode8 + False + + + if_gain8 + 20 + + + iq_balance_mode8 + 0 + + + gain8 + 10 + + + ant9 + + + + bb_gain9 + 20 + + + bw9 + 0 + + + dc_offset_mode9 + 0 + + + corr9 + 0 + + + freq9 + 100e6 + + + gain_mode9 + False + + + if_gain9 + 20 + + + iq_balance_mode9 + 0 + + + gain9 + 10 + + + comment + + + + affinity + + + + args + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] + + + _enabled + 1 + + + _coordinate + (24, 256) + + + _rotation + 0 + + + id + osmosdr_source_0 + + + maxoutbuf + 0 + + + clock_source0 + + + + time_source0 + + + + clock_source1 + + + + time_source1 + + + + clock_source2 + + + + time_source2 + + + + clock_source3 + + + + time_source3 + + + + clock_source4 + + + + time_source4 + + + + clock_source5 + + + + time_source5 + + + + clock_source6 + + + + time_source6 + + + + clock_source7 + + + + time_source7 + + + + minoutbuf + 0 + + + nchan + 1 + + + num_mboards + 1 + + + type + fc32 + + + sample_rate + samp_rate_rx + + + sync + + + + + qtgui_freq_sink_x + + autoscale + False + + + average + 0.2 + + + axislabels + True + + + bw + samp_rate_rx + + + alias + + + + fc + 0 + + + comment + + + + ctrlpanel + True + + + affinity + + + + _enabled + 0 + + + fftsize + 1024 + + + _coordinate + (792, 28) + + + gui_hint + + + + _rotation + 0 + + + grid + True + + + id + qtgui_freq_sink_x_0 + + + legend + True + + + alpha1 + 1.0 + + + color1 + "blue" + + + label1 + + + + width1 + 1 + + + alpha10 + 1.0 + + + color10 + "dark blue" + + + label10 + + + + width10 + 1 + + + alpha2 + 1.0 + + + color2 + "red" + + + label2 + + + + width2 + 1 + + + alpha3 + 1.0 + + + color3 + "green" + + + label3 + + + + width3 + 1 + + + alpha4 + 1.0 + + + color4 + "black" + + + label4 + + + + width4 + 1 + + + alpha5 + 1.0 + + + color5 + "cyan" + + + label5 + + + + width5 + 1 + + + alpha6 + 1.0 + + + color6 + "magenta" + + + label6 + + + + width6 + 1 + + + alpha7 + 1.0 + + + color7 + "yellow" + + + label7 + + + + width7 + 1 + + + alpha8 + 1.0 + + + color8 + "dark red" + + + label8 + + + + width8 + 1 + + + alpha9 + 1.0 + + + color9 + "dark green" + + + label9 + + + + width9 + 1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + name + "" + + + nconnections + 1 + + + showports + True + + + freqhalf + True + + + tr_chan + 0 + + + tr_level + 0.0 + + + tr_mode + qtgui.TRIG_MODE_FREE + + + tr_tag + "" + + + type + complex + + + update_time + 0.01 + + + wintype + firdes.WIN_BLACKMAN_hARRIS + + + label + Relative Gain + + + ymax + 10 + + + ymin + -140 + + + units + dB + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (64, 780) + + + _rotation + 0 + + + id + rigctl_port + + + label + + + + short_id + + + + type + intx + + + value + 4532 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (64, 700) + + + _rotation + 0 + + + id + rx_freq + + + label + + + + short_id + + + + type + eng_float + + + value + 100e6 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (64, 484) + + + _rotation + 0 + + + id + rx_sdr_device + + + label + + + + short_id + + + + type + string + + + value + usrpb200 + + + + satnogs_coarse_doppler_correction_cc + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + _coordinate + (568, 288) + + + _rotation + 0 + + + id + satnogs_coarse_doppler_correction_cc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + sampling_rate + samp_rate_rx + + + target_freq + rx_freq + + + + satnogs_tcp_rigctl_msg_source + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (24, 164) + + + _rotation + 0 + + + id + satnogs_tcp_rigctl_msg_source_0 + + + addr + "127.0.0.1" + + + mtu + 1500 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + mode + False + + + port + rigctl_port + + + interval + 1000 + + + + analog_sig_source_x_0 + blocks_multiply_xx_0 + 0 + 0 + + + blocks_multiply_xx_0 + qtgui_freq_sink_x_0 + 0 + 0 + + + freq_xlating_fir_filter_xxx_0 + blocks_file_sink_0 + 0 + 0 + + + osmosdr_source_0 + blocks_multiply_xx_0 + 0 + 1 + + + osmosdr_source_0 + satnogs_coarse_doppler_correction_cc_0 + 0 + 0 + + + satnogs_coarse_doppler_correction_cc_0 + freq_xlating_fir_filter_xxx_0 + 0 + 0 + + + satnogs_tcp_rigctl_msg_source_0 + satnogs_coarse_doppler_correction_cc_0 + freq + freq + + diff --git a/apps/flowgraphs/satellites/CMakeLists.txt b/apps/flowgraphs/satellites/CMakeLists.txt new file mode 100644 index 0000000..ac61d8a --- /dev/null +++ b/apps/flowgraphs/satellites/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +include(GrPython) + +GR_PYTHON_INSTALL( + PROGRAMS + upsat_transceiver_cli.py + satnogs_noaa_apt_decoder.py + DESTINATION bin +) \ No newline at end of file diff --git a/apps/flowgraphs/satellites/noaa_apt_decoder.grc b/apps/flowgraphs/satellites/noaa_apt_decoder.grc new file mode 100644 index 0000000..32bbbe3 --- /dev/null +++ b/apps/flowgraphs/satellites/noaa_apt_decoder.grc @@ -0,0 +1,2599 @@ + + + + Mon Apr 10 23:26:02 2017 + + options + + author + Manolis Surligas, George Vardakis + + + window_size + 2048,1080 + + + category + [GRC Hier Blocks] + + + comment + + + + description + A NOAA APT Decoder with automatic image synchronization + + + _enabled + True + + + _coordinate + (8, 8) + + + _rotation + 0 + + + generate_options + no_gui + + + hier_block_src_path + .: + + + id + satnogs_noaa_apt_decoder + + + max_nouts + 0 + + + qt_qss_theme + + + + realtime_scheduling + + + + run_command + {python} -u {filename} + + + run_options + run + + + run + True + + + thread_safe_setters + + + + title + NOAA APT Decoder + + + + variable + + comment + Audio decimation after +the quadrature demodulation + + + _enabled + True + + + _coordinate + (927, 459) + + + _rotation + 0 + + + id + audio_decimation + + + value + 2 + + + + variable + + comment + Audio decimation after +the quadrature demodulation + + + _enabled + True + + + _coordinate + (1118, 459) + + + _rotation + 0 + + + id + initial_bandwidth + + + value + 100e3 + + + + variable_low_pass_filter_taps + + beta + 6.76 + + + comment + + + + cutoff_freq + 0.17 + + + _enabled + True + + + _coordinate + (15, 551) + + + _rotation + 0 + + + gain + 1.0 + + + id + noaa_filter_taps + + + samp_rate + 1.0 + + + width + 0.01 + + + win + firdes.WIN_HAMMING + + + + variable + + comment + SDR device +TX sampling rate + + + _enabled + True + + + _coordinate + (791, 459) + + + _rotation + 0 + + + id + samp_rate_rx + + + value + satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] + + + + analog_wfm_rcv + + audio_decimation + audio_decimation + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (935, 123) + + + _rotation + 0 + + + id + analog_wfm_rcv_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + quad_rate + samp_rate_rx / int(samp_rate_rx / initial_bandwidth) + + + + band_pass_filter + + beta + 6.76 + + + alias + + + + comment + + + + affinity + + + + decim + 1 + + + _enabled + True + + + type + fir_filter_fff + + + _coordinate + (1174, 83) + + + _rotation + 0 + + + gain + 6 + + + high_cutoff_freq + 4.2e3 + + + id + band_pass_filter_0 + + + interp + 1 + + + low_cutoff_freq + 500 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_rate + (samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation + + + width + 200 + + + win + firdes.WIN_HAMMING + + + + blocks_complex_to_mag + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1014, 263) + + + _rotation + 180 + + + id + blocks_complex_to_mag_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + vlen + 1 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (15, 459) + + + _rotation + 0 + + + id + doppler_correction_per_sec + + + label + + + + short_id + + + + type + intx + + + value + 1000 + + + + fir_filter_xxx + + alias + + + + comment + + + + affinity + + + + decim + int(samp_rate_rx / initial_bandwidth) + + + _enabled + 1 + + + _coordinate + (719, 123) + + + _rotation + 0 + + + id + fir_filter_xxx_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_delay + 0 + + + taps + noaa_filter_taps + + + type + ccc + + + + fir_filter_xxx + + alias + + + + comment + + + + affinity + + + + decim + 2 + + + _enabled + True + + + _coordinate + (1422, 123) + + + _rotation + 0 + + + id + fir_filter_xxx_1 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + samp_delay + 0 + + + taps + [0.5, 0.5] + + + type + fff + + + + hilbert_fc + + beta + 6.76 + + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (1262, 259) + + + _rotation + 180 + + + id + hilbert_fc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + num_taps + 65 + + + win + firdes.WIN_HAMMING + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (183, 547) + + + _rotation + 0 + + + id + image_file_path + + + label + + + + short_id + + + + type + string + + + value + /tmp/noaa.png + + + + parameter + + alias + + + + comment + To avoid the SDR carrier at the DC +we shift the LO a little further + + + _enabled + True + + + _coordinate + (575, 459) + + + _rotation + 0 + + + id + lo_offset + + + label + + + + short_id + + + + type + eng_float + + + value + 100e3 + + + + osmosdr_source + + alias + + + + ant0 + satnogs.hw_rx_settings[rx_sdr_device]['antenna'] + + + bb_gain0 + satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'] + + + bw0 + samp_rate_rx + + + dc_offset_mode0 + 2 + + + corr0 + ppm + + + freq0 + rx_freq - lo_offset + + + gain_mode0 + False + + + if_gain0 + satnogs.hw_rx_settings[rx_sdr_device]['if_gain'] + + + iq_balance_mode0 + 0 + + + gain0 + satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'] + + + ant10 + + + + bb_gain10 + 20 + + + bw10 + 0 + + + dc_offset_mode10 + 0 + + + corr10 + 0 + + + freq10 + 100e6 + + + gain_mode10 + False + + + if_gain10 + 20 + + + iq_balance_mode10 + 0 + + + gain10 + 10 + + + ant11 + + + + bb_gain11 + 20 + + + bw11 + 0 + + + dc_offset_mode11 + 0 + + + corr11 + 0 + + + freq11 + 100e6 + + + gain_mode11 + False + + + if_gain11 + 20 + + + iq_balance_mode11 + 0 + + + gain11 + 10 + + + ant12 + + + + bb_gain12 + 20 + + + bw12 + 0 + + + dc_offset_mode12 + 0 + + + corr12 + 0 + + + freq12 + 100e6 + + + gain_mode12 + False + + + if_gain12 + 20 + + + iq_balance_mode12 + 0 + + + gain12 + 10 + + + ant13 + + + + bb_gain13 + 20 + + + bw13 + 0 + + + dc_offset_mode13 + 0 + + + corr13 + 0 + + + freq13 + 100e6 + + + gain_mode13 + False + + + if_gain13 + 20 + + + iq_balance_mode13 + 0 + + + gain13 + 10 + + + ant14 + + + + bb_gain14 + 20 + + + bw14 + 0 + + + dc_offset_mode14 + 0 + + + corr14 + 0 + + + freq14 + 100e6 + + + gain_mode14 + False + + + if_gain14 + 20 + + + iq_balance_mode14 + 0 + + + gain14 + 10 + + + ant15 + + + + bb_gain15 + 20 + + + bw15 + 0 + + + dc_offset_mode15 + 0 + + + corr15 + 0 + + + freq15 + 100e6 + + + gain_mode15 + False + + + if_gain15 + 20 + + + iq_balance_mode15 + 0 + + + gain15 + 10 + + + ant16 + + + + bb_gain16 + 20 + + + bw16 + 0 + + + dc_offset_mode16 + 0 + + + corr16 + 0 + + + freq16 + 100e6 + + + gain_mode16 + False + + + if_gain16 + 20 + + + iq_balance_mode16 + 0 + + + gain16 + 10 + + + ant17 + + + + bb_gain17 + 20 + + + bw17 + 0 + + + dc_offset_mode17 + 0 + + + corr17 + 0 + + + freq17 + 100e6 + + + gain_mode17 + False + + + if_gain17 + 20 + + + iq_balance_mode17 + 0 + + + gain17 + 10 + + + ant18 + + + + bb_gain18 + 20 + + + bw18 + 0 + + + dc_offset_mode18 + 0 + + + corr18 + 0 + + + freq18 + 100e6 + + + gain_mode18 + False + + + if_gain18 + 20 + + + iq_balance_mode18 + 0 + + + gain18 + 10 + + + ant19 + + + + bb_gain19 + 20 + + + bw19 + 0 + + + dc_offset_mode19 + 0 + + + corr19 + 0 + + + freq19 + 100e6 + + + gain_mode19 + False + + + if_gain19 + 20 + + + iq_balance_mode19 + 0 + + + gain19 + 10 + + + ant1 + + + + bb_gain1 + 20 + + + bw1 + 0 + + + dc_offset_mode1 + 0 + + + corr1 + 0 + + + freq1 + 100e6 + + + gain_mode1 + False + + + if_gain1 + 20 + + + iq_balance_mode1 + 0 + + + gain1 + 10 + + + ant20 + + + + bb_gain20 + 20 + + + bw20 + 0 + + + dc_offset_mode20 + 0 + + + corr20 + 0 + + + freq20 + 100e6 + + + gain_mode20 + False + + + if_gain20 + 20 + + + iq_balance_mode20 + 0 + + + gain20 + 10 + + + ant21 + + + + bb_gain21 + 20 + + + bw21 + 0 + + + dc_offset_mode21 + 0 + + + corr21 + 0 + + + freq21 + 100e6 + + + gain_mode21 + False + + + if_gain21 + 20 + + + iq_balance_mode21 + 0 + + + gain21 + 10 + + + ant22 + + + + bb_gain22 + 20 + + + bw22 + 0 + + + dc_offset_mode22 + 0 + + + corr22 + 0 + + + freq22 + 100e6 + + + gain_mode22 + False + + + if_gain22 + 20 + + + iq_balance_mode22 + 0 + + + gain22 + 10 + + + ant23 + + + + bb_gain23 + 20 + + + bw23 + 0 + + + dc_offset_mode23 + 0 + + + corr23 + 0 + + + freq23 + 100e6 + + + gain_mode23 + False + + + if_gain23 + 20 + + + iq_balance_mode23 + 0 + + + gain23 + 10 + + + ant24 + + + + bb_gain24 + 20 + + + bw24 + 0 + + + dc_offset_mode24 + 0 + + + corr24 + 0 + + + freq24 + 100e6 + + + gain_mode24 + False + + + if_gain24 + 20 + + + iq_balance_mode24 + 0 + + + gain24 + 10 + + + ant25 + + + + bb_gain25 + 20 + + + bw25 + 0 + + + dc_offset_mode25 + 0 + + + corr25 + 0 + + + freq25 + 100e6 + + + gain_mode25 + False + + + if_gain25 + 20 + + + iq_balance_mode25 + 0 + + + gain25 + 10 + + + ant26 + + + + bb_gain26 + 20 + + + bw26 + 0 + + + dc_offset_mode26 + 0 + + + corr26 + 0 + + + freq26 + 100e6 + + + gain_mode26 + False + + + if_gain26 + 20 + + + iq_balance_mode26 + 0 + + + gain26 + 10 + + + ant27 + + + + bb_gain27 + 20 + + + bw27 + 0 + + + dc_offset_mode27 + 0 + + + corr27 + 0 + + + freq27 + 100e6 + + + gain_mode27 + False + + + if_gain27 + 20 + + + iq_balance_mode27 + 0 + + + gain27 + 10 + + + ant28 + + + + bb_gain28 + 20 + + + bw28 + 0 + + + dc_offset_mode28 + 0 + + + corr28 + 0 + + + freq28 + 100e6 + + + gain_mode28 + False + + + if_gain28 + 20 + + + iq_balance_mode28 + 0 + + + gain28 + 10 + + + ant29 + + + + bb_gain29 + 20 + + + bw29 + 0 + + + dc_offset_mode29 + 0 + + + corr29 + 0 + + + freq29 + 100e6 + + + gain_mode29 + False + + + if_gain29 + 20 + + + iq_balance_mode29 + 0 + + + gain29 + 10 + + + ant2 + + + + bb_gain2 + 20 + + + bw2 + 0 + + + dc_offset_mode2 + 0 + + + corr2 + 0 + + + freq2 + 100e6 + + + gain_mode2 + False + + + if_gain2 + 20 + + + iq_balance_mode2 + 0 + + + gain2 + 10 + + + ant30 + + + + bb_gain30 + 20 + + + bw30 + 0 + + + dc_offset_mode30 + 0 + + + corr30 + 0 + + + freq30 + 100e6 + + + gain_mode30 + False + + + if_gain30 + 20 + + + iq_balance_mode30 + 0 + + + gain30 + 10 + + + ant31 + + + + bb_gain31 + 20 + + + bw31 + 0 + + + dc_offset_mode31 + 0 + + + corr31 + 0 + + + freq31 + 100e6 + + + gain_mode31 + False + + + if_gain31 + 20 + + + iq_balance_mode31 + 0 + + + gain31 + 10 + + + ant3 + + + + bb_gain3 + 20 + + + bw3 + 0 + + + dc_offset_mode3 + 0 + + + corr3 + 0 + + + freq3 + 100e6 + + + gain_mode3 + False + + + if_gain3 + 20 + + + iq_balance_mode3 + 0 + + + gain3 + 10 + + + ant4 + + + + bb_gain4 + 20 + + + bw4 + 0 + + + dc_offset_mode4 + 0 + + + corr4 + 0 + + + freq4 + 100e6 + + + gain_mode4 + False + + + if_gain4 + 20 + + + iq_balance_mode4 + 0 + + + gain4 + 10 + + + ant5 + + + + bb_gain5 + 20 + + + bw5 + 0 + + + dc_offset_mode5 + 0 + + + corr5 + 0 + + + freq5 + 100e6 + + + gain_mode5 + False + + + if_gain5 + 20 + + + iq_balance_mode5 + 0 + + + gain5 + 10 + + + ant6 + + + + bb_gain6 + 20 + + + bw6 + 0 + + + dc_offset_mode6 + 0 + + + corr6 + 0 + + + freq6 + 100e6 + + + gain_mode6 + False + + + if_gain6 + 20 + + + iq_balance_mode6 + 0 + + + gain6 + 10 + + + ant7 + + + + bb_gain7 + 20 + + + bw7 + 0 + + + dc_offset_mode7 + 0 + + + corr7 + 0 + + + freq7 + 100e6 + + + gain_mode7 + False + + + if_gain7 + 20 + + + iq_balance_mode7 + 0 + + + gain7 + 10 + + + ant8 + + + + bb_gain8 + 20 + + + bw8 + 0 + + + dc_offset_mode8 + 0 + + + corr8 + 0 + + + freq8 + 100e6 + + + gain_mode8 + False + + + if_gain8 + 20 + + + iq_balance_mode8 + 0 + + + gain8 + 10 + + + ant9 + + + + bb_gain9 + 20 + + + bw9 + 0 + + + dc_offset_mode9 + 0 + + + corr9 + 0 + + + freq9 + 100e6 + + + gain_mode9 + False + + + if_gain9 + 20 + + + iq_balance_mode9 + 0 + + + gain9 + 10 + + + comment + + + + affinity + + + + args + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] + + + _enabled + 1 + + + _coordinate + (55, 243) + + + _rotation + 0 + + + id + osmosdr_source_0 + + + maxoutbuf + 0 + + + clock_source0 + + + + time_source0 + + + + clock_source1 + + + + time_source1 + + + + clock_source2 + + + + time_source2 + + + + clock_source3 + + + + time_source3 + + + + clock_source4 + + + + time_source4 + + + + clock_source5 + + + + time_source5 + + + + clock_source6 + + + + time_source6 + + + + clock_source7 + + + + time_source7 + + + + minoutbuf + 0 + + + nchan + 1 + + + num_mboards + 1 + + + type + fc32 + + + sample_rate + samp_rate_rx + + + sync + + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (487, 459) + + + _rotation + 0 + + + id + ppm + + + label + + + + short_id + + + + type + intx + + + value + 0 + + + + rational_resampler_xxx + + alias + + + + comment + + + + affinity + + + + decim + int(((samp_rate_rx / int(samp_rate_rx / initial_bandwidth)) / audio_decimation) / 2) + + + _enabled + True + + + fbw + 0 + + + _coordinate + (1438, 239) + + + _rotation + 180 + + + id + rational_resampler_xxx_0 + + + interp + 9600 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + taps + + + + type + fff + + + + rational_resampler_xxx + + alias + + + + comment + + + + affinity + + + + decim + 9600 + + + _enabled + True + + + fbw + 0 + + + _coordinate + (815, 239) + + + _rotation + 180 + + + id + rational_resampler_xxx_0_0 + + + interp + 4160 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + taps + + + + type + fff + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (295, 459) + + + _rotation + 0 + + + id + rigctl_port + + + label + + + + short_id + + + + type + intx + + + value + 4532 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (391, 459) + + + _rotation + 0 + + + id + rx_freq + + + label + + + + short_id + + + + type + eng_float + + + value + 90.4e6 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (175, 459) + + + _rotation + 0 + + + id + rx_sdr_device + + + label + + + + short_id + + + + type + string + + + value + usrpb200 + + + + satnogs_coarse_doppler_correction_cc + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (471, 119) + + + _rotation + 0 + + + id + satnogs_coarse_doppler_correction_cc_0 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + sampling_rate + samp_rate_rx + + + target_freq + rx_freq + + + + satnogs_noaa_apt_sink + + alias + + + + comment + + + + affinity + + + + _enabled + True + + + flip + False + + + _coordinate + (575, 243) + + + _rotation + 180 + + + id + satnogs_noaa_apt_sink_0 + + + filename_png + image_file_path + + + height + 1500 + + + width + 2080 + + + split + True + + + sync + False + + + + satnogs_tcp_rigctl_msg_source + + alias + + + + comment + + + + affinity + + + + _enabled + 1 + + + _coordinate + (223, 47) + + + _rotation + 0 + + + id + satnogs_tcp_rigctl_msg_source_0 + + + addr + "127.0.0.1" + + + mtu + 1500 + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + mode + False + + + port + rigctl_port + + + interval + 1000 + + + + analog_wfm_rcv_0 + band_pass_filter_0 + 0 + 0 + + + band_pass_filter_0 + fir_filter_xxx_1 + 0 + 0 + + + blocks_complex_to_mag_0 + rational_resampler_xxx_0_0 + 0 + 0 + + + fir_filter_xxx_0 + analog_wfm_rcv_0 + 0 + 0 + + + fir_filter_xxx_1 + rational_resampler_xxx_0 + 0 + 0 + + + hilbert_fc_0 + blocks_complex_to_mag_0 + 0 + 0 + + + osmosdr_source_0 + satnogs_coarse_doppler_correction_cc_0 + 0 + 0 + + + rational_resampler_xxx_0 + hilbert_fc_0 + 0 + 0 + + + rational_resampler_xxx_0_0 + satnogs_noaa_apt_sink_0 + 0 + 0 + + + satnogs_coarse_doppler_correction_cc_0 + fir_filter_xxx_0 + 0 + 0 + + + satnogs_tcp_rigctl_msg_source_0 + satnogs_coarse_doppler_correction_cc_0 + freq + freq + + diff --git a/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py b/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py new file mode 100755 index 0000000..0ae3f39 --- /dev/null +++ b/apps/flowgraphs/satellites/satnogs_noaa_apt_decoder.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# 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 +################################################## + +from gnuradio import analog +from gnuradio import blocks +from gnuradio import eng_notation +from gnuradio import filter +from gnuradio import gr +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from optparse import OptionParser +import osmosdr +import satnogs +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'): + gr.top_block.__init__(self, "NOAA APT Decoder") + + ################################################## + # Parameters + ################################################## + self.doppler_correction_per_sec = doppler_correction_per_sec + 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.initial_bandwidth = initial_bandwidth = 100e3 + self.audio_decimation = audio_decimation = 2 + + ################################################## + # Blocks + ################################################## + 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.rational_resampler_xxx_0_0 = filter.rational_resampler_fff( + interpolation=4160, + decimation=9600, + taps=None, + fractional_bw=None, + ) + 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), + taps=None, + fractional_bw=None, + ) + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] ) + self.osmosdr_source_0.set_sample_rate(samp_rate_rx) + self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) + self.osmosdr_source_0.set_freq_corr(ppm, 0) + self.osmosdr_source_0.set_dc_offset_mode(2, 0) + self.osmosdr_source_0.set_iq_balance_mode(0, 0) + self.osmosdr_source_0.set_gain_mode(False, 0) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[rx_sdr_device]['if_gain'], 0) + self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'], 0) + self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[rx_sdr_device]['antenna'], 0) + self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) + + self.hilbert_fc_0 = filter.hilbert_fc(65, firdes.WIN_HAMMING, 6.76) + 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.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)) + self.analog_wfm_rcv_0 = analog.wfm_rcv( + quad_rate=samp_rate_rx / int(samp_rate_rx / initial_bandwidth), + audio_decimation=audio_decimation, + ) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) + self.connect((self.analog_wfm_rcv_0, 0), (self.band_pass_filter_0, 0)) + self.connect((self.band_pass_filter_0, 0), (self.fir_filter_xxx_1, 0)) + 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.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.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)) + + def get_doppler_correction_per_sec(self): + return self.doppler_correction_per_sec + + def set_doppler_correction_per_sec(self, doppler_correction_per_sec): + self.doppler_correction_per_sec = doppler_correction_per_sec + + 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) + + def get_ppm(self): + return self.ppm + + def set_ppm(self, ppm): + self.ppm = ppm + self.osmosdr_source_0.set_freq_corr(self.ppm, 0) + + def get_rigctl_port(self): + return self.rigctl_port + + def set_rigctl_port(self, rigctl_port): + self.rigctl_port = rigctl_port + + def get_rx_freq(self): + return self.rx_freq + + def set_rx_freq(self, rx_freq): + self.rx_freq = rx_freq + self.satnogs_coarse_doppler_correction_cc_0.set_new_freq_locked(self.rx_freq) + self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) + + def get_rx_sdr_device(self): + return self.rx_sdr_device + + def set_rx_sdr_device(self, rx_sdr_device): + self.rx_sdr_device = rx_sdr_device + self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['if_gain'], 0) + 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 + + def set_samp_rate_rx(self, samp_rate_rx): + 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)) + + def get_noaa_filter_taps(self): + return self.noaa_filter_taps + + def set_noaa_filter_taps(self, noaa_filter_taps): + self.noaa_filter_taps = noaa_filter_taps + self.fir_filter_xxx_0.set_taps((self.noaa_filter_taps)) + + def get_initial_bandwidth(self): + return self.initial_bandwidth + + 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)) + + 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)) + + +def argument_parser(): + description = 'A NOAA APT Decoder with automatic image synchronization' + parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) + 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( + "", "--lo-offset", dest="lo_offset", type="eng_float", default=eng_notation.num_to_str(100e3), + help="Set lo_offset [default=%default]") + parser.add_option( + "", "--ppm", dest="ppm", type="intx", default=0, + help="Set ppm [default=%default]") + parser.add_option( + "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532, + help="Set rigctl_port [default=%default]") + parser.add_option( + "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(90.4e6), + help="Set rx_freq [default=%default]") + 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 + + +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.start() + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/apps/flowgraphs/upsat_afsk_receiver.grc b/apps/flowgraphs/satellites/upsat_afsk_receiver.grc similarity index 100% rename from apps/flowgraphs/upsat_afsk_receiver.grc rename to apps/flowgraphs/satellites/upsat_afsk_receiver.grc diff --git a/apps/flowgraphs/upsat_afsk_transmitter.grc b/apps/flowgraphs/satellites/upsat_afsk_transmitter.grc similarity index 100% rename from apps/flowgraphs/upsat_afsk_transmitter.grc rename to apps/flowgraphs/satellites/upsat_afsk_transmitter.grc diff --git a/apps/flowgraphs/upsat_fsk_receiver.grc b/apps/flowgraphs/satellites/upsat_fsk_receiver.grc similarity index 100% rename from apps/flowgraphs/upsat_fsk_receiver.grc rename to apps/flowgraphs/satellites/upsat_fsk_receiver.grc diff --git a/apps/flowgraphs/upsat_fsk_transmitter.grc b/apps/flowgraphs/satellites/upsat_fsk_transmitter.grc similarity index 100% rename from apps/flowgraphs/upsat_fsk_transmitter.grc rename to apps/flowgraphs/satellites/upsat_fsk_transmitter.grc diff --git a/apps/flowgraphs/upsat_transceiver_cli.grc b/apps/flowgraphs/satellites/upsat_transceiver_cli.grc similarity index 99% rename from apps/flowgraphs/upsat_transceiver_cli.grc rename to apps/flowgraphs/satellites/upsat_transceiver_cli.grc index fe92a65..09d37b8 100644 --- a/apps/flowgraphs/upsat_transceiver_cli.grc +++ b/apps/flowgraphs/satellites/upsat_transceiver_cli.grc @@ -1,5 +1,5 @@ - + Fri Jul 1 17:53:00 2016 @@ -78,7 +78,7 @@ title - + UPSat Tranceiver @@ -3676,6 +3676,10 @@ we shift the LO a little further average 1.0 + + axislabels + True + bw samp_rate_rx/decimation_rx @@ -3944,6 +3948,10 @@ we shift the LO a little further wintype firdes.WIN_BLACKMAN_hARRIS + + label + Relative Gain + ymax 0 @@ -3952,6 +3960,10 @@ we shift the LO a little further ymin -140 + + units + dB + parameter diff --git a/apps/flowgraphs/upsat_transceiver_cli.py b/apps/flowgraphs/satellites/upsat_transceiver_cli.py similarity index 98% rename from apps/flowgraphs/upsat_transceiver_cli.py rename to apps/flowgraphs/satellites/upsat_transceiver_cli.py index e566cbe..de55623 100755 --- a/apps/flowgraphs/upsat_transceiver_cli.py +++ b/apps/flowgraphs/satellites/upsat_transceiver_cli.py @@ -2,10 +2,10 @@ # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph -# Title: Upsat Transceiver Cli +# Title: UPSat Tranceiver # Author: Manolis Surligas (surligas@gmail.com) # Description: SATNOGS transceiver for UPSAT satellite -# Generated: Sun Aug 14 22:13:27 2016 +# Generated: Wed Oct 12 20:16:02 2016 ################################################## from gnuradio import analog @@ -28,7 +28,7 @@ import time class upsat_transceiver_cli(gr.top_block): def __init__(self, bind_addr="0.0.0.0", dest_addr="127.0.0.1", lo_offset=100e3, recv_port=16886, rx_sdr_device="usrpb200", send_port=5022, tx_sdr_device="usrpb200", wod_port=5023): - gr.top_block.__init__(self, "Upsat Transceiver Cli") + gr.top_block.__init__(self, "UPSat Tranceiver") ################################################## # Parameters @@ -150,10 +150,10 @@ class upsat_transceiver_cli(gr.top_block): def set_lo_offset(self, lo_offset): self.lo_offset = lo_offset - self.analog_sig_source_x_0.set_frequency(self.lo_offset ) - self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset) - self.osmosdr_sink_0.set_center_freq(self.tx_frequency - self.lo_offset, 0) self.osmosdr_source_0.set_center_freq(self.rx_frequency - self.lo_offset, 0) + self.osmosdr_sink_0.set_center_freq(self.tx_frequency - self.lo_offset, 0) + self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset) + self.analog_sig_source_x_0.set_frequency(self.lo_offset ) def get_recv_port(self): return self.recv_port @@ -166,8 +166,8 @@ class upsat_transceiver_cli(gr.top_block): def set_rx_sdr_device(self, rx_sdr_device): self.rx_sdr_device = rx_sdr_device - self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) self.set_samp_rate_tx(satnogs.hw_tx_settings[self.rx_sdr_device]['samp_rate']) + self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['rf_gain'], 0) self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['if_gain'], 0) self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['bb_gain'], 0) @@ -200,10 +200,10 @@ class upsat_transceiver_cli(gr.top_block): def set_samples_per_symbol_tx(self, samples_per_symbol_tx): self.samples_per_symbol_tx = samples_per_symbol_tx - self.set_gaussian_taps(filter.firdes.gaussian(1.0, self.samples_per_symbol_tx, 1.0, 4*self.samples_per_symbol_tx)) self.set_sq_wave((1.0, ) * self.samples_per_symbol_tx) - self.analog_frequency_modulator_fc_0.set_sensitivity((math.pi*self.modulation_index_uplink) / self.samples_per_symbol_tx) self.pfb_arb_resampler_xxx_0.set_rate(self.samp_rate_tx / (self.baud_rate_uplink * self.samples_per_symbol_tx)) + self.set_gaussian_taps(filter.firdes.gaussian(1.0, self.samples_per_symbol_tx, 1.0, 4*self.samples_per_symbol_tx)) + self.analog_frequency_modulator_fc_0.set_sensitivity((math.pi*self.modulation_index_uplink) / self.samples_per_symbol_tx) def get_sq_wave(self): return self.sq_wave @@ -233,8 +233,8 @@ class upsat_transceiver_cli(gr.top_block): def set_deviation(self, deviation): self.deviation = deviation - self.set_modulation_index_downlink(self.deviation / (self.baud_rate_downlink / 2.0)) self.set_modulation_index_uplink(self.deviation / (self.baud_rate_uplink / 2.0)) + self.set_modulation_index_downlink(self.deviation / (self.baud_rate_downlink / 2.0)) def get_decimation_rx(self): return self.decimation_rx @@ -257,8 +257,8 @@ class upsat_transceiver_cli(gr.top_block): def set_baud_rate_downlink(self, baud_rate_downlink): self.baud_rate_downlink = baud_rate_downlink self.set_modulation_index_downlink(self.deviation / (self.baud_rate_downlink / 2.0)) - self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) self.digital_clock_recovery_mm_xx_0.set_omega(self.first_stage_samp_rate_rx/self.baud_rate_downlink) + self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) def get_tx_frequency(self): return self.tx_frequency @@ -279,10 +279,10 @@ class upsat_transceiver_cli(gr.top_block): def set_samp_rate_tx(self, samp_rate_tx): self.samp_rate_tx = samp_rate_tx - self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate_tx) + self.pfb_arb_resampler_xxx_0.set_rate(self.samp_rate_tx / (self.baud_rate_uplink * self.samples_per_symbol_tx)) self.osmosdr_sink_0.set_sample_rate(self.samp_rate_tx) self.osmosdr_sink_0.set_bandwidth(self.samp_rate_tx, 0) - self.pfb_arb_resampler_xxx_0.set_rate(self.samp_rate_tx / (self.baud_rate_uplink * self.samples_per_symbol_tx)) + self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate_tx) def get_rx_frequency(self): return self.rx_frequency @@ -317,12 +317,13 @@ class upsat_transceiver_cli(gr.top_block): def set_first_stage_samp_rate_rx(self, first_stage_samp_rate_rx): self.first_stage_samp_rate_rx = first_stage_samp_rate_rx - self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) self.digital_clock_recovery_mm_xx_0.set_omega(self.first_stage_samp_rate_rx/self.baud_rate_downlink) + self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) def argument_parser(): - parser = OptionParser(option_class=eng_option, usage="%prog: [options]") + description = 'SATNOGS transceiver for UPSAT satellite' + parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) parser.add_option( "", "--bind-addr", dest="bind_addr", type="string", default="0.0.0.0", help="Set bind_addr [default=%default]") diff --git a/apps/flowgraphs/upsat_transceiver_qt.grc b/apps/flowgraphs/satellites/upsat_transceiver_qt.grc similarity index 91% rename from apps/flowgraphs/upsat_transceiver_qt.grc rename to apps/flowgraphs/satellites/upsat_transceiver_qt.grc index da1f596..7e96555 100644 --- a/apps/flowgraphs/upsat_transceiver_qt.grc +++ b/apps/flowgraphs/satellites/upsat_transceiver_qt.grc @@ -1,12 +1,12 @@ - + Fri Jul 1 17:53:00 2016 options author - + Manolis Surligas (surligas@gmail.com) window_size @@ -22,7 +22,7 @@ description - + SATNOGS transceiver for UPSAT satellite _enabled @@ -30,7 +30,7 @@ _coordinate - (8, 8) + (8, 12) _rotation @@ -78,7 +78,7 @@ title - + UPSat Transceiver QT @@ -93,7 +93,7 @@ _coordinate - (544, 5) + (1048, 16) _rotation @@ -101,7 +101,7 @@ id - baud_rate + baud_rate_downlink value @@ -109,14 +109,10 @@ - variable_qtgui_range + variable comment - - - - value - 0 + FSK baud rate _enabled @@ -124,11 +120,7 @@ _coordinate - (1296, 1) - - - gui_hint - + (1048, 112) _rotation @@ -136,102 +128,11 @@ id - bb_gain_rx - - - label - BB Gain RX - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 40 - - - rangeType - float - - - widget - counter_slider - - - - variable_qtgui_range - - comment - + baud_rate_uplink value - 0 - - - _enabled - True - - - _coordinate - (1304, 137) - - - gui_hint - - - - _rotation - 0 - - - id - bb_gain_tx - - - label - BB Gain TX - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 40 - - - rangeType - float - - - widget - counter_slider + 1200 @@ -248,7 +149,7 @@ SDR received samples _coordinate - (664, 109) + (696, 20) _rotation @@ -275,7 +176,7 @@ SDR received samples _coordinate - (368, 5) + (840, 20) _rotation @@ -302,7 +203,34 @@ SDR received samples _coordinate - (8, 325) + (168, 932) + + + _rotation + 0 + + + id + first_stage_samp_rate_rx + + + value + samp_rate_rx / decimation_rx + + + + variable + + comment + + + + _enabled + True + + + _coordinate + (16, 904) _rotation @@ -317,132 +245,6 @@ SDR received samples filter.firdes.gaussian(1.0, samples_per_symbol_tx, 1.0, 4*samples_per_symbol_tx) - - variable_qtgui_range - - comment - - - - value - 0 - - - _enabled - True - - - _coordinate - (1192, 1) - - - gui_hint - - - - _rotation - 0 - - - id - if_gain_rx - - - label - IF Gain RX - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 40 - - - rangeType - float - - - widget - counter_slider - - - - variable_qtgui_range - - comment - - - - value - 0 - - - _enabled - True - - - _coordinate - (1192, 137) - - - gui_hint - - - - _rotation - 0 - - - id - if_gain_tx - - - label - IF Gain TX - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 40 - - - rangeType - float - - - widget - counter_slider - - variable @@ -455,7 +257,7 @@ SDR received samples _coordinate - (8, 453) + (168, 1004) _rotation @@ -474,16 +276,15 @@ SDR received samples variable comment - To avoid the SDR carrier at the DC -we shift the LO a little further + _enabled - 1 + True _coordinate - (784, 5) + (296, 16) _rotation @@ -491,11 +292,11 @@ we shift the LO a little further id - lo_offset + modulation_index_downlink value - 100e3 + deviation / (baud_rate_downlink / 2.0) @@ -510,7 +311,7 @@ we shift the LO a little further _coordinate - (8, 253) + (296, 80) _rotation @@ -518,137 +319,11 @@ we shift the LO a little further id - modulation_index + modulation_index_uplink value - deviation / (baud_rate / 2.0) - - - - variable_qtgui_range - - comment - - - - value - 0 - - - _enabled - True - - - _coordinate - (1080, 1) - - - gui_hint - - - - _rotation - 0 - - - id - rf_gain_rx - - - label - RF Gain RX - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 40 - - - rangeType - float - - - widget - counter_slider - - - - variable_qtgui_range - - comment - - - - value - 0 - - - _enabled - True - - - _coordinate - (1080, 137) - - - gui_hint - - - - _rotation - 0 - - - id - rf_gain_tx - - - label - RF Gain TX - - - min_len - 200 - - - orient - Qt.Horizontal - - - start - 0 - - - step - 0.5 - - - stop - 70 - - - rangeType - float - - - widget - counter_slider + deviation / (baud_rate_uplink / 2.0) @@ -664,7 +339,7 @@ we shift the LO a little further _coordinate - (808, 109) + (1368, 16) _rotation @@ -692,7 +367,7 @@ TX sampling rate _coordinate - (528, 109) + (752, 900) _rotation @@ -704,7 +379,7 @@ TX sampling rate value - 1e6 + satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] @@ -720,7 +395,7 @@ TX sampling rate _coordinate - (248, 5) + (760, 776) _rotation @@ -732,7 +407,7 @@ TX sampling rate value - 2e6 + satnogs.hw_tx_settings[rx_sdr_device]['samp_rate'] @@ -750,7 +425,7 @@ is too great and becomes a bottlneck. _coordinate - (8, 109) + (472, 12) _rotation @@ -777,7 +452,7 @@ is too great and becomes a bottlneck. _coordinate - (8, 389) + (16, 984) _rotation @@ -812,7 +487,7 @@ is too great and becomes a bottlneck. _coordinate - (16, 762) + (16, 760) _rotation @@ -852,7 +527,7 @@ is too great and becomes a bottlneck. _coordinate - (648, 5) + (1216, 16) _rotation @@ -887,7 +562,7 @@ is too great and becomes a bottlneck. _coordinate - (1200, 308) + (792, 232) _rotation @@ -907,7 +582,7 @@ is too great and becomes a bottlneck. sensitivity - (math.pi*modulation_index) / samples_per_symbol_tx + (math.pi*modulation_index_uplink) / samples_per_symbol_tx @@ -930,7 +605,7 @@ is too great and becomes a bottlneck. _coordinate - (568, 644) + (552, 528) _rotation @@ -938,7 +613,7 @@ is too great and becomes a bottlneck. gain - ((samp_rate_rx/decimation_rx) / baud_rate)/(math.pi*modulation_index) + ((first_stage_samp_rate_rx) / baud_rate_downlink)/(math.pi*modulation_index_downlink) id @@ -981,7 +656,7 @@ is too great and becomes a bottlneck. _coordinate - (1008, 376) + (952, 272) _rotation @@ -1016,6 +691,49 @@ is too great and becomes a bottlneck. analog.GR_COS_WAVE + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (272, 756) + + + _rotation + 0 + + + id + bind_addr + + + label + + + + short_id + + + + type + string + + + value + 0.0.0.0 + + blocks_multiply_xx @@ -1036,7 +754,7 @@ is too great and becomes a bottlneck. _coordinate - (824, 464) + (832, 352) _rotation @@ -1083,7 +801,7 @@ is too great and becomes a bottlneck. _coordinate - (208, 918) + (272, 844) _rotation @@ -1130,7 +848,7 @@ is too great and becomes a bottlneck. _coordinate - (1024, 648) + (944, 528) _rotation @@ -1169,7 +887,7 @@ is too great and becomes a bottlneck. _coordinate - (776, 616) + (736, 496) _rotation @@ -1205,7 +923,7 @@ is too great and becomes a bottlneck. omega - (samp_rate_rx/decimation_rx)/baud_rate + first_stage_samp_rate_rx/baud_rate_downlink type @@ -1240,7 +958,7 @@ is too great and becomes a bottlneck. _coordinate - (304, 623) + (304, 504) _rotation @@ -1287,7 +1005,7 @@ is too great and becomes a bottlneck. _coordinate - (1472, 60) + (184, 64) _rotation @@ -1318,7 +1036,7 @@ is too great and becomes a bottlneck. _coordinate - (1480, 4) + (184, 16) _rotation @@ -1349,7 +1067,7 @@ is too great and becomes a bottlneck. _coordinate - (1480, 108) + (184, 112) _rotation @@ -1384,7 +1102,7 @@ is too great and becomes a bottlneck. _coordinate - (920, 293) + (592, 224) _rotation @@ -1419,6 +1137,50 @@ is too great and becomes a bottlneck. fff + + parameter + + alias + + + + comment + To avoid the SDR carrier at the DC +we shift the LO a little further + + + _enabled + True + + + _coordinate + (888, 772) + + + _rotation + 0 + + + id + lo_offset + + + label + + + + short_id + + + + type + eng_float + + + value + 100e3 + + osmosdr_sink @@ -1427,11 +1189,11 @@ is too great and becomes a bottlneck. ant0 - + satnogs.hw_tx_settings[tx_sdr_device]['antenna'] bb_gain0 - bb_gain_tx + satnogs.hw_tx_settings[tx_sdr_device]['bb_gain'] bw0 @@ -1447,11 +1209,11 @@ is too great and becomes a bottlneck. if_gain0 - if_gain_tx + satnogs.hw_tx_settings[tx_sdr_device]['if_gain'] gain0 - rf_gain_tx + satnogs.hw_tx_settings[tx_sdr_device]['rf_gain'] ant10 @@ -2331,7 +2093,7 @@ is too great and becomes a bottlneck. args - + satnogs.hw_tx_settings[rx_sdr_device]['dev_arg'] _enabled @@ -2339,7 +2101,7 @@ is too great and becomes a bottlneck. _coordinate - (416, 434) + (544, 312) _rotation @@ -2442,11 +2204,11 @@ is too great and becomes a bottlneck. ant0 - + satnogs.hw_rx_settings[rx_sdr_device]['antenna'] bb_gain0 - bb_gain_rx + satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'] bw0 @@ -2470,7 +2232,7 @@ is too great and becomes a bottlneck. if_gain0 - if_gain_rx + satnogs.hw_rx_settings[rx_sdr_device]['if_gain'] iq_balance_mode0 @@ -2478,7 +2240,7 @@ is too great and becomes a bottlneck. gain0 - rf_gain_rx + satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'] ant10 @@ -3730,7 +3492,7 @@ is too great and becomes a bottlneck. args - + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] _enabled @@ -3738,7 +3500,7 @@ is too great and becomes a bottlneck. _coordinate - (32, 565) + (64, 440) _rotation @@ -3861,7 +3623,7 @@ is too great and becomes a bottlneck. _coordinate - (1232, 471) + (1080, 360) _rotation @@ -3885,7 +3647,7 @@ is too great and becomes a bottlneck. rrate - samp_rate_tx / (baud_rate * samples_per_symbol_tx) + samp_rate_tx / (baud_rate_uplink * samples_per_symbol_tx) samp_delay @@ -3914,6 +3676,10 @@ is too great and becomes a bottlneck. average 1.0 + + axislabels + True + bw samp_rate_rx/decimation_rx @@ -3940,7 +3706,7 @@ is too great and becomes a bottlneck. _enabled - 0 + 1 fftsize @@ -3948,7 +3714,7 @@ is too great and becomes a bottlneck. _coordinate - (552, 722) + (312, 408) gui_hint @@ -3956,7 +3722,7 @@ is too great and becomes a bottlneck. _rotation - 0 + 180 grid @@ -4182,6 +3948,10 @@ is too great and becomes a bottlneck. wintype firdes.WIN_BLACKMAN_hARRIS + + label + Relative Gain + ymax 0 @@ -4190,9 +3960,326 @@ is too great and becomes a bottlneck. ymin -140 + + units + dB + + + + qtgui_waterfall_sink_x + + axislabels + True + + + bw + 50e3 + + + alias + + + + fc + 0 + + + comment + + + + affinity + + + + _enabled + True + + + fftsize + 1024 + + + _coordinate + (296, 628) + + + gui_hint + + + + _rotation + 180 + + + grid + False + + + id + qtgui_waterfall_sink_x_0 + + + int_max + 10 + + + int_min + -140 + + + legend + True + + + alpha1 + 1.0 + + + color1 + 0 + + + label1 + + + + alpha10 + 1.0 + + + color10 + 0 + + + label10 + + + + alpha2 + 1.0 + + + color2 + 0 + + + label2 + + + + alpha3 + 1.0 + + + color3 + 0 + + + label3 + + + + alpha4 + 1.0 + + + color4 + 0 + + + label4 + + + + alpha5 + 1.0 + + + color5 + 0 + + + label5 + + + + alpha6 + 1.0 + + + color6 + 0 + + + label6 + + + + alpha7 + 1.0 + + + color7 + 0 + + + label7 + + + + alpha8 + 1.0 + + + color8 + 0 + + + label8 + + + + alpha9 + 1.0 + + + color9 + 0 + + + label9 + + + + maxoutbuf + 0 + + + minoutbuf + 0 + + + name + "" + + + nconnections + 1 + + + showports + True + + + freqhalf + True + + + type + complex + + + update_time + 0.10 + + + wintype + firdes.WIN_BLACKMAN_hARRIS + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (168, 756) + + + _rotation + 0 + + + id + recv_port + + + label + + + + short_id + + + + type + intx + + + value + 16886 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (648, 900) + + + _rotation + 0 + + + id + rx_sdr_device + + + label + + + + short_id + + + + type + string + + + value + usrpb200 + satnogs_ax25_decoder_bm + + n_sync_flags + 3 + alias @@ -4215,7 +4302,7 @@ is too great and becomes a bottlneck. _coordinate - (1272, 760) + (1312, 584) _rotation @@ -4250,57 +4337,6 @@ is too great and becomes a bottlneck. 0 - - satnogs_debug_msg_source - - alias - - - - comment - - - - affinity - - - - delay - 0.4 - - - _enabled - 0 - - - _coordinate - (232, 190) - - - _rotation - 0 - - - id - satnogs_debug_msg_source_0 - - - maxoutbuf - 0 - - - msg - 'HELLO UPSAT FROM EARTH' * 3 - - - minoutbuf - 0 - - - repeat - True - - satnogs_multi_format_msg_sink @@ -4317,19 +4353,19 @@ is too great and becomes a bottlneck. _enabled - 1 + True _coordinate - (1056, 916) + (1080, 560) _rotation - 0 + 180 id - satnogs_multi_format_msg_sink_0_0_0 + satnogs_multi_format_msg_sink_0 format @@ -4356,7 +4392,7 @@ is too great and becomes a bottlneck. _coordinate - (1024, 792) + (968, 624) _rotation @@ -4399,7 +4435,7 @@ is too great and becomes a bottlneck. _coordinate - (744, 862) + (728, 672) _rotation @@ -4407,7 +4443,7 @@ is too great and becomes a bottlneck. id - satnogs_udp_msg_sink_0_0_0 + satnogs_udp_msg_sink_0_0 addr @@ -4442,7 +4478,7 @@ is too great and becomes a bottlneck. _coordinate - (744, 774) + (728, 600) _rotation @@ -4450,7 +4486,7 @@ is too great and becomes a bottlneck. id - satnogs_udp_msg_sink_0_0_0_0 + satnogs_udp_msg_sink_0_0_0 addr @@ -4487,7 +4523,7 @@ similar to produce dynamic payloads. _coordinate - (240, 294) + (16, 208) _rotation @@ -4499,7 +4535,7 @@ similar to produce dynamic payloads. addr - "0.0.0.0" + bind_addr mtu @@ -4509,13 +4545,17 @@ similar to produce dynamic payloads. maxoutbuf 0 + + msg_type + 0 + minoutbuf 0 port - 16886 + recv_port @@ -4554,7 +4594,7 @@ similar to produce dynamic payloads. _coordinate - (544, 224) + (304, 152) _rotation @@ -4621,7 +4661,7 @@ similar to produce dynamic payloads. _coordinate - (24, 918) + (168, 844) _rotation @@ -4664,7 +4704,50 @@ similar to produce dynamic payloads. _coordinate - (112, 918) + (648, 776) + + + _rotation + 0 + + + id + tx_sdr_device + + + label + + + + short_id + + + + type + string + + + value + usrpb200 + + + + parameter + + alias + + + + comment + + + + _enabled + True + + + _coordinate + (552, 780) _rotation @@ -4739,6 +4822,12 @@ similar to produce dynamic payloads. 0 0 + + freq_xlating_fir_filter_xxx_0 + qtgui_waterfall_sink_x_0 + 0 + 0 + interp_fir_filter_xxx_0 analog_frequency_modulator_fc_0 @@ -4757,39 +4846,27 @@ similar to produce dynamic payloads. 0 0 + + satnogs_ax25_decoder_bm_0 + satnogs_multi_format_msg_sink_0 + failed_pdu + in + satnogs_ax25_decoder_bm_0 satnogs_qb50_deframer_0 pdu in - - satnogs_debug_msg_source_0 - satnogs_upsat_fsk_frame_encoder_0 - msg - pdu - satnogs_qb50_deframer_0 - satnogs_multi_format_msg_sink_0_0_0 + satnogs_udp_msg_sink_0_0 out in satnogs_qb50_deframer_0 satnogs_udp_msg_sink_0_0_0 - out - in - - - satnogs_qb50_deframer_0 - satnogs_multi_format_msg_sink_0_0_0 - wod - in - - - satnogs_qb50_deframer_0 - satnogs_udp_msg_sink_0_0_0_0 wod in diff --git a/apps/flowgraphs/satellites/upsat_transceiver_qt.py b/apps/flowgraphs/satellites/upsat_transceiver_qt.py new file mode 100755 index 0000000..4a7a276 --- /dev/null +++ b/apps/flowgraphs/satellites/upsat_transceiver_qt.py @@ -0,0 +1,498 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: UPSat Transceiver QT +# Author: Manolis Surligas (surligas@gmail.com) +# Description: SATNOGS transceiver for UPSAT satellite +# Generated: Sun Feb 5 13:59:36 2017 +################################################## + +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 PyQt4 import Qt +from gnuradio import analog +from gnuradio import blocks +from gnuradio import digital +from gnuradio import eng_notation +from gnuradio import filter +from gnuradio import gr +from gnuradio import qtgui +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from gnuradio.filter import pfb +from optparse import OptionParser +import math +import numpy +import osmosdr +import satnogs +import sip +import sys +import time + + +class upsat_transceiver_qt(gr.top_block, Qt.QWidget): + + def __init__(self, bind_addr='0.0.0.0', dest_addr='127.0.0.1', lo_offset=100e3, recv_port=16886, rx_sdr_device='usrpb200', send_port=5022, tx_sdr_device='usrpb200', wod_port=5023): + gr.top_block.__init__(self, "UPSat Transceiver QT") + Qt.QWidget.__init__(self) + self.setWindowTitle("UPSat Transceiver QT") + 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", "upsat_transceiver_qt") + self.restoreGeometry(self.settings.value("geometry").toByteArray()) + + ################################################## + # Parameters + ################################################## + self.bind_addr = bind_addr + self.dest_addr = dest_addr + self.lo_offset = lo_offset + self.recv_port = recv_port + self.rx_sdr_device = rx_sdr_device + self.send_port = send_port + self.tx_sdr_device = tx_sdr_device + self.wod_port = wod_port + + ################################################## + # Variables + ################################################## + self.samples_per_symbol_tx = samples_per_symbol_tx = 4*8 + self.sq_wave = sq_wave = (1.0, ) * samples_per_symbol_tx + self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] + self.gaussian_taps = gaussian_taps = filter.firdes.gaussian(1.0, samples_per_symbol_tx, 1.0, 4*samples_per_symbol_tx) + self.deviation = deviation = 3.9973e3 + self.decimation_rx = decimation_rx = 20 + self.baud_rate_uplink = baud_rate_uplink = 1200 + self.baud_rate_downlink = baud_rate_downlink = 9600 + self.tx_frequency = tx_frequency = 145.835e6 + + self.taps = taps = firdes.low_pass(1.0, samp_rate_rx, 20000, 60000, firdes.WIN_HAMMING, 6.76) + + self.samp_rate_tx = samp_rate_tx = satnogs.hw_tx_settings[rx_sdr_device]['samp_rate'] + self.rx_frequency = rx_frequency = 435.765e6 + self.modulation_index_uplink = modulation_index_uplink = deviation / (baud_rate_uplink / 2.0) + self.modulation_index_downlink = modulation_index_downlink = deviation / (baud_rate_downlink / 2.0) + self.interp_taps = interp_taps = numpy.convolve(numpy.array(gaussian_taps), numpy.array(sq_wave)) + self.first_stage_samp_rate_rx = first_stage_samp_rate_rx = samp_rate_rx / decimation_rx + + ################################################## + # Blocks + ################################################## + self.satnogs_upsat_fsk_frame_encoder_0 = satnogs.upsat_fsk_frame_encoder([0x33]*8 , [0x7A, 0x0E], False, False, False, True, True, 'ABCD', 0, 'ON02GR', 0, 64) + self.satnogs_udp_msg_source_0 = satnogs.udp_msg_source(bind_addr, recv_port, 1500, 0) + self.satnogs_udp_msg_sink_0_0_0 = satnogs.udp_msg_sink(dest_addr, wod_port, 1500) + self.satnogs_udp_msg_sink_0_0 = satnogs.udp_msg_sink(dest_addr, send_port, 1500) + self.satnogs_qb50_deframer_0 = satnogs.qb50_deframer(0xe) + self.satnogs_multi_format_msg_sink_0 = satnogs.multi_format_msg_sink(1) + self.satnogs_ax25_decoder_bm_0 = satnogs.ax25_decoder_bm('GND', 0, False, True, 256, 3) + self.qtgui_waterfall_sink_x_0 = qtgui.waterfall_sink_c( + 1024, #size + firdes.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + 50e3, #bw + "", #name + 1 #number of inputs + ) + self.qtgui_waterfall_sink_x_0.set_update_time(0.10) + self.qtgui_waterfall_sink_x_0.enable_grid(False) + self.qtgui_waterfall_sink_x_0.enable_axis_labels(True) + + if not True: + self.qtgui_waterfall_sink_x_0.disable_legend() + + if "complex" == "float" or "complex" == "msg_float": + self.qtgui_waterfall_sink_x_0.set_plot_pos_half(not True) + + labels = ['', '', '', '', '', + '', '', '', '', ''] + colors = [0, 0, 0, 0, 0, + 0, 0, 0, 0, 0] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + for i in xrange(1): + if len(labels[i]) == 0: + self.qtgui_waterfall_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_waterfall_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_waterfall_sink_x_0.set_color_map(i, colors[i]) + self.qtgui_waterfall_sink_x_0.set_line_alpha(i, alphas[i]) + + self.qtgui_waterfall_sink_x_0.set_intensity_range(-140, 10) + + self._qtgui_waterfall_sink_x_0_win = sip.wrapinstance(self.qtgui_waterfall_sink_x_0.pyqwidget(), Qt.QWidget) + self.top_layout.addWidget(self._qtgui_waterfall_sink_x_0_win) + self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c( + 1024, #size + firdes.WIN_BLACKMAN_hARRIS, #wintype + 0, #fc + samp_rate_rx/decimation_rx, #bw + "", #name + 1 #number of inputs + ) + self.qtgui_freq_sink_x_0.set_update_time(0.01) + self.qtgui_freq_sink_x_0.set_y_axis(-140, 0) + self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB') + self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "") + self.qtgui_freq_sink_x_0.enable_autoscale(False) + self.qtgui_freq_sink_x_0.enable_grid(True) + self.qtgui_freq_sink_x_0.set_fft_average(1.0) + self.qtgui_freq_sink_x_0.enable_axis_labels(True) + self.qtgui_freq_sink_x_0.enable_control_panel(True) + + if not True: + self.qtgui_freq_sink_x_0.disable_legend() + + if "complex" == "float" or "complex" == "msg_float": + self.qtgui_freq_sink_x_0.set_plot_pos_half(not True) + + labels = ['', '', '', '', '', + '', '', '', '', ''] + widths = [1, 1, 1, 1, 1, + 1, 1, 1, 1, 1] + colors = ["blue", "red", "green", "black", "cyan", + "magenta", "yellow", "dark red", "dark green", "dark blue"] + alphas = [1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0] + for i in xrange(1): + if len(labels[i]) == 0: + self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i)) + else: + self.qtgui_freq_sink_x_0.set_line_label(i, labels[i]) + self.qtgui_freq_sink_x_0.set_line_width(i, widths[i]) + self.qtgui_freq_sink_x_0.set_line_color(i, colors[i]) + self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i]) + + self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget) + self.top_layout.addWidget(self._qtgui_freq_sink_x_0_win) + self.pfb_arb_resampler_xxx_0 = pfb.arb_resampler_ccf( + samp_rate_tx / (baud_rate_uplink * samples_per_symbol_tx), + taps=(firdes.low_pass_2(32, 32, 0.8, 0.1, 60)), + flt_size=32) + self.pfb_arb_resampler_xxx_0.declare_sample_delay(0) + + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] ) + self.osmosdr_source_0.set_sample_rate(samp_rate_rx) + self.osmosdr_source_0.set_center_freq(rx_frequency - lo_offset, 0) + self.osmosdr_source_0.set_freq_corr(0, 0) + self.osmosdr_source_0.set_dc_offset_mode(0, 0) + self.osmosdr_source_0.set_iq_balance_mode(0, 0) + self.osmosdr_source_0.set_gain_mode(False, 0) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[rx_sdr_device]['if_gain'], 0) + self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'], 0) + self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[rx_sdr_device]['antenna'], 0) + self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) + + self.osmosdr_sink_0 = osmosdr.sink( args="numchan=" + str(1) + " " + satnogs.hw_tx_settings[rx_sdr_device]['dev_arg'] ) + self.osmosdr_sink_0.set_sample_rate(samp_rate_tx) + self.osmosdr_sink_0.set_center_freq(tx_frequency - lo_offset, 0) + self.osmosdr_sink_0.set_freq_corr(0, 0) + self.osmosdr_sink_0.set_gain(satnogs.hw_tx_settings[tx_sdr_device]['rf_gain'], 0) + self.osmosdr_sink_0.set_if_gain(satnogs.hw_tx_settings[tx_sdr_device]['if_gain'], 0) + self.osmosdr_sink_0.set_bb_gain(satnogs.hw_tx_settings[tx_sdr_device]['bb_gain'], 0) + self.osmosdr_sink_0.set_antenna(satnogs.hw_tx_settings[tx_sdr_device]['antenna'], 0) + self.osmosdr_sink_0.set_bandwidth(samp_rate_tx, 0) + + self.interp_fir_filter_xxx_0 = filter.interp_fir_filter_fff(samples_per_symbol_tx, (interp_taps)) + self.interp_fir_filter_xxx_0.declare_sample_delay(0) + self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(decimation_rx, (taps), lo_offset, samp_rate_rx) + self.digital_clock_recovery_mm_xx_0 = digital.clock_recovery_mm_ff(first_stage_samp_rate_rx/baud_rate_downlink, 0.25*0.175*0.175, 0.5, 0.175, 0.005) + self.digital_binary_slicer_fb_0 = digital.binary_slicer_fb() + self.blocks_multiply_xx_0 = blocks.multiply_vcc(1) + self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate_tx, analog.GR_COS_WAVE, lo_offset , 1, 0) + self.analog_quadrature_demod_cf_0_0 = analog.quadrature_demod_cf(((first_stage_samp_rate_rx) / baud_rate_downlink)/(math.pi*modulation_index_downlink)) + self.analog_frequency_modulator_fc_0 = analog.frequency_modulator_fc((math.pi*modulation_index_uplink) / samples_per_symbol_tx) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'failed_pdu'), (self.satnogs_multi_format_msg_sink_0, 'in')) + self.msg_connect((self.satnogs_ax25_decoder_bm_0, 'pdu'), (self.satnogs_qb50_deframer_0, 'in')) + self.msg_connect((self.satnogs_qb50_deframer_0, 'out'), (self.satnogs_udp_msg_sink_0_0, 'in')) + self.msg_connect((self.satnogs_qb50_deframer_0, 'wod'), (self.satnogs_udp_msg_sink_0_0_0, 'in')) + self.msg_connect((self.satnogs_udp_msg_source_0, 'msg'), (self.satnogs_upsat_fsk_frame_encoder_0, 'pdu')) + self.connect((self.analog_frequency_modulator_fc_0, 0), (self.pfb_arb_resampler_xxx_0, 0)) + self.connect((self.analog_quadrature_demod_cf_0_0, 0), (self.digital_clock_recovery_mm_xx_0, 0)) + self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 1)) + self.connect((self.blocks_multiply_xx_0, 0), (self.osmosdr_sink_0, 0)) + self.connect((self.digital_binary_slicer_fb_0, 0), (self.satnogs_ax25_decoder_bm_0, 0)) + self.connect((self.digital_clock_recovery_mm_xx_0, 0), (self.digital_binary_slicer_fb_0, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.analog_quadrature_demod_cf_0_0, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.qtgui_freq_sink_x_0, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.qtgui_waterfall_sink_x_0, 0)) + self.connect((self.interp_fir_filter_xxx_0, 0), (self.analog_frequency_modulator_fc_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + self.connect((self.pfb_arb_resampler_xxx_0, 0), (self.blocks_multiply_xx_0, 0)) + self.connect((self.satnogs_upsat_fsk_frame_encoder_0, 0), (self.interp_fir_filter_xxx_0, 0)) + + def closeEvent(self, event): + self.settings = Qt.QSettings("GNU Radio", "upsat_transceiver_qt") + self.settings.setValue("geometry", self.saveGeometry()) + event.accept() + + def get_bind_addr(self): + return self.bind_addr + + def set_bind_addr(self, bind_addr): + self.bind_addr = bind_addr + + def get_dest_addr(self): + return self.dest_addr + + def set_dest_addr(self, dest_addr): + self.dest_addr = dest_addr + + 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_frequency - self.lo_offset, 0) + self.osmosdr_sink_0.set_center_freq(self.tx_frequency - self.lo_offset, 0) + self.freq_xlating_fir_filter_xxx_0.set_center_freq(self.lo_offset) + self.analog_sig_source_x_0.set_frequency(self.lo_offset ) + + def get_recv_port(self): + return self.recv_port + + def set_recv_port(self, recv_port): + self.recv_port = recv_port + + def get_rx_sdr_device(self): + return self.rx_sdr_device + + def set_rx_sdr_device(self, rx_sdr_device): + self.rx_sdr_device = rx_sdr_device + self.set_samp_rate_tx(satnogs.hw_tx_settings[self.rx_sdr_device]['samp_rate']) + self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['if_gain'], 0) + 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_send_port(self): + return self.send_port + + def set_send_port(self, send_port): + self.send_port = send_port + + def get_tx_sdr_device(self): + return self.tx_sdr_device + + def set_tx_sdr_device(self, tx_sdr_device): + self.tx_sdr_device = tx_sdr_device + self.osmosdr_sink_0.set_gain(satnogs.hw_tx_settings[self.tx_sdr_device]['rf_gain'], 0) + self.osmosdr_sink_0.set_if_gain(satnogs.hw_tx_settings[self.tx_sdr_device]['if_gain'], 0) + self.osmosdr_sink_0.set_bb_gain(satnogs.hw_tx_settings[self.tx_sdr_device]['bb_gain'], 0) + self.osmosdr_sink_0.set_antenna(satnogs.hw_tx_settings[self.tx_sdr_device]['antenna'], 0) + + def get_wod_port(self): + return self.wod_port + + def set_wod_port(self, wod_port): + self.wod_port = wod_port + + def get_samples_per_symbol_tx(self): + return self.samples_per_symbol_tx + + def set_samples_per_symbol_tx(self, samples_per_symbol_tx): + self.samples_per_symbol_tx = samples_per_symbol_tx + self.set_sq_wave((1.0, ) * self.samples_per_symbol_tx) + self.pfb_arb_resampler_xxx_0.set_rate(self.samp_rate_tx / (self.baud_rate_uplink * self.samples_per_symbol_tx)) + self.set_gaussian_taps(filter.firdes.gaussian(1.0, self.samples_per_symbol_tx, 1.0, 4*self.samples_per_symbol_tx)) + self.analog_frequency_modulator_fc_0.set_sensitivity((math.pi*self.modulation_index_uplink) / self.samples_per_symbol_tx) + + def get_sq_wave(self): + return self.sq_wave + + def set_sq_wave(self, sq_wave): + self.sq_wave = sq_wave + self.set_interp_taps(numpy.convolve(numpy.array(self.gaussian_taps), numpy.array(self.sq_wave))) + + def get_samp_rate_rx(self): + return self.samp_rate_rx + + def set_samp_rate_rx(self, samp_rate_rx): + self.samp_rate_rx = samp_rate_rx + self.set_first_stage_samp_rate_rx(self.samp_rate_rx / self.decimation_rx) + self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate_rx/self.decimation_rx) + self.osmosdr_source_0.set_sample_rate(self.samp_rate_rx) + self.osmosdr_source_0.set_bandwidth(self.samp_rate_rx, 0) + + def get_gaussian_taps(self): + return self.gaussian_taps + + def set_gaussian_taps(self, gaussian_taps): + self.gaussian_taps = gaussian_taps + self.set_interp_taps(numpy.convolve(numpy.array(self.gaussian_taps), numpy.array(self.sq_wave))) + + def get_deviation(self): + return self.deviation + + def set_deviation(self, deviation): + self.deviation = deviation + self.set_modulation_index_uplink(self.deviation / (self.baud_rate_uplink / 2.0)) + self.set_modulation_index_downlink(self.deviation / (self.baud_rate_downlink / 2.0)) + + def get_decimation_rx(self): + return self.decimation_rx + + def set_decimation_rx(self, decimation_rx): + self.decimation_rx = decimation_rx + self.set_first_stage_samp_rate_rx(self.samp_rate_rx / self.decimation_rx) + self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate_rx/self.decimation_rx) + + def get_baud_rate_uplink(self): + return self.baud_rate_uplink + + def set_baud_rate_uplink(self, baud_rate_uplink): + self.baud_rate_uplink = baud_rate_uplink + self.set_modulation_index_uplink(self.deviation / (self.baud_rate_uplink / 2.0)) + self.pfb_arb_resampler_xxx_0.set_rate(self.samp_rate_tx / (self.baud_rate_uplink * self.samples_per_symbol_tx)) + + def get_baud_rate_downlink(self): + return self.baud_rate_downlink + + def set_baud_rate_downlink(self, baud_rate_downlink): + self.baud_rate_downlink = baud_rate_downlink + self.set_modulation_index_downlink(self.deviation / (self.baud_rate_downlink / 2.0)) + self.digital_clock_recovery_mm_xx_0.set_omega(self.first_stage_samp_rate_rx/self.baud_rate_downlink) + self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) + + def get_tx_frequency(self): + return self.tx_frequency + + def set_tx_frequency(self, tx_frequency): + self.tx_frequency = tx_frequency + self.osmosdr_sink_0.set_center_freq(self.tx_frequency - self.lo_offset, 0) + + def get_taps(self): + return self.taps + + def set_taps(self, taps): + self.taps = taps + self.freq_xlating_fir_filter_xxx_0.set_taps((self.taps)) + + def get_samp_rate_tx(self): + return self.samp_rate_tx + + def set_samp_rate_tx(self, samp_rate_tx): + self.samp_rate_tx = samp_rate_tx + self.pfb_arb_resampler_xxx_0.set_rate(self.samp_rate_tx / (self.baud_rate_uplink * self.samples_per_symbol_tx)) + self.osmosdr_sink_0.set_sample_rate(self.samp_rate_tx) + self.osmosdr_sink_0.set_bandwidth(self.samp_rate_tx, 0) + self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate_tx) + + def get_rx_frequency(self): + return self.rx_frequency + + def set_rx_frequency(self, rx_frequency): + self.rx_frequency = rx_frequency + self.osmosdr_source_0.set_center_freq(self.rx_frequency - self.lo_offset, 0) + + def get_modulation_index_uplink(self): + return self.modulation_index_uplink + + def set_modulation_index_uplink(self, modulation_index_uplink): + self.modulation_index_uplink = modulation_index_uplink + self.analog_frequency_modulator_fc_0.set_sensitivity((math.pi*self.modulation_index_uplink) / self.samples_per_symbol_tx) + + def get_modulation_index_downlink(self): + return self.modulation_index_downlink + + def set_modulation_index_downlink(self, modulation_index_downlink): + self.modulation_index_downlink = modulation_index_downlink + self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) + + def get_interp_taps(self): + return self.interp_taps + + def set_interp_taps(self, interp_taps): + self.interp_taps = interp_taps + self.interp_fir_filter_xxx_0.set_taps((self.interp_taps)) + + def get_first_stage_samp_rate_rx(self): + return self.first_stage_samp_rate_rx + + def set_first_stage_samp_rate_rx(self, first_stage_samp_rate_rx): + self.first_stage_samp_rate_rx = first_stage_samp_rate_rx + self.digital_clock_recovery_mm_xx_0.set_omega(self.first_stage_samp_rate_rx/self.baud_rate_downlink) + self.analog_quadrature_demod_cf_0_0.set_gain(((self.first_stage_samp_rate_rx) / self.baud_rate_downlink)/(math.pi*self.modulation_index_downlink)) + + +def argument_parser(): + description = 'SATNOGS transceiver for UPSAT satellite' + parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) + parser.add_option( + "", "--bind-addr", dest="bind_addr", type="string", default='0.0.0.0', + help="Set bind_addr [default=%default]") + parser.add_option( + "", "--dest-addr", dest="dest_addr", type="string", default='127.0.0.1', + help="Set dest_addr [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]") + parser.add_option( + "", "--recv-port", dest="recv_port", type="intx", default=16886, + help="Set recv_port [default=%default]") + parser.add_option( + "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', + help="Set rx_sdr_device [default=%default]") + parser.add_option( + "", "--send-port", dest="send_port", type="intx", default=5022, + help="Set send_port [default=%default]") + parser.add_option( + "", "--tx-sdr-device", dest="tx_sdr_device", type="string", default='usrpb200', + help="Set tx_sdr_device [default=%default]") + parser.add_option( + "", "--wod-port", dest="wod_port", type="intx", default=5023, + help="Set wod_port [default=%default]") + return parser + + +def main(top_block_cls=upsat_transceiver_qt, options=None): + if options is None: + options, _ = argument_parser().parse_args() + + from distutils.version import StrictVersion + if StrictVersion(Qt.qVersion()) >= StrictVersion("4.5.0"): + style = gr.prefs().get_string('qtgui', 'style', 'raster') + Qt.QApplication.setGraphicsSystem(style) + qapp = Qt.QApplication(sys.argv) + + tb = top_block_cls(bind_addr=options.bind_addr, dest_addr=options.dest_addr, lo_offset=options.lo_offset, recv_port=options.recv_port, rx_sdr_device=options.rx_sdr_device, send_port=options.send_port, tx_sdr_device=options.tx_sdr_device, wod_port=options.wod_port) + tb.start() + tb.show() + + def quitting(): + tb.stop() + tb.wait() + qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting) + qapp.exec_() + + +if __name__ == '__main__': + main() diff --git a/apps/flowgraphs/satnogs_fm_demod.py b/apps/flowgraphs/satnogs_fm_demod.py new file mode 100755 index 0000000..fa4a578 --- /dev/null +++ b/apps/flowgraphs/satnogs_fm_demod.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: FM Generic Demodulation +# Author: Manolis Surligas (surligas@gmail.com) +# Description: A generic FM demodulation block +# Generated: Sun Mar 19 10:01:51 2017 +################################################## + +from gnuradio import analog +from gnuradio import eng_notation +from gnuradio import filter +from gnuradio import gr +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from optparse import OptionParser +import math +import osmosdr +import satnogs +import time + + +class satnogs_fm_demod(gr.top_block): + + def __init__(self, doppler_correction_per_sec=1000, file_path='test.wav', lo_offset=100e3, ppm=0, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200', waterfall_file_path='/tmp/waterfall.dat'): + gr.top_block.__init__(self, "FM Generic Demodulation") + + ################################################## + # Parameters + ################################################## + self.doppler_correction_per_sec = doppler_correction_per_sec + self.file_path = 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.waterfall_file_path = waterfall_file_path + + ################################################## + # Variables + ################################################## + self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] + self.xlate_filter_taps = xlate_filter_taps = firdes.low_pass(1, samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76) + + self.taps = taps = firdes.low_pass(12.0, samp_rate_rx, 100e3, 60000, firdes.WIN_HAMMING, 6.76) + + self.filter_rate = filter_rate = 250000 + self.deviation = deviation = 5000 + self.audio_samp_rate = audio_samp_rate = 48000 + self.audio_gain = audio_gain = satnogs.fm_demod_settings[rx_sdr_device]['audio_gain'] + + ################################################## + # Blocks + ################################################## + self.satnogs_waterfall_sink_0 = satnogs.waterfall_sink(audio_samp_rate, 0.0, 10, 1024, waterfall_file_path, 1) + self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500) + self.satnogs_ogg_encoder_0 = satnogs.ogg_encoder(file_path, audio_samp_rate, 1.0) + self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx) + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] ) + self.osmosdr_source_0.set_sample_rate(samp_rate_rx) + self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) + self.osmosdr_source_0.set_freq_corr(ppm, 0) + self.osmosdr_source_0.set_dc_offset_mode(2, 0) + self.osmosdr_source_0.set_iq_balance_mode(0, 0) + self.osmosdr_source_0.set_gain_mode(False, 0) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[rx_sdr_device]['if_gain'], 0) + self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'], 0) + self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[rx_sdr_device]['antenna'], 0) + self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) + + self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(int(samp_rate_rx/filter_rate), (xlate_filter_taps), lo_offset, samp_rate_rx) + self.blks2_rational_resampler_xxx_1 = filter.rational_resampler_ccc( + interpolation=24, + decimation=125, + taps=None, + fractional_bw=None, + ) + self.analog_quadrature_demod_cf_0 = analog.quadrature_demod_cf((2*math.pi*deviation)/audio_samp_rate) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) + self.connect((self.analog_quadrature_demod_cf_0, 0), (self.satnogs_ogg_encoder_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.analog_quadrature_demod_cf_0, 0)) + self.connect((self.blks2_rational_resampler_xxx_1, 0), (self.satnogs_waterfall_sink_0, 0)) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blks2_rational_resampler_xxx_1, 0)) + self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) + self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + + def get_doppler_correction_per_sec(self): + return self.doppler_correction_per_sec + + def set_doppler_correction_per_sec(self, doppler_correction_per_sec): + self.doppler_correction_per_sec = doppler_correction_per_sec + + def get_file_path(self): + return self.file_path + + def set_file_path(self, file_path): + self.file_path = 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 + + def set_ppm(self, ppm): + self.ppm = ppm + self.osmosdr_source_0.set_freq_corr(self.ppm, 0) + + def get_rigctl_port(self): + return self.rigctl_port + + def set_rigctl_port(self, rigctl_port): + self.rigctl_port = rigctl_port + + def get_rx_freq(self): + return self.rx_freq + + def set_rx_freq(self, rx_freq): + self.rx_freq = rx_freq + self.satnogs_coarse_doppler_correction_cc_0.set_new_freq_locked(self.rx_freq) + self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) + + def get_rx_sdr_device(self): + return self.rx_sdr_device + + def set_rx_sdr_device(self, rx_sdr_device): + self.rx_sdr_device = rx_sdr_device + self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['if_gain'], 0) + 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) + self.set_audio_gain(satnogs.fm_demod_settings[self.rx_sdr_device]['audio_gain']) + + def get_waterfall_file_path(self): + return self.waterfall_file_path + + def set_waterfall_file_path(self, waterfall_file_path): + self.waterfall_file_path = waterfall_file_path + + def get_samp_rate_rx(self): + return self.samp_rate_rx + + def set_samp_rate_rx(self, samp_rate_rx): + self.samp_rate_rx = samp_rate_rx + self.set_xlate_filter_taps(firdes.low_pass(1, self.samp_rate_rx, 125000, 25000, firdes.WIN_HAMMING, 6.76)) + self.osmosdr_source_0.set_sample_rate(self.samp_rate_rx) + self.osmosdr_source_0.set_bandwidth(self.samp_rate_rx, 0) + + def get_xlate_filter_taps(self): + return self.xlate_filter_taps + + def set_xlate_filter_taps(self, xlate_filter_taps): + self.xlate_filter_taps = xlate_filter_taps + self.freq_xlating_fir_filter_xxx_0.set_taps((self.xlate_filter_taps)) + + def get_taps(self): + return self.taps + + def set_taps(self, taps): + self.taps = taps + + def get_filter_rate(self): + return self.filter_rate + + def set_filter_rate(self, filter_rate): + self.filter_rate = filter_rate + + def get_deviation(self): + return self.deviation + + def set_deviation(self, deviation): + self.deviation = deviation + self.analog_quadrature_demod_cf_0.set_gain((2*math.pi*self.deviation)/self.audio_samp_rate) + + def get_audio_samp_rate(self): + return self.audio_samp_rate + + def set_audio_samp_rate(self, audio_samp_rate): + self.audio_samp_rate = audio_samp_rate + self.analog_quadrature_demod_cf_0.set_gain((2*math.pi*self.deviation)/self.audio_samp_rate) + + def get_audio_gain(self): + return self.audio_gain + + def set_audio_gain(self, audio_gain): + self.audio_gain = audio_gain + + +def argument_parser(): + description = 'A generic FM demodulation block' + parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) + 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( + "", "--file-path", dest="file_path", type="string", default='test.wav', + help="Set 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]") + parser.add_option( + "", "--ppm", dest="ppm", type="intx", default=0, + help="Set ppm [default=%default]") + parser.add_option( + "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532, + help="Set rigctl_port [default=%default]") + parser.add_option( + "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(100e6), + help="Set rx_freq [default=%default]") + parser.add_option( + "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', + help="Set rx_sdr_device [default=%default]") + parser.add_option( + "", "--waterfall-file-path", dest="waterfall_file_path", type="string", default='/tmp/waterfall.dat', + help="Set waterfall_file_path [default=%default]") + return parser + + +def main(top_block_cls=satnogs_fm_demod, options=None): + if options is None: + options, _ = argument_parser().parse_args() + + tb = top_block_cls(doppler_correction_per_sec=options.doppler_correction_per_sec, file_path=options.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, waterfall_file_path=options.waterfall_file_path) + tb.start() + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/apps/flowgraphs/satnogs_generic_iq_receiver.py b/apps/flowgraphs/satnogs_generic_iq_receiver.py new file mode 100755 index 0000000..5f1b296 --- /dev/null +++ b/apps/flowgraphs/satnogs_generic_iq_receiver.py @@ -0,0 +1,211 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +################################################## +# GNU Radio Python Flow Graph +# Title: Generic IQ samples receiver +# Author: Manolis Surligas (surligas@gmail.com) +# Description: A generic FM demodulation block +# Generated: Mon Nov 7 19:49:15 2016 +################################################## + +from gnuradio import blocks +from gnuradio import eng_notation +from gnuradio import filter +from gnuradio import gr +from gnuradio.eng_option import eng_option +from gnuradio.filter import firdes +from optparse import OptionParser +import osmosdr +import satnogs +import time + + +class satnogs_generic_iq_receiver(gr.top_block): + + def __init__(self, doppler_correction_per_sec=1000, file_path='test.wav', lo_offset=100e3, rigctl_port=4532, rx_freq=100e6, rx_sdr_device='usrpb200'): + gr.top_block.__init__(self, "Generic IQ samples receiver") + + ################################################## + # Parameters + ################################################## + self.doppler_correction_per_sec = doppler_correction_per_sec + self.file_path = file_path + self.lo_offset = lo_offset + self.rigctl_port = rigctl_port + self.rx_freq = rx_freq + self.rx_sdr_device = rx_sdr_device + + ################################################## + # Variables + ################################################## + self.samp_rate_rx = samp_rate_rx = satnogs.hw_rx_settings[rx_sdr_device]['samp_rate'] + self.decimation_rx = decimation_rx = satnogs.fm_demod_settings[rx_sdr_device]['decimation_rx'] + + self.taps = taps = firdes.low_pass(12.0, samp_rate_rx, 100e3, 60000, firdes.WIN_HAMMING, 6.76) + + self.quadrature_rate = quadrature_rate = samp_rate_rx / decimation_rx + self.audio_samp_rate = audio_samp_rate = 44100 + self.audio_gain = audio_gain = satnogs.fm_demod_settings[rx_sdr_device]['audio_gain'] + self.audio_decimation = audio_decimation = 2 + + ################################################## + # Blocks + ################################################## + self.satnogs_tcp_rigctl_msg_source_0 = satnogs.tcp_rigctl_msg_source("127.0.0.1", rigctl_port, False, 1000, 1500) + self.satnogs_coarse_doppler_correction_cc_0 = satnogs.coarse_doppler_correction_cc(rx_freq, samp_rate_rx) + self.osmosdr_source_0 = osmosdr.source( args="numchan=" + str(1) + " " + satnogs.hw_rx_settings[rx_sdr_device]['dev_arg'] ) + self.osmosdr_source_0.set_sample_rate(samp_rate_rx) + self.osmosdr_source_0.set_center_freq(rx_freq - lo_offset, 0) + self.osmosdr_source_0.set_freq_corr(0, 0) + self.osmosdr_source_0.set_dc_offset_mode(2, 0) + self.osmosdr_source_0.set_iq_balance_mode(0, 0) + self.osmosdr_source_0.set_gain_mode(False, 0) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[rx_sdr_device]['if_gain'], 0) + self.osmosdr_source_0.set_bb_gain(satnogs.hw_rx_settings[rx_sdr_device]['bb_gain'], 0) + self.osmosdr_source_0.set_antenna(satnogs.hw_rx_settings[rx_sdr_device]['antenna'], 0) + self.osmosdr_source_0.set_bandwidth(samp_rate_rx, 0) + + self.freq_xlating_fir_filter_xxx_0 = filter.freq_xlating_fir_filter_ccc(decimation_rx, (taps), lo_offset, samp_rate_rx) + self.blocks_file_sink_0 = blocks.file_sink(gr.sizeof_gr_complex*1, file_path, False) + self.blocks_file_sink_0.set_unbuffered(True) + + ################################################## + # Connections + ################################################## + self.msg_connect((self.satnogs_tcp_rigctl_msg_source_0, 'freq'), (self.satnogs_coarse_doppler_correction_cc_0, 'freq')) + self.connect((self.freq_xlating_fir_filter_xxx_0, 0), (self.blocks_file_sink_0, 0)) + self.connect((self.osmosdr_source_0, 0), (self.satnogs_coarse_doppler_correction_cc_0, 0)) + self.connect((self.satnogs_coarse_doppler_correction_cc_0, 0), (self.freq_xlating_fir_filter_xxx_0, 0)) + + def get_doppler_correction_per_sec(self): + return self.doppler_correction_per_sec + + def set_doppler_correction_per_sec(self, doppler_correction_per_sec): + self.doppler_correction_per_sec = doppler_correction_per_sec + + def get_file_path(self): + return self.file_path + + def set_file_path(self, file_path): + self.file_path = file_path + self.blocks_file_sink_0.open(self.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_rigctl_port(self): + return self.rigctl_port + + def set_rigctl_port(self, rigctl_port): + self.rigctl_port = rigctl_port + + def get_rx_freq(self): + return self.rx_freq + + def set_rx_freq(self, rx_freq): + self.rx_freq = rx_freq + self.satnogs_coarse_doppler_correction_cc_0.set_new_freq_locked(self.rx_freq) + self.osmosdr_source_0.set_center_freq(self.rx_freq - self.lo_offset, 0) + + def get_rx_sdr_device(self): + return self.rx_sdr_device + + def set_rx_sdr_device(self, rx_sdr_device): + self.rx_sdr_device = rx_sdr_device + self.set_samp_rate_rx(satnogs.hw_rx_settings[self.rx_sdr_device]['samp_rate']) + self.set_decimation_rx(satnogs.fm_demod_settings[self.rx_sdr_device]['decimation_rx']) + self.osmosdr_source_0.set_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['rf_gain'], 0) + self.osmosdr_source_0.set_if_gain(satnogs.hw_rx_settings[self.rx_sdr_device]['if_gain'], 0) + 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) + self.set_audio_gain(satnogs.fm_demod_settings[self.rx_sdr_device]['audio_gain']) + + def get_samp_rate_rx(self): + return self.samp_rate_rx + + def set_samp_rate_rx(self, samp_rate_rx): + self.samp_rate_rx = samp_rate_rx + self.set_quadrature_rate(self.samp_rate_rx / self.decimation_rx) + self.osmosdr_source_0.set_sample_rate(self.samp_rate_rx) + self.osmosdr_source_0.set_bandwidth(self.samp_rate_rx, 0) + + def get_decimation_rx(self): + return self.decimation_rx + + def set_decimation_rx(self, decimation_rx): + self.decimation_rx = decimation_rx + self.set_quadrature_rate(self.samp_rate_rx / self.decimation_rx) + + def get_taps(self): + return self.taps + + def set_taps(self, taps): + self.taps = taps + self.freq_xlating_fir_filter_xxx_0.set_taps((self.taps)) + + def get_quadrature_rate(self): + return self.quadrature_rate + + def set_quadrature_rate(self, quadrature_rate): + self.quadrature_rate = quadrature_rate + + def get_audio_samp_rate(self): + return self.audio_samp_rate + + def set_audio_samp_rate(self, audio_samp_rate): + self.audio_samp_rate = audio_samp_rate + + def get_audio_gain(self): + return self.audio_gain + + def set_audio_gain(self, audio_gain): + self.audio_gain = audio_gain + + def get_audio_decimation(self): + return self.audio_decimation + + def set_audio_decimation(self, audio_decimation): + self.audio_decimation = audio_decimation + + +def argument_parser(): + description = 'A generic FM demodulation block' + parser = OptionParser(usage="%prog: [options]", option_class=eng_option, description=description) + 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( + "", "--file-path", dest="file_path", type="string", default='test.wav', + help="Set 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]") + parser.add_option( + "", "--rigctl-port", dest="rigctl_port", type="intx", default=4532, + help="Set rigctl_port [default=%default]") + parser.add_option( + "", "--rx-freq", dest="rx_freq", type="eng_float", default=eng_notation.num_to_str(100e6), + help="Set rx_freq [default=%default]") + parser.add_option( + "", "--rx-sdr-device", dest="rx_sdr_device", type="string", default='usrpb200', + help="Set rx_sdr_device [default=%default]") + return parser + + +def main(top_block_cls=satnogs_generic_iq_receiver, options=None): + if options is None: + options, _ = argument_parser().parse_args() + + tb = top_block_cls(doppler_correction_per_sec=options.doppler_correction_per_sec, file_path=options.file_path, lo_offset=options.lo_offset, rigctl_port=options.rigctl_port, rx_freq=options.rx_freq, rx_sdr_device=options.rx_sdr_device) + tb.start() + tb.wait() + + +if __name__ == '__main__': + main() diff --git a/apps/scripts/CMakeLists.txt b/apps/scripts/CMakeLists.txt new file mode 100644 index 0000000..4355ed3 --- /dev/null +++ b/apps/scripts/CMakeLists.txt @@ -0,0 +1,4 @@ +INSTALL(FILES + satnogs_waterfall.gp + DESTINATION share/satnogs/scripts +) \ No newline at end of file diff --git a/apps/scripts/satnogs_waterfall.gp b/apps/scripts/satnogs_waterfall.gp new file mode 100755 index 0000000..302782f --- /dev/null +++ b/apps/scripts/satnogs_waterfall.gp @@ -0,0 +1,70 @@ +#!/usr/bin/gnuplot +# +# gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module +# +# Copyright (C) 2017, Libre Space Foundation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see + +# satnogs-waterfall.gp +# Plot a waterfall diagramm from the output of the satnogs_waterfall_sink block. +# +# Usage: +# gnuplot -e "inputfile='waterfall_sink.data'" -e "outfile='waterfall.png'" /usr/local/share/satnogs/scripts/satnogs_waterfall.gp + +reset +if (!exists("height")) height=800 +if (!exists("width")) width=800 +if (!exists("outfile")) outfile='/tmp/waterfall.png' + +set terminal pngcairo size width,height enhanced font 'Verdana,14' +set output outfile + +unset key +set style line 11 lc rgb '#808080' lt 1 +set border 3 front ls 11 +set style line 12 lc rgb '#888888' lt 0 lw 1 +set grid front ls 12 +set tics nomirror out scale 0.75 + +set xlabel 'Frequency (kHz)' +set ylabel 'Time' +set cbtics scale 0 +set cbtics (-110, -105, -100, -95, -90, -85, -80, -75, -70, -65, -60, -55, -50, -55, -40) + +# palette +set palette defined (0 '#aa00ff',\ + 1 '#6200ea',\ + 2 '#2962ff',\ + 3 '#00b8d4',\ + 4 '#00bfa5',\ + 5 '#00c853',\ + 6 '#64dd17 ',\ + 7 '#aeea00',\ + 9 '#ffd600 ',\ + 10 '#ffab00 ',\ + 11 '#ff6d00',\ + 12 '#d50000') +set ylabel 'Time (seconds)' +set cbrange [-100:-50] +set cblabel 'Power (dB)' + +# Get automatically the axis ranges from the file +stats inputfile using 1 binary nooutput +set xrange [STATS_min*1e-3:STATS_max*1e-3 + 1] +stats inputfile using 2 binary nooutput +set yrange [0:STATS_max + 1] + +# Plot and scale the frequency axis to kHz for readability +plot inputfile using ($1*1e-3):2:3 binary matrix with image diff --git a/cmake/Modules/FindNova.cmake b/cmake/Modules/FindNova.cmake new file mode 100644 index 0000000..ab45e18 --- /dev/null +++ b/cmake/Modules/FindNova.cmake @@ -0,0 +1,26 @@ +INCLUDE(FindPkgConfig) +PKG_CHECK_MODULES(PC_NOVA Nova) + +FIND_PATH( + NOVA_INCLUDE_DIRS + NAMES libnova/libnova.h + HINTS $ENV{NOVA_DIR}/include + ${PC_NOVA_INCLUDEDIR} + PATHS /usr/local/include + /usr/include +) + +FIND_LIBRARY( + NOVA_LIBRARIES + NAMES nova + HINTS $ENV{NOVA_DIR}/lib + ${PC_NOVA_LIBDIR} + PATHS /usr/local/lib + /usr/local/lib64 + /usr/lib + /usr/lib64 +) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NOVA DEFAULT_MSG NOVA_LIBRARIES NOVA_INCLUDE_DIRS) +MARK_AS_ADVANCED(NOVA_LIBRARIES NOVA_INCLUDE_DIRS) \ No newline at end of file diff --git a/cmake/Modules/FindOggVorbis.cmake b/cmake/Modules/FindOggVorbis.cmake new file mode 100644 index 0000000..32835b0 --- /dev/null +++ b/cmake/Modules/FindOggVorbis.cmake @@ -0,0 +1,86 @@ +# - Try to find the OggVorbis libraries +# Once done this will define +# +# OGGVORBIS_FOUND - system has OggVorbis +# OGGVORBIS_VERSION - set either to 1 or 2 +# OGG_INCLUDE_DIR - the OggVorbis include directory +# VORBIS_INCLUDE_DIR - the OggVorbis include directory +# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis +# OGG_LIBRARY - The Ogg library +# VORBIS_LIBRARY - The Vorbis library +# VORBISFILE_LIBRARY - The VorbisFile library +# VORBISENC_LIBRARY - The VorbisEnc library + +# Copyright (c) 2006, Richard Laerkaeng, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +include (CheckLibraryExists) + +find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h) +find_path(OGG_INCLUDE_DIR ogg/ogg.h) + +find_library(OGG_LIBRARY NAMES ogg) +find_library(VORBIS_LIBRARY NAMES vorbis) +find_library(VORBISFILE_LIBRARY NAMES vorbisfile) +find_library(VORBISENC_LIBRARY NAMES vorbisenc) + + +if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + set(OGGVORBIS_FOUND TRUE) + + set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY}) + + set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES}) + check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) + set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP}) + + if (HAVE_LIBVORBISENC2) + set (OGGVORBIS_VERSION 2) + else (HAVE_LIBVORBISENC2) + set (OGGVORBIS_VERSION 1) + endif (HAVE_LIBVORBISENC2) + +else (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + set (OGGVORBIS_VERSION) + set(OGGVORBIS_FOUND FALSE) +endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY) + + +if (OGGVORBIS_FOUND) + if (NOT OggVorbis_FIND_QUIETLY) + message(STATUS "Found OggVorbis: ${OGGVORBIS_LIBRARIES}") + endif (NOT OggVorbis_FIND_QUIETLY) +else (OGGVORBIS_FOUND) + if (OggVorbis_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find OggVorbis libraries") + endif (OggVorbis_FIND_REQUIRED) + if (NOT OggVorbis_FIND_QUITELY) + message(STATUS "Could NOT find OggVorbis libraries") + endif (NOT OggVorbis_FIND_QUITELY) +endif (OGGVORBIS_FOUND) + +#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H) +#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG) +#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS) +#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE) +#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC) +#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2) + +#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) +# message(STATUS "Ogg/Vorbis found") +# set (VORBIS_LIBS "-lvorbis -logg") +# set (VORBISFILE_LIBS "-lvorbisfile") +# set (VORBISENC_LIBS "-lvorbisenc") +# set (OGGVORBIS_FOUND TRUE) +# if (HAVE_LIBVORBISENC2) +# set (HAVE_VORBIS 2) +# else (HAVE_LIBVORBISENC2) +# set (HAVE_VORBIS 1) +# endif (HAVE_LIBVORBISENC2) +#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) +# message(STATUS "Ogg/Vorbis not found") +#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC) \ No newline at end of file diff --git a/grc/CMakeLists.txt b/grc/CMakeLists.txt index 4546851..78435cb 100644 --- a/grc/CMakeLists.txt +++ b/grc/CMakeLists.txt @@ -15,28 +15,40 @@ # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -install(FILES +# Boston, MA + +add_subdirectory(satellites) + +list(APPEND debug_blocks + satnogs_morse_debug_source.xml + satnogs_debug_msg_source.xml + satnogs_debug_msg_source_raw.xml + satnogs_leo_channel.xml +) + +list(APPEND enabled_blocks + satnogs_block_tree.xml satnogs_cw_matched_filter_ff.xml satnogs_morse_decoder.xml - satnogs_morse_debug_source.xml satnogs_multi_format_msg_sink.xml + satnogs_ogg_encoder.xml satnogs_cw_to_symbol.xml satnogs_sine_matched_filter_ff.xml satnogs_udp_msg_source.xml - satnogs_debug_msg_source.xml - satnogs_json_to_ecss_src.xml satnogs_tcp_rigctl_msg_source.xml - satnogs_frame_encoder.xml satnogs_doppler_correction_cc.xml - satnogs_upsat_fsk_frame_acquisition.xml - satnogs_upsat_fsk_frame_encoder.xml - satnogs_whitening.xml satnogs_udp_msg_sink.xml - satnogs_upsat_transmitter.xml satnogs_coarse_doppler_correction_cc.xml - satnogs_debug_msg_source_raw.xml satnogs_ax25_encoder_mb.xml satnogs_ax25_decoder_bm.xml - satnogs_qb50_deframer.xml DESTINATION share/gnuradio/grc/blocks + satnogs_waterfall_sink.xml +) + +if(${INCLUDE_DEBUG_BLOCKS}) + list(APPEND enabled_blocks ${debug_blocks}) +endif() +install(FILES + ${enabled_blocks} + satnogs_ogg_source.xml + satnogs_noaa_apt_sink.xml DESTINATION share/gnuradio/grc/blocks ) diff --git a/grc/satellites/CMakeLists.txt b/grc/satellites/CMakeLists.txt new file mode 100644 index 0000000..69d7f61 --- /dev/null +++ b/grc/satellites/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + + +add_subdirectory(upsat) diff --git a/grc/satellites/upsat/CMakeLists.txt b/grc/satellites/upsat/CMakeLists.txt new file mode 100644 index 0000000..006546f --- /dev/null +++ b/grc/satellites/upsat/CMakeLists.txt @@ -0,0 +1,30 @@ +# Copyright 2011 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +list(APPEND blocks + satnogs_qb50_deframer.xml + satnogs_upsat_fsk_frame_acquisition.xml + satnogs_upsat_fsk_frame_encoder.xml + satnogs_upsat_transmitter.xml +) + +install(FILES + ${blocks} + DESTINATION share/gnuradio/grc/blocks +) \ No newline at end of file diff --git a/grc/satnogs_qb50_deframer.xml b/grc/satellites/upsat/satnogs_qb50_deframer.xml similarity index 94% rename from grc/satnogs_qb50_deframer.xml rename to grc/satellites/upsat/satnogs_qb50_deframer.xml index fba319a..09b4544 100644 --- a/grc/satnogs_qb50_deframer.xml +++ b/grc/satellites/upsat/satnogs_qb50_deframer.xml @@ -2,7 +2,6 @@ QB50 AX.25 Deframer satnogs_qb50_deframer - satnogs import satnogs satnogs.qb50_deframer($wod_ssid) diff --git a/grc/satnogs_upsat_fsk_frame_acquisition.xml b/grc/satellites/upsat/satnogs_upsat_fsk_frame_acquisition.xml similarity index 97% rename from grc/satnogs_upsat_fsk_frame_acquisition.xml rename to grc/satellites/upsat/satnogs_upsat_fsk_frame_acquisition.xml index 9e4e83b..72c3483 100644 --- a/grc/satnogs_upsat_fsk_frame_acquisition.xml +++ b/grc/satellites/upsat/satnogs_upsat_fsk_frame_acquisition.xml @@ -2,7 +2,6 @@ UPSAT FSK Frame Acquisition satnogs_upsat_fsk_frame_acquisition - satnogs import satnogs satnogs.upsat_fsk_frame_acquisition($preamble, $sync_word, $whitening, $manchester, $check_crc, $ax_25) diff --git a/grc/satnogs_upsat_fsk_frame_encoder.xml b/grc/satellites/upsat/satnogs_upsat_fsk_frame_encoder.xml similarity index 98% rename from grc/satnogs_upsat_fsk_frame_encoder.xml rename to grc/satellites/upsat/satnogs_upsat_fsk_frame_encoder.xml index 1fb7b5d..bebc82f 100644 --- a/grc/satnogs_upsat_fsk_frame_encoder.xml +++ b/grc/satellites/upsat/satnogs_upsat_fsk_frame_encoder.xml @@ -2,7 +2,6 @@ UPSAT FSK Frame Encoder satnogs_upsat_fsk_frame_encoder - satnogs import satnogs satnogs.upsat_fsk_frame_encoder($preamble, $sync_word, $append_crc, $whitening, $manchester, $msb_first, $ax_25, $src_addr, $src_ssid, $dest_addr, $dest_ssid, $settling_samples) diff --git a/grc/satnogs_upsat_transmitter.xml b/grc/satellites/upsat/satnogs_upsat_transmitter.xml similarity index 98% rename from grc/satnogs_upsat_transmitter.xml rename to grc/satellites/upsat/satnogs_upsat_transmitter.xml index 30fed3e..822a7ac 100644 --- a/grc/satnogs_upsat_transmitter.xml +++ b/grc/satellites/upsat/satnogs_upsat_transmitter.xml @@ -1,7 +1,6 @@ Satnogs UPSat Transmitter satnogs_upsat_transmitter - satnogs import satnogs satnogs.satnogs_upsat_transmitter(frame_preamble=$frame_preamble, diff --git a/grc/satnogs_ax25_decoder_bm.xml b/grc/satnogs_ax25_decoder_bm.xml index 423fe06..272fc1c 100644 --- a/grc/satnogs_ax25_decoder_bm.xml +++ b/grc/satnogs_ax25_decoder_bm.xml @@ -2,7 +2,6 @@ AX.25 Decoder satnogs_ax25_decoder_bm - satnogs import satnogs satnogs.ax25_decoder_bm($addr, $ssid, $promisc, $descrambling, $max_frame_len, $n_sync_flags) diff --git a/grc/satnogs_ax25_encoder_mb.xml b/grc/satnogs_ax25_encoder_mb.xml index c49e501..9f04f5b 100644 --- a/grc/satnogs_ax25_encoder_mb.xml +++ b/grc/satnogs_ax25_encoder_mb.xml @@ -2,7 +2,6 @@ AX.25 Encoder satnogs_ax25_encoder_mb - satnogs import satnogs satnogs.ax25_encoder_mb($dest_addr, $dest_ssid, $src_addr, $src_ssid, $preamble_len, $postamble_len, $scramble) diff --git a/grc/satnogs_block_tree.xml b/grc/satnogs_block_tree.xml new file mode 100644 index 0000000..bda94dd --- /dev/null +++ b/grc/satnogs_block_tree.xml @@ -0,0 +1,28 @@ + + [SatNOGS] + + Satellites + + UPSat + satnogs_upsat_fsk_frame_acquisition + satnogs_upsat_fsk_frame_encoder + satnogs_upsat_transmitter + satnogs_qb50_deframer + + + satnogs_cw_matched_filter_ff + satnogs_morse_decoder + satnogs_multi_format_msg_sink + satnogs_ogg_encoder + satnogs_ogg_source + satnogs_cw_to_symbol + satnogs_sine_matched_filter_ff + satnogs_udp_msg_source + satnogs_tcp_rigctl_msg_source + satnogs_doppler_correction_cc + satnogs_udp_msg_sink + satnogs_coarse_doppler_correction_cc + satnogs_ax25_encoder_mb + satnogs_ax25_decoder_bm + satnogs_waterfall_sink + \ No newline at end of file diff --git a/grc/satnogs_coarse_doppler_correction_cc.xml b/grc/satnogs_coarse_doppler_correction_cc.xml index 167ec28..99dbcf3 100644 --- a/grc/satnogs_coarse_doppler_correction_cc.xml +++ b/grc/satnogs_coarse_doppler_correction_cc.xml @@ -2,7 +2,6 @@ Coarse Doppler Correction satnogs_coarse_doppler_correction_cc - satnogs import satnogs satnogs.coarse_doppler_correction_cc($target_freq, $sampling_rate) set_new_freq_locked($target_freq) diff --git a/grc/satnogs_cw_matched_filter_ff.xml b/grc/satnogs_cw_matched_filter_ff.xml index 67abe2f..411f183 100644 --- a/grc/satnogs_cw_matched_filter_ff.xml +++ b/grc/satnogs_cw_matched_filter_ff.xml @@ -2,7 +2,6 @@ CW Matched Filter satnogs_cw_matched_filter_ff - satnogs import satnogs satnogs.cw_matched_filter_ff($sampling_rate, $carrier_freq, $wpm, $energy) set_new_freq_locked($carrier_freq) diff --git a/grc/satnogs_cw_to_symbol.xml b/grc/satnogs_cw_to_symbol.xml index a93f997..d106d87 100644 --- a/grc/satnogs_cw_to_symbol.xml +++ b/grc/satnogs_cw_to_symbol.xml @@ -2,7 +2,6 @@ CW to Symbols satnogs_cw_to_symbol - satnogs import satnogs satnogs.cw_to_symbol($sampling_rate, $threshold, $conf_level, $wpm, $auto_config) set_act_threshold($threshold) diff --git a/grc/satnogs_debug_msg_source.xml b/grc/satnogs_debug_msg_source.xml index 7b706e0..1980ac5 100644 --- a/grc/satnogs_debug_msg_source.xml +++ b/grc/satnogs_debug_msg_source.xml @@ -2,7 +2,7 @@ Debug Message Source satnogs_debug_msg_source - satnogs + [SatNOGS]/Debug import satnogs satnogs.debug_msg_source($msg, $delay, $repeat) diff --git a/grc/satnogs_debug_msg_source_raw.xml b/grc/satnogs_debug_msg_source_raw.xml index 3ea8ccd..d668df3 100644 --- a/grc/satnogs_debug_msg_source_raw.xml +++ b/grc/satnogs_debug_msg_source_raw.xml @@ -2,7 +2,7 @@ Debug Message Source Raw satnogs_debug_msg_source_raw - satnogs + [SatNOGS]/Debug import satnogs satnogs.debug_msg_source_raw($msg, $delay, $repeat) diff --git a/grc/satnogs_doppler_correction_cc.xml b/grc/satnogs_doppler_correction_cc.xml index 63840f8..1649d3e 100644 --- a/grc/satnogs_doppler_correction_cc.xml +++ b/grc/satnogs_doppler_correction_cc.xml @@ -2,7 +2,6 @@ Doppler Correction satnogs_doppler_correction_cc - satnogs import satnogs satnogs.doppler_correction_cc($target_freq, $sampling_rate, $corrections_per_sec) diff --git a/grc/satnogs_frame_encoder.xml b/grc/satnogs_frame_encoder.xml deleted file mode 100644 index f628dd9..0000000 --- a/grc/satnogs_frame_encoder.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - frame_encoder - satnogs_frame_encoder - satnogs - import satnogs - satnogs.frame_encoder($append_preamble, $ecss_encap, $dest_addr, $dest_ssid, $src_addr, $src_ssid) - - - ... - ... - ... - - - - - in - - - - - - out - - - diff --git a/grc/satnogs_json_to_ecss_src.xml b/grc/satnogs_json_to_ecss_src.xml deleted file mode 100644 index 3a3e716..0000000 --- a/grc/satnogs_json_to_ecss_src.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - JSON to ECSS - satnogs_json_to_ecss_src - satnogs - import satnogs - satnogs.json_to_ecss_src() - - - - in - message - - - - out - message - - diff --git a/grc/satnogs_whitening.xml b/grc/satnogs_leo_channel.xml similarity index 85% rename from grc/satnogs_whitening.xml rename to grc/satnogs_leo_channel.xml index 66815b7..8cabddd 100644 --- a/grc/satnogs_whitening.xml +++ b/grc/satnogs_leo_channel.xml @@ -1,10 +1,10 @@ - whitening - satnogs_whitening - satnogs + LEO Channel + satnogs_leo_channel + [SatNOGS]/Debug import satnogs - satnogs.whitening($mask, $seed, $order) + satnogs.leo_channel($freq, $freq_shifts_per_sec)