1
0
Fork 0
mirror of https://github.com/hb9fxq/gr-digitalhf synced 2024-12-22 15:10:00 +00:00

signal quality feedback added

This commit is contained in:
cmayer 2018-10-27 16:06:54 +02:00
parent f8f841c46a
commit c34a2b3975
3 changed files with 83 additions and 443 deletions

View file

@ -34,7 +34,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(8, 8)</value> <value>(10, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -82,7 +82,7 @@
</param> </param>
<param> <param>
<key>thread_safe_setters</key> <key>thread_safe_setters</key>
<value></value> <value>1</value>
</param> </param>
<param> <param>
<key>title</key> <key>title</key>
@ -105,7 +105,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(266, 570)</value> <value>(757, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -132,15 +132,15 @@
</param> </param>
<param> <param>
<key>_enabled</key> <key>_enabled</key>
<value>True</value> <value>0</value>
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(1130, 5)</value> <value>(1120, 101)</value>
</param> </param>
<param> <param>
<key>gui_hint</key> <key>gui_hint</key>
<value></value> <value>(3,0,1,2)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -195,7 +195,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(320, 5)</value> <value>(320, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -222,7 +222,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(554, 5)</value> <value>(533, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -234,7 +234,7 @@
</param> </param>
<param> <param>
<key>value</key> <key>value</key>
<value>10*sps</value> <value>12*sps</value>
</param> </param>
</block> </block>
<block> <block>
@ -249,7 +249,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(629, 5)</value> <value>(608, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -261,7 +261,7 @@
</param> </param>
<param> <param>
<key>value</key> <key>value</key>
<value>10*sps</value> <value>9*sps</value>
</param> </param>
</block> </block>
<block> <block>
@ -276,7 +276,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(704, 5)</value> <value>(682, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -288,7 +288,7 @@
</param> </param>
<param> <param>
<key>value</key> <key>value</key>
<value>4</value> <value>5</value>
</param> </param>
</block> </block>
<block> <block>
@ -303,7 +303,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(224, 5)</value> <value>(224, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -330,7 +330,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(480, 5)</value> <value>(458, 16)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -365,7 +365,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(906, 421)</value> <value>(906, 325)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -408,7 +408,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(234, 133)</value> <value>(245, 165)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -455,7 +455,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(416, 154)</value> <value>(416, 186)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -506,7 +506,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(1034, 282)</value> <value>(949, 144)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -557,7 +557,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(576, 154)</value> <value>(576, 186)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -612,11 +612,11 @@
</param> </param>
<param> <param>
<key>file</key> <key>file</key>
<value>/Users/chm/Downloads/sielsdr.ddns.net_2018-10-26T11_30_27Z_6768.50_iq.wav</value> <value>/Users/chm/Software/signal-analysis/gnuradio/20181027T095433Z_6407800_SM2GCT_iq.wav</value>
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(10, 133)</value> <value>(10, 165)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -663,7 +663,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(85, 410)</value> <value>(864, 453)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -718,7 +718,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(917, 10)</value> <value>(1034, 21)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -749,7 +749,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(906, 64)</value> <value>(960, 21)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -784,7 +784,7 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(746, 133)</value> <value>(629, 282)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -820,7 +820,7 @@
</param> </param>
<param> <param>
<key>threshold</key> <key>threshold</key>
<value>0.5</value> <value>0.3</value>
</param> </param>
</block> </block>
<block> <block>
@ -851,11 +851,11 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(469, 432)</value> <value>(1088, 474)</value>
</param> </param>
<param> <param>
<key>gui_hint</key> <key>gui_hint</key>
<value></value> <value>(2,2,2,2)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -871,7 +871,7 @@
</param> </param>
<param> <param>
<key>legend</key> <key>legend</key>
<value>True</value> <value>False</value>
</param> </param>
<param> <param>
<key>alpha1</key> <key>alpha1</key>
@ -883,7 +883,7 @@
</param> </param>
<param> <param>
<key>label1</key> <key>label1</key>
<value></value> <value>descrambled symbols</value>
</param> </param>
<param> <param>
<key>marker1</key> <key>marker1</key>
@ -1174,7 +1174,7 @@
<key>qtgui_time_sink_x</key> <key>qtgui_time_sink_x</key>
<param> <param>
<key>autoscale</key> <key>autoscale</key>
<value>True</value> <value>False</value>
</param> </param>
<param> <param>
<key>axislabels</key> <key>axislabels</key>
@ -1206,11 +1206,11 @@
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(1098, 410)</value> <value>(1098, 314)</value>
</param> </param>
<param> <param>
<key>gui_hint</key> <key>gui_hint</key>
<value></value> <value>(2,0,1,2)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -1226,7 +1226,7 @@
</param> </param>
<param> <param>
<key>legend</key> <key>legend</key>
<value>True</value> <value>False</value>
</param> </param>
<param> <param>
<key>alpha1</key> <key>alpha1</key>
@ -1238,7 +1238,7 @@
</param> </param>
<param> <param>
<key>label1</key> <key>label1</key>
<value>err</value> <value>preamble cross-correlation</value>
</param> </param>
<param> <param>
<key>marker1</key> <key>marker1</key>
@ -1530,380 +1530,13 @@
</param> </param>
<param> <param>
<key>ymax</key> <key>ymax</key>
<value>800</value> <value>300</value>
</param> </param>
<param> <param>
<key>ymin</key> <key>ymin</key>
<value>0</value> <value>0</value>
</param> </param>
</block> </block>
<block>
<key>qtgui_time_sink_x</key>
<param>
<key>autoscale</key>
<value>True</value>
</param>
<param>
<key>axislabels</key>
<value>True</value>
</param>
<param>
<key>alias</key>
<value></value>
</param>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>ctrlpanel</key>
<value>False</value>
</param>
<param>
<key>affinity</key>
<value></value>
</param>
<param>
<key>entags</key>
<value>True</value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(1077, 197)</value>
</param>
<param>
<key>gui_hint</key>
<value></value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>grid</key>
<value>False</value>
</param>
<param>
<key>id</key>
<value>qtgui_time_sink_x_0_0</value>
</param>
<param>
<key>legend</key>
<value>True</value>
</param>
<param>
<key>alpha1</key>
<value>1.0</value>
</param>
<param>
<key>color1</key>
<value>"blue"</value>
</param>
<param>
<key>label1</key>
<value>I</value>
</param>
<param>
<key>marker1</key>
<value>-1</value>
</param>
<param>
<key>style1</key>
<value>1</value>
</param>
<param>
<key>width1</key>
<value>1</value>
</param>
<param>
<key>alpha10</key>
<value>1.0</value>
</param>
<param>
<key>color10</key>
<value>"blue"</value>
</param>
<param>
<key>label10</key>
<value></value>
</param>
<param>
<key>marker10</key>
<value>-1</value>
</param>
<param>
<key>style10</key>
<value>1</value>
</param>
<param>
<key>width10</key>
<value>1</value>
</param>
<param>
<key>alpha2</key>
<value>1.0</value>
</param>
<param>
<key>color2</key>
<value>"red"</value>
</param>
<param>
<key>label2</key>
<value>Q</value>
</param>
<param>
<key>marker2</key>
<value>-1</value>
</param>
<param>
<key>style2</key>
<value>1</value>
</param>
<param>
<key>width2</key>
<value>1</value>
</param>
<param>
<key>alpha3</key>
<value>1.0</value>
</param>
<param>
<key>color3</key>
<value>"green"</value>
</param>
<param>
<key>label3</key>
<value>phase</value>
</param>
<param>
<key>marker3</key>
<value>-1</value>
</param>
<param>
<key>style3</key>
<value>1</value>
</param>
<param>
<key>width3</key>
<value>1</value>
</param>
<param>
<key>alpha4</key>
<value>1.0</value>
</param>
<param>
<key>color4</key>
<value>"black"</value>
</param>
<param>
<key>label4</key>
<value></value>
</param>
<param>
<key>marker4</key>
<value>-1</value>
</param>
<param>
<key>style4</key>
<value>1</value>
</param>
<param>
<key>width4</key>
<value>1</value>
</param>
<param>
<key>alpha5</key>
<value>1.0</value>
</param>
<param>
<key>color5</key>
<value>"cyan"</value>
</param>
<param>
<key>label5</key>
<value></value>
</param>
<param>
<key>marker5</key>
<value>-1</value>
</param>
<param>
<key>style5</key>
<value>1</value>
</param>
<param>
<key>width5</key>
<value>1</value>
</param>
<param>
<key>alpha6</key>
<value>1.0</value>
</param>
<param>
<key>color6</key>
<value>"magenta"</value>
</param>
<param>
<key>label6</key>
<value></value>
</param>
<param>
<key>marker6</key>
<value>-1</value>
</param>
<param>
<key>style6</key>
<value>1</value>
</param>
<param>
<key>width6</key>
<value>1</value>
</param>
<param>
<key>alpha7</key>
<value>1.0</value>
</param>
<param>
<key>color7</key>
<value>"yellow"</value>
</param>
<param>
<key>label7</key>
<value></value>
</param>
<param>
<key>marker7</key>
<value>-1</value>
</param>
<param>
<key>style7</key>
<value>1</value>
</param>
<param>
<key>width7</key>
<value>1</value>
</param>
<param>
<key>alpha8</key>
<value>1.0</value>
</param>
<param>
<key>color8</key>
<value>"dark red"</value>
</param>
<param>
<key>label8</key>
<value></value>
</param>
<param>
<key>marker8</key>
<value>-1</value>
</param>
<param>
<key>style8</key>
<value>1</value>
</param>
<param>
<key>width8</key>
<value>1</value>
</param>
<param>
<key>alpha9</key>
<value>1.0</value>
</param>
<param>
<key>color9</key>
<value>"dark green"</value>
</param>
<param>
<key>label9</key>
<value></value>
</param>
<param>
<key>marker9</key>
<value>-1</value>
</param>
<param>
<key>style9</key>
<value>1</value>
</param>
<param>
<key>width9</key>
<value>1</value>
</param>
<param>
<key>name</key>
<value>""</value>
</param>
<param>
<key>nconnections</key>
<value>1</value>
</param>
<param>
<key>size</key>
<value>1024</value>
</param>
<param>
<key>srate</key>
<value>samp_rate</value>
</param>
<param>
<key>stemplot</key>
<value>False</value>
</param>
<param>
<key>tr_chan</key>
<value>0</value>
</param>
<param>
<key>tr_delay</key>
<value>0.02</value>
</param>
<param>
<key>tr_level</key>
<value>0.0</value>
</param>
<param>
<key>tr_mode</key>
<value>qtgui.TRIG_MODE_TAG</value>
</param>
<param>
<key>tr_slope</key>
<value>qtgui.TRIG_SLOPE_POS</value>
</param>
<param>
<key>tr_tag</key>
<value>"time_est"</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>update_time</key>
<value>.1</value>
</param>
<param>
<key>ylabel</key>
<value>preamble correlation</value>
</param>
<param>
<key>yunit</key>
<value>""</value>
</param>
<param>
<key>ymax</key>
<value>2</value>
</param>
<param>
<key>ymin</key>
<value>-2</value>
</param>
</block>
<block> <block>
<key>qtgui_waterfall_sink_x</key> <key>qtgui_waterfall_sink_x</key>
<param> <param>
@ -1936,15 +1569,15 @@
</param> </param>
<param> <param>
<key>fftsize</key> <key>fftsize</key>
<value>128</value> <value>1024*4</value>
</param> </param>
<param> <param>
<key>_coordinate</key> <key>_coordinate</key>
<value>(1077, 112)</value> <value>(1098, 229)</value>
</param> </param>
<param> <param>
<key>gui_hint</key> <key>gui_hint</key>
<value></value> <value>(0,0,2,4)</value>
</param> </param>
<param> <param>
<key>_rotation</key> <key>_rotation</key>
@ -1964,7 +1597,7 @@
</param> </param>
<param> <param>
<key>int_min</key> <key>int_min</key>
<value>-140</value> <value>-80</value>
</param> </param>
<param> <param>
<key>legend</key> <key>legend</key>
@ -2187,12 +1820,6 @@
<source_key>0</source_key> <source_key>0</source_key>
<sink_key>0</sink_key> <sink_key>0</sink_key>
</connection> </connection>
<connection>
<source_block_id>preamble</source_block_id>
<sink_block_id>qtgui_time_sink_x_0_0</sink_block_id>
<source_key>0</source_key>
<sink_key>0</sink_key>
</connection>
<connection> <connection>
<source_block_id>preamble</source_block_id> <source_block_id>preamble</source_block_id>
<sink_block_id>qtgui_waterfall_sink_x_0</sink_block_id> <sink_block_id>qtgui_waterfall_sink_x_0</sink_block_id>

View file

@ -73,7 +73,7 @@ adaptive_dfe_impl::adaptive_dfe_impl(int sps, // samples per symbol
, _nF(nF) , _nF(nF)
, _nW(nW) , _nW(nW)
, _mu(0.01) , _mu(0.01)
, _alpha(0.0005) , _alpha(0.001)
, _py_module_name(python_module_name) , _py_module_name(python_module_name)
, _physicalLayer() , _physicalLayer()
, _taps_samples(nullptr) , _taps_samples(nullptr)
@ -212,25 +212,23 @@ adaptive_dfe_impl::general_work(int noutput_items,
known_symbol = _scramble[_symbol_counter] * descrambled_filter_output; known_symbol = _scramble[_symbol_counter] * descrambled_filter_output;
} }
gr_complex err = filter_output - known_symbol; gr_complex err = filter_output - known_symbol;
if (_symbol_counter >= 0) { for (int j=0; j<_nB+_nF+1; ++j) {
for (int j=0; j<_nB+_nF+1; ++j) { _taps_samples[j] -= _mu*err*std::conj(_hist_samples[_hist_sample_index+j]);
_taps_samples[j] -= _mu*err*std::conj(_hist_samples[_hist_sample_index+j]); }
} for (int j=0; j<_nW; ++j) {
for (int j=0; j<_nW; ++j) { assert(_hist_symbol_index+j < 2*_nW);
assert(_hist_symbol_index+j < 2*_nW); _taps_symbols[j] -= _mu*err*std::conj(_hist_symbols[_hist_symbol_index+j]) + _alpha*_taps_symbols[j];
_taps_symbols[j] -= _mu*err*std::conj(_hist_symbols[_hist_symbol_index+j]) + _alpha*_taps_symbols[j];
}
} }
// if (_sample_counter < 80*5) // if (_sample_counter < 80*5)
// std::cout << "filter: " << _symbol_counter << " " << _sample_counter << " " << filter_output << " " << known_symbol << " " << std::abs(err) << std::endl; // std::cout << "filter: " << _symbol_counter << " " << _sample_counter << " " << filter_output << " " << known_symbol << " " << std::abs(err) << std::endl;
} }
if (is_known) { if (is_known || true) {
_taps_symbols[_hist_symbol_index] = _taps_symbols[_hist_symbol_index + _nW] = known_symbol; _taps_symbols[_hist_symbol_index] = _taps_symbols[_hist_symbol_index + _nW] = known_symbol;
if (++_hist_symbol_index == _nW) if (++_hist_symbol_index == _nW)
_hist_symbol_index = 0; _hist_symbol_index = 0;
} }
_descrambled_symbols[_symbol_counter] = filter_output*std::conj(_scramble[_symbol_counter]); _descrambled_symbols[_symbol_counter] = filter_output*std::conj(_scramble[_symbol_counter]);
out[nout++] = filter_output; out[nout++] = filter_output*std::conj(_scramble[_symbol_counter]);
++_symbol_counter; ++_symbol_counter;
} }
_sample_counter += 1; _sample_counter += 1;
@ -330,8 +328,16 @@ void adaptive_dfe_impl::update_doppler_information(boost::python::object obj)
int const n = boost::python::extract<int>(obj.attr("__len__")()); int const n = boost::python::extract<int>(obj.attr("__len__")());
assert(n==2); assert(n==2);
bool const do_continue = boost::python::extract<bool>(obj[0]); bool const do_continue = boost::python::extract<bool>(obj[0]);
if (!do_continue) {
_state = WAIT_FOR_PREAMBLE;
_phase = 0;
_df = 0;
std::fill_n(_hist_samples, 2*(_nB+_nF+1), gr_complex(0));
_hist_sample_index = 0;
_sample_counter = 0;
return;
}
float const doppler = boost::python::extract<float>(obj[1]); float const doppler = boost::python::extract<float>(obj[1]);
update_pll(doppler); update_pll(doppler);
} }
@ -373,7 +379,7 @@ bool adaptive_dfe_impl::get_correlation_tag(uint64_t i, uint64_t& offset, float&
} }
if (v[j].key == pmt::mp("corr_est")) { if (v[j].key == pmt::mp("corr_est")) {
double const corr_est = pmt::to_double(v[j].value); double const corr_est = pmt::to_double(v[j].value);
if (v[j].offset - nitems_read(0) == offset)// && corr_est > 18e3) if (v[j].offset - nitems_read(0) == offset)// && corr_est > 10e3)
return true; return true;
} }
} }

View file

@ -6,7 +6,7 @@ from gnuradio import digital
class PhysicalLayer(object): class PhysicalLayer(object):
"""Physical layer description for STANAG 4285""" """Physical layer description for STANAG 4285"""
def __init__(self, mode=0): def __init__(self, mode=1):
"""For STANAG 4258 the mode has to be set manually: mode=0 -> BPSK, mode=1 -> QPSK, mode=2 -> 8PSK""" """For STANAG 4258 the mode has to be set manually: mode=0 -> BPSK, mode=1 -> QPSK, mode=2 -> 8PSK"""
self._constellations = [PhysicalLayer.make_psk(2, [0,1]), self._constellations = [PhysicalLayer.make_psk(2, [0,1]),
PhysicalLayer.make_psk(4, [0,1,3,2]), PhysicalLayer.make_psk(4, [0,1,3,2]),
@ -14,7 +14,7 @@ class PhysicalLayer(object):
self._preamble = [PhysicalLayer.get_preamble(), 0] ## BPSK self._preamble = [PhysicalLayer.get_preamble(), 0] ## BPSK
self._data = [PhysicalLayer.get_data(), mode] ## according to the mode self._data = [PhysicalLayer.get_data(), mode] ## according to the mode
self._counter = 0 self._counter = 0
self._preamble_phases = [] self._is_first_frame = True
def set_mode(self, mode): def set_mode(self, mode):
"""For STANAG 4258 the mode has to be set manually: mode=0 -> BPSK, mode=1 -> QPSK, mode=2 -> 8PSK""" """For STANAG 4258 the mode has to be set manually: mode=0 -> BPSK, mode=1 -> QPSK, mode=2 -> 8PSK"""
@ -26,22 +26,30 @@ class PhysicalLayer(object):
def get_frame(self): def get_frame(self):
"""returns the known+unknown symbols and scrambling""" """returns the known+unknown symbols and scrambling"""
print('-------------------- get_frame --------------------',self._counter) print('-------------------- get_frame --------------------',self._counter)
if self._counter == 0: return self._preamble if self._counter == 0 else self._data
x= self._preamble
else:
x=self._data
print('get_frame end\n')
return x;
def get_doppler(self, s): def get_doppler(self, s):
"""used for doppler shift update, for determining which frame to provide next, """used for doppler shift update, for determining which frame to provide next,
and for stopping at end of data/when the signal quality is too low""" and for stopping at end of data/when the signal quality is too low"""
print('-------------------- get_doppler --------------------',self._counter) print('-------------------- get_doppler --------------------',self._counter)
doppler = 0 success,doppler = self.quality_preamble(s) if self._counter == 0 else self.quality_data(s)
if self._counter == 0: ## preamble self._counter = (self._counter+1)&1 if success else 0
doppler = PhysicalLayer.data_aided_frequency_estimation(s, self._preamble[0]['symb']) self._is_first_frame = not success
self._counter = (self._counter+1)&1 return success,doppler
return [True, doppler]
def quality_preamble(self, s):
idx = range(80)
if self._is_first_frame:
idx = range(30,80)
z = s[idx]*np.conj(self._preamble[0]['symb'][idx])
success = np.sum(np.real(z)<0) < 30
doppler = PhysicalLayer.data_aided_frequency_estimation(s[idx], self._preamble[0]['symb'][idx])
return success,doppler
def quality_data(self, s):
known_symbols = np.mod(range(176),48)>=32
success = np.sum(np.real(s[known_symbols])<0) < 20
return success,0 ## no doppler estimate for data frames
@staticmethod @staticmethod
def get_preamble(): def get_preamble():
@ -73,9 +81,8 @@ class PhysicalLayer(object):
## PSK-8 modulation ## PSK-8 modulation
constellation = PhysicalLayer.make_psk(8,range(8))['points'] constellation = PhysicalLayer.make_psk(8,range(8))['points']
a['scramble'] = constellation[p,] a['scramble'] = constellation[p,]
a['symb'][ 32: 48] = a['scramble'][ 32: 48] ## mini-probe 1 known_symbols = np.mod(range(176),48)>=32
a['symb'][ 80: 96] = a['scramble'][ 80: 96] ## mini-probe 2 a['symb'][known_symbols] = a['scramble'][known_symbols]
a['symb'][128:144] = a['scramble'][128:144] ## mini-probe 3
return a return a
@staticmethod @staticmethod