Fix the doppler correction mechanism
The doppler correction mechanism has successfully passed the first tests using the GPredict software for the radio control. The corrections seems to be quite smooth. The next step is to apply it at an audible signal.
This commit is contained in:
parent
b218ed282c
commit
82c9ff2850
|
@ -1,38 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
<block>
|
||||
<name>doppler_correction_cc</name>
|
||||
<name>Doppler Correction</name>
|
||||
<key>satnogs_doppler_correction_cc</key>
|
||||
<category>satnogs</category>
|
||||
<import>import satnogs</import>
|
||||
<make>satnogs.doppler_correction_cc($target_freq)</make>
|
||||
<!-- Make one 'param' node for every Parameter you want settable from the GUI.
|
||||
Sub-nodes:
|
||||
* name
|
||||
* key (makes the value accessible as $keyname, e.g. in the make node)
|
||||
* type -->
|
||||
<make>satnogs.doppler_correction_cc($target_freq, $sampling_rate, $corrections_per_sec)</make>
|
||||
|
||||
<param>
|
||||
<name>...</name>
|
||||
<key>...</key>
|
||||
<type>...</type>
|
||||
<name>Target Frequency</name>
|
||||
<key>target_freq</key>
|
||||
<type>real</type>
|
||||
</param>
|
||||
|
||||
<param>
|
||||
<name>Sample Rate</name>
|
||||
<key>sampling_rate</key>
|
||||
<value>samp_rate</value>
|
||||
<type>real</type>
|
||||
</param>
|
||||
|
||||
<param>
|
||||
<name>Corrections per Second</name>
|
||||
<key>corrections_per_sec</key>
|
||||
<value>1000</value>
|
||||
<type>int</type>
|
||||
</param>
|
||||
|
||||
<!-- Make one 'sink' node per input. Sub-nodes:
|
||||
* name (an identifier for the GUI)
|
||||
* type
|
||||
* vlen
|
||||
* optional (set to 1 for optional inputs) -->
|
||||
<sink>
|
||||
<name>in</name>
|
||||
<type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
|
||||
<name>freq</name>
|
||||
<type>message</type>
|
||||
</sink>
|
||||
|
||||
<sink>
|
||||
<name>reset</name>
|
||||
<type>message</type>
|
||||
<optional>1</optional>
|
||||
</sink>
|
||||
|
||||
<sink>
|
||||
<name>in</name>
|
||||
<type>complex</type>
|
||||
</sink>
|
||||
|
||||
<!-- Make one 'source' node per output. Sub-nodes:
|
||||
* name (an identifier for the GUI)
|
||||
* type
|
||||
* vlen
|
||||
* optional (set to 1 for optional inputs) -->
|
||||
<source>
|
||||
<name>out</name>
|
||||
<type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
|
||||
<type>complex</type>
|
||||
</source>
|
||||
</block>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include "doppler_correction_cc_impl.h"
|
||||
#include <satnogs/log.h>
|
||||
#include <volk/volk.h>
|
||||
|
||||
namespace gr
|
||||
|
@ -104,11 +105,15 @@ namespace gr
|
|||
d_freq_diff = d_target_freq - new_freq;
|
||||
if (!d_have_est) {
|
||||
d_freq_est_num++;
|
||||
if (d_freq_est_num > d_est_thrhld - 1) {
|
||||
d_have_est = true;
|
||||
}
|
||||
d_doppler_freqs.push_back (
|
||||
freq_drift (nitems_written (0), d_freq_diff));
|
||||
if (d_freq_est_num > d_est_thrhld - 1) {
|
||||
d_doppler_fit_engine.fit (d_doppler_freqs);
|
||||
d_doppler_fit_engine.predict_freqs (d_predicted_freqs,
|
||||
d_corrections_per_sec,
|
||||
d_update_period);
|
||||
d_have_est = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
d_doppler_freqs.pop_front ();
|
||||
|
@ -121,6 +126,7 @@ namespace gr
|
|||
d_doppler_fit_engine.predict_freqs (d_predicted_freqs,
|
||||
d_corrections_per_sec,
|
||||
d_update_period);
|
||||
d_corrections = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,6 +186,7 @@ namespace gr
|
|||
d_update_period);
|
||||
d_corrections = 0;
|
||||
}
|
||||
}
|
||||
|
||||
cnt = std::min (d_update_period - d_corrected_samples,
|
||||
(size_t) (noutput_items - produced));
|
||||
|
@ -196,7 +203,6 @@ namespace gr
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
memcpy (out, in, noutput_items * sizeof(gr_complex));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue