summaryrefslogtreecommitdiff
path: root/gnuradio-core/src
diff options
context:
space:
mode:
authorTom Rondeau2011-09-23 14:20:10 -0400
committerTom Rondeau2011-09-23 14:20:10 -0400
commitbffea9f3793b8c20bc2e492caeaa69fde90098ee (patch)
tree74ddfe1b67c9899b751d615f8891190853412468 /gnuradio-core/src
parent46168fbd1e3dfb68cafe2b512641c67e2a6b5d80 (diff)
downloadgnuradio-bffea9f3793b8c20bc2e492caeaa69fde90098ee.tar.gz
gnuradio-bffea9f3793b8c20bc2e492caeaa69fde90098ee.tar.bz2
gnuradio-bffea9f3793b8c20bc2e492caeaa69fde90098ee.zip
fixing PLL's using new control_loop class so their output update is done at the right time; were lagging by a sample before.
Diffstat (limited to 'gnuradio-core/src')
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc6
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc4
-rw-r--r--gnuradio-core/src/lib/general/gr_pll_refout_cc.cc6
3 files changed, 8 insertions, 8 deletions
diff --git a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
index 583e0eb70..e8ec1e235 100644
--- a/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
+++ b/gnuradio-core/src/lib/general/gr_pll_carriertracking_cc.cc
@@ -101,15 +101,15 @@ gr_pll_carriertracking_cc::work (int noutput_items,
float t_imag, t_real;
for (int i = 0; i < noutput_items; i++){
+ gr_sincosf(d_phase, &t_imag, &t_real);
+ optr[i] = iptr[i] * gr_complex(t_real, -t_imag);
+
error = phase_detector(iptr[i],d_phase);
advance_loop(error);
phase_wrap();
frequency_limit();
- gr_sincosf(d_phase, &t_imag, &t_real);
- optr[i] = iptr[i] * gr_complex(t_real, -t_imag);
-
d_locksig = d_locksig * (1.0 - d_alpha) + \
d_alpha*(iptr[i].real() * t_real + iptr[i].imag() * t_imag);
diff --git a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
index 0ae773e6e..aa0d67855 100644
--- a/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
+++ b/gnuradio-core/src/lib/general/gr_pll_freqdet_cf.cc
@@ -78,13 +78,13 @@ gr_pll_freqdet_cf::work (int noutput_items,
int size = noutput_items;
while (size-- > 0) {
+ *optr++ = d_freq;
+
error = phase_detector(*iptr++,d_phase);
advance_loop(error);
phase_wrap();
frequency_limit();
-
- *optr++ = d_freq;
}
return noutput_items;
}
diff --git a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
index 2b480fcf1..dfd5079da 100644
--- a/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
+++ b/gnuradio-core/src/lib/general/gr_pll_refout_cc.cc
@@ -80,14 +80,14 @@ gr_pll_refout_cc::work (int noutput_items,
int size = noutput_items;
while (size-- > 0) {
+ gr_sincosf(d_phase,&t_imag,&t_real);
+ *optr++ = gr_complex(t_real,t_imag);
+
error = phase_detector(*iptr++,d_phase);
advance_loop(error);
phase_wrap();
frequency_limit();
-
- gr_sincosf(d_phase,&t_imag,&t_real);
- *optr++ = gr_complex(t_real,t_imag);
}
return noutput_items;
}