Increased robustness of feed-forward freq. correction

- Increased pilot sequence length to 16 symbols
- Calculate phase difference from start for all symbols instead of
  averaging over pilot blocks
This commit is contained in:
Thomas Kolb 2019-09-14 23:36:04 +02:00
parent 1c287466db
commit da4c9e08d4
4 changed files with 495 additions and 9 deletions

View file

@ -126,7 +126,11 @@ namespace gr {
size_t last_off = d_phase_ref_offset; size_t last_off = d_phase_ref_offset;
float last_phase = 0.0f; float last_phase = 0.0f;
for(size_t off: d_offsets) { // method 1: average over the complex vectors of the de-rotated pilot
// symbols in each block, then calculate the phase and average the
// phases change from one block to the next
/*for(size_t off: d_offsets) {
gr_complex sum(0, 0); gr_complex sum(0, 0);
size_t n = 0; size_t n = 0;
@ -138,12 +142,33 @@ namespace gr {
sum /= n; sum /= n;
float phase = gr::fast_atan2f(sum); // FIXME? unwrap float phase = gr::fast_atan2f(sum); // FIXME? unwrap
phase_sum += (phase - last_phase) / (off - last_off); phase_sum += (phase - last_phase) / (off - last_off + d_pilot_sequence.size()/2);
last_phase = phase; last_phase = phase;
last_off = off; last_off = off;
} }
d_phase_inc_per_symbol = -phase_sum / d_offsets.size(); d_phase_inc_per_symbol = -phase_sum / d_offsets.size();*/
// method 2: calculate the frequency offset for each pilot symbol in
// each block with respect to the reference position. Then average
// over all frequency offsets.
float phase_inc_per_symbol_sum = 0.0f;
for(size_t off: d_offsets) {
size_t n = 0;
for(const gr_complex &ref_sym: d_pilot_sequence) {
gr_complex derot_symbol = d_packet[off+n] * conj(ref_sym);
float phase = gr::fast_atan2f(derot_symbol);
phase_inc_per_symbol_sum += phase / (off + n - d_phase_ref_offset);
n++;
}
}
d_phase_inc_per_symbol = -phase_inc_per_symbol_sum / (d_pilot_sequence.size() * d_offsets.size());
d_current_phase = (-(int)d_phase_ref_offset - 1) * d_phase_inc_per_symbol; d_current_phase = (-(int)d_phase_ref_offset - 1) * d_phase_inc_per_symbol;
//std::cout << "initial phase: " << d_current_phase << std::endl; //std::cout << "initial phase: " << d_current_phase << std::endl;

View file

@ -351,6 +351,60 @@
<value>[0, 1, 3, 2]</value> <value>[0, 1, 3, 2]</value>
</param> </param>
</block> </block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1525, 75)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pilot_offset</value>
</param>
<param>
<key>value</key>
<value>256</value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1525, 11)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pilot_sequence</value>
</param>
<param>
<key>value</key>
<value>[1.+1.j, 1.+1.j, -1.+1.j, 1.+1.j, -1.+1.j, 1.+1.j, 1.-1.j, -1.+1.j, 1.+1.j, 1.-1.j, 1.-1.j, 1.+1.j, -1.+1.j, 1.-1.j, 1.+1.j, -1.-1.j]</value>
</param>
</block>
<block> <block>
<key>variable</key> <key>variable</key>
<param> <param>
@ -1928,7 +1982,7 @@
</param> </param>
<param> <param>
<key>offsets</key> <key>offsets</key>
<value>[len(preamble)+128, len(preamble)+256+4]</value> <value>[len(preamble)+pilot_offset]</value>
</param> </param>
<param> <param>
<key>maxoutbuf</key> <key>maxoutbuf</key>
@ -1944,7 +1998,7 @@
</param> </param>
<param> <param>
<key>pilot_sequence</key> <key>pilot_sequence</key>
<value>[1+1j, -1-1j, 1-1j, -1+1j]</value> <value>pilot_sequence</value>
</param> </param>
<param> <param>
<key>start_tag</key> <key>start_tag</key>
@ -2112,7 +2166,7 @@
</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>

View file

@ -316,6 +316,60 @@
<value>[0, 1, 3, 2]</value> <value>[0, 1, 3, 2]</value>
</param> </param>
</block> </block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1333, 75)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pilot_offset</value>
</param>
<param>
<key>value</key>
<value>256</value>
</param>
</block>
<block>
<key>variable</key>
<param>
<key>comment</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>1</value>
</param>
<param>
<key>_coordinate</key>
<value>(1333, 11)</value>
</param>
<param>
<key>_rotation</key>
<value>0</value>
</param>
<param>
<key>id</key>
<value>pilot_sequence</value>
</param>
<param>
<key>value</key>
<value>[1.+1.j, 1.+1.j, -1.+1.j, 1.+1.j, -1.+1.j, 1.+1.j, 1.-1.j, -1.+1.j, 1.+1.j, 1.-1.j, 1.-1.j, 1.+1.j, -1.+1.j, 1.-1.j, 1.+1.j, -1.-1.j]</value>
</param>
</block>
<block> <block>
<key>variable</key> <key>variable</key>
<param> <param>
@ -1148,7 +1202,7 @@
</param> </param>
<param> <param>
<key>offsets</key> <key>offsets</key>
<value>[len(preamble)+128, len(preamble)+256]</value> <value>[len(preamble)+pilot_offset]</value>
</param> </param>
<param> <param>
<key>length_tag</key> <key>length_tag</key>
@ -1164,7 +1218,7 @@
</param> </param>
<param> <param>
<key>pilot_sequence</key> <key>pilot_sequence</key>
<value>[1+1j, -1-1j, 1-1j, -1+1j]</value> <value>pilot_sequence</value>
</param> </param>
</block> </block>
<block> <block>

View file

@ -794,6 +794,353 @@
<value>import numpy as np</value> <value>import numpy as np</value>
</param> </param>
</block> </block>
<block>
<key>qtgui_const_sink_x</key>
<param>
<key>autoscale</key>
<value>False</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>affinity</key>
<value></value>
</param>
<param>
<key>_enabled</key>
<value>True</value>
</param>
<param>
<key>_coordinate</key>
<value>(726, 403)</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_const_sink_x_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></value>
</param>
<param>
<key>marker1</key>
<value>0</value>
</param>
<param>
<key>style1</key>
<value>0</value>
</param>
<param>
<key>width1</key>
<value>1</value>
</param>
<param>
<key>alpha10</key>
<value>1.0</value>
</param>
<param>
<key>color10</key>
<value>"red"</value>
</param>
<param>
<key>label10</key>
<value></value>
</param>
<param>
<key>marker10</key>
<value>0</value>
</param>
<param>
<key>style10</key>
<value>0</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></value>
</param>
<param>
<key>marker2</key>
<value>0</value>
</param>
<param>
<key>style2</key>
<value>0</value>
</param>
<param>
<key>width2</key>
<value>1</value>
</param>
<param>
<key>alpha3</key>
<value>1.0</value>
</param>
<param>
<key>color3</key>
<value>"red"</value>
</param>
<param>
<key>label3</key>
<value></value>
</param>
<param>
<key>marker3</key>
<value>0</value>
</param>
<param>
<key>style3</key>
<value>0</value>
</param>
<param>
<key>width3</key>
<value>1</value>
</param>
<param>
<key>alpha4</key>
<value>1.0</value>
</param>
<param>
<key>color4</key>
<value>"red"</value>
</param>
<param>
<key>label4</key>
<value></value>
</param>
<param>
<key>marker4</key>
<value>0</value>
</param>
<param>
<key>style4</key>
<value>0</value>
</param>
<param>
<key>width4</key>
<value>1</value>
</param>
<param>
<key>alpha5</key>
<value>1.0</value>
</param>
<param>
<key>color5</key>
<value>"red"</value>
</param>
<param>
<key>label5</key>
<value></value>
</param>
<param>
<key>marker5</key>
<value>0</value>
</param>
<param>
<key>style5</key>
<value>0</value>
</param>
<param>
<key>width5</key>
<value>1</value>
</param>
<param>
<key>alpha6</key>
<value>1.0</value>
</param>
<param>
<key>color6</key>
<value>"red"</value>
</param>
<param>
<key>label6</key>
<value></value>
</param>
<param>
<key>marker6</key>
<value>0</value>
</param>
<param>
<key>style6</key>
<value>0</value>
</param>
<param>
<key>width6</key>
<value>1</value>
</param>
<param>
<key>alpha7</key>
<value>1.0</value>
</param>
<param>
<key>color7</key>
<value>"red"</value>
</param>
<param>
<key>label7</key>
<value></value>
</param>
<param>
<key>marker7</key>
<value>0</value>
</param>
<param>
<key>style7</key>
<value>0</value>
</param>
<param>
<key>width7</key>
<value>1</value>
</param>
<param>
<key>alpha8</key>
<value>1.0</value>
</param>
<param>
<key>color8</key>
<value>"red"</value>
</param>
<param>
<key>label8</key>
<value></value>
</param>
<param>
<key>marker8</key>
<value>0</value>
</param>
<param>
<key>style8</key>
<value>0</value>
</param>
<param>
<key>width8</key>
<value>1</value>
</param>
<param>
<key>alpha9</key>
<value>1.0</value>
</param>
<param>
<key>color9</key>
<value>"red"</value>
</param>
<param>
<key>label9</key>
<value></value>
</param>
<param>
<key>marker9</key>
<value>0</value>
</param>
<param>
<key>style9</key>
<value>0</value>
</param>
<param>
<key>width9</key>
<value>1</value>
</param>
<param>
<key>name</key>
<value>"Synced symbols"</value>
</param>
<param>
<key>nconnections</key>
<value>1</value>
</param>
<param>
<key>size</key>
<value>2048</value>
</param>
<param>
<key>tr_chan</key>
<value>0</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>"corr_est"</value>
</param>
<param>
<key>type</key>
<value>complex</value>
</param>
<param>
<key>update_time</key>
<value>0.5</value>
</param>
<param>
<key>xmax</key>
<value>2</value>
</param>
<param>
<key>xmin</key>
<value>-2</value>
</param>
<param>
<key>ymax</key>
<value>2</value>
</param>
<param>
<key>ymin</key>
<value>-2</value>
</param>
</block>
<block> <block>
<key>qtgui_number_sink</key> <key>qtgui_number_sink</key>
<param> <param>
@ -1383,7 +1730,7 @@
</param> </param>
<param> <param>
<key>_enabled</key> <key>_enabled</key>
<value>1</value> <value>0</value>
</param> </param>
<param> <param>
<key>fftsize</key> <key>fftsize</key>
@ -2254,6 +2601,12 @@
<source_key>pdu_out</source_key> <source_key>pdu_out</source_key>
<sink_key>print_pdu</sink_key> <sink_key>print_pdu</sink_key>
</connection> </connection>
<connection>
<source_block_id>hamnet70_demod_sc16qam_0</source_block_id>
<sink_block_id>qtgui_const_sink_x_0</sink_block_id>
<source_key>1</source_key>
<sink_key>0</sink_key>
</connection>
<connection> <connection>
<source_block_id>hamnet70_demod_sc16qam_0</source_block_id> <source_block_id>hamnet70_demod_sc16qam_0</source_block_id>
<sink_block_id>qtgui_sink_x_1</sink_block_id> <sink_block_id>qtgui_sink_x_1</sink_block_id>