Commit b7ebcd5d authored by Sleepwalker's avatar Sleepwalker

Added satnogs transmitter hierarchy block

parent c28c82c8
......@@ -36,5 +36,6 @@ install(FILES
satnogs_upsat_fsk_frame_encoder.xml
satnogs_whitening.xml
satnogs_udp_msg_sink.xml
satnogs_transmitter.xml
satnogs_coarse_doppler_correction_cc.xml DESTINATION share/gnuradio/grc/blocks
)
<block>
<name>Satnogs Transmitter</name>
<key>satnogs_transmitter</key>
<category>satnogs</category>
<import>import satnogs</import>
<make>satnogs.satnogs_transmitter(frame_preamble=$frame_preamble,
sync_word=$sync_word,
append_crc=$append_crc,
whitening=$whitening,
manchester=$manchester,
msb_first=$msb_first,
ax25_format=$ax25_format,
dest_addr=$dest_addr,
dest_ssid=$dest_ssid,
src_addr=$src_addr,
src_ssid=$src_ssid,
settling_samples=$settling_samples,
samps_per_symbol=$interp,
interpolation_taps=$taps,
samp_rate=$samp_rate,
lo_offset=$lo_offset,
deviation=$deviation,
baud_rate=$baud_rate)</make>
<param>
<name>Frame Preamble</name>
<key>frame_preamble</key>
<type>raw</type>
</param>
<param>
<name>Synchronization Word</name>
<key>sync_word</key>
<type>raw</type>
</param>
<param>
<name>Append CRC</name>
<key>append_crc</key>
<type>enum</type>
<option>
<name>Yes</name>
<key>True</key>
</option>
<option>
<name>No</name>
<key>False</key>
</option>
</param>
<param>
<name>Whitening</name>
<key>whitening</key>
<type>enum</type>
<option>
<name>No</name>
<key>False</key>
</option>
<option>
<name>Yes</name>
<key>True</key>
</option>
</param>
<param>
<name>Use Manchester Coding</name>
<key>manchester</key>
<type>enum</type>
<option>
<name>No</name>
<key>False</key>
</option>
<option>
<name>Yes</name>
<key>True</key>
</option>
</param>
<param>
<name>Send MS bit first</name>
<key>msb_first</key>
<type>enum</type>
<option>
<name>Yes</name>
<key>True</key>
</option>
<option>
<name>No</name>
<key>False</key>
</option>
</param>
<param>
<name>Use AX.25 encapsulation</name>
<key>ax25_format</key>
<type>enum</type>
<option>
<name>No</name>
<key>False</key>
</option>
<option>
<name>Yes</name>
<key>True</key>
</option>
</param>
<param>
<name>Destination Callsign</name>
<key>dest_addr</key>
<type>string</type>
</param>
<param>
<name>Destination SSID</name>
<key>dest_ssid</key>
<type>int</type>
</param>
<param>
<name>Source Callsign</name>
<key>src_addr</key>
<type>string</type>
</param>
<param>
<name>Source SSID</name>
<key>src_ssid</key>
<type>int</type>
</param>
<param>
<name>Number of zero settling samples</name>
<key>settling_samples</key>
<value>64</value>
<type>int</type>
</param>
<param>
<name>FIR filter Interpolation</name>
<key>interp</key>
<value>1</value>
<type>int</type>
</param>
<param>
<name>Interpolation Taps</name>
<key>taps</key>
<type>real_vector</type>
</param>
<param>
<name>Sampling rate</name>
<key>samp_rate</key>
<type>real</type>
</param>
<param>
<name>LO offset</name>
<key>lo_offset</key>
<type>real</type>
</param>
<param>
<name>baud rate</name>
<key>baud_rate</key>
<type>real</type>
</param>
<param>
<name>Deviation</name>
<key>deviation</key>
<type>real</type>
</param>
<sink>
<name>in</name>
<type>message</type>
</sink>
<source>
<name>out</name>
<type>complex</type>
</source>
</block>
\ No newline at end of file
......@@ -31,6 +31,7 @@ endif()
GR_PYTHON_INSTALL(
FILES
__init__.py
satnogs_transmitter.py
DESTINATION ${GR_PYTHON_DIR}/satnogs
)
......
......@@ -27,6 +27,7 @@ description here (python/__init__.py).
try:
# this might fail if the module is python-only
from satnogs_swig import *
from satnogs_transmitter import *
except ImportError:
pass
......
#! /usr/bin/python
import satnogs
import satnogs_swig
import math
from gnuradio import blocks
from gnuradio import filter
from gnuradio import analog
from gnuradio import gr
from gnuradio.filter import firdes
from gnuradio.gr.runtime_swig import sizeof_gr_complex
class satnogs_transmitter(gr.hier_block2):
def __init__(self,
frame_preamble,
sync_word,
append_crc,
whitening,
manchester,
msb_first,
ax25_format,
dest_addr,
dest_ssid,
src_addr,
src_ssid,
settling_samples,
samps_per_symbol,
interpolation_taps,
samp_rate,
lo_offset,
deviation,
baud_rate):
gr.hier_block2.__init__(self, "satnogs_transmitter",
gr.io_signature(0 , 0 , 0),
# Output 0: The complex TX signal for the SDR device
# Output 1: The constellation output for the vector analyzer
gr.io_signature(1, 1, sizeof_gr_complex))
self.frame_preamble = frame_preamble
self.sync_word = sync_word
self.append_crc = append_crc
self.whitening = whitening
self.manchester = manchester
self.msb_first = msb_first
self.ax25_format = ax25_format
self.dest_addr = dest_addr
self.dest_ssid = dest_ssid
self.src_addr = src_addr
self.src_ssid = src_ssid
self.settling_samples = settling_samples
self.samps_per_symbol = samps_per_symbol
self.interpolation_taps = interpolation_taps
self.samp_rate = samp_rate
self.lo_offset = lo_offset
self.deviation=deviation
self.baud_rate=baud_rate
self.message_port_register_hier_out("in")
self.modulation_index = self.deviation/(self.baud_rate / 2.0)
self.sensitivity = (math.pi*self.modulation_index) / self.samps_per_symbol
self.resampling_rate = self.samp_rate / (self.baud_rate*self.samps_per_symbol )
self.par_taps = filter.firdes.low_pass_2(32, 32, 0.8, 0.1, 60)
self.num_filters = 32
#=================================================================
# TX Related blocks
#=================================================================
self.fsk_frame_encoder = satnogs_swig.upsat_fsk_frame_encoder(self.frame_preamble,
self.sync_word,
self.append_crc,
self.whitening,
self.manchester,
self.msb_first,
self.ax25_format,
self.dest_addr,
self.dest_ssid,
self.src_addr,
self.src_ssid,
self.settling_samples
)
self.interp_fir_filter = filter.interp_fir_filter_fff(self.samps_per_symbol,
self.interpolation_taps
)
self.frequency_modulator = analog.frequency_modulator_fc(self.sensitivity)
self.signal_source = analog.sig_source_c(self.samp_rate,
102,
self.lo_offset,
1,
0)
self.polyphase_arbitrary_resampler = filter.pfb_arb_resampler_ccf(self.resampling_rate,
self.par_taps,
self.num_filters)
self.multiply = blocks.multiply_cc(1)
#=================================================================
# Connections
#=================================================================
self.msg_connect((self, "in"), (self.fsk_frame_encoder, "pdu"))
self.connect((self.fsk_frame_encoder, 0), (self.interp_fir_filter, 0))
self.connect((self.interp_fir_filter, 0), (self.frequency_modulator, 0))
self.connect((self.frequency_modulator, 0), (self.polyphase_arbitrary_resampler, 0))
self.connect((self.signal_source, 0) , (self.multiply, 0))
self.connect((self.polyphase_arbitrary_resampler, 0) , (self.multiply, 1))
self.connect((self.multiply, 0), self)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment