[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10040 - in gnuradio/trunk/gnuradio-core/src: lib/gene
From: |
trondeau |
Subject: |
[Commit-gnuradio] r10040 - in gnuradio/trunk/gnuradio-core/src: lib/general python/gnuradio/blks2impl |
Date: |
Sun, 23 Nov 2008 10:10:23 -0700 (MST) |
Author: trondeau
Date: 2008-11-23 10:10:23 -0700 (Sun, 23 Nov 2008)
New Revision: 10040
Modified:
gnuradio/trunk/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
Log:
fixing sync routines by wrapping the angle and not clipping it; also opening up
the frequency sync range a bit.
Modified: gnuradio/trunk/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
===================================================================
--- gnuradio/trunk/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
2008-11-23 16:38:54 UTC (rev 10039)
+++ gnuradio/trunk/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
2008-11-23 17:10:23 UTC (rev 10040)
@@ -90,12 +90,12 @@
// Select a phase detector and a decision maker for the modulation order
switch(d_M) {
case 2: // optimized algorithms for BPSK
- d_phase_error_detector =
&gr_mpsk_receiver_cc::phase_error_detector_generic; //bpsk;
+ d_phase_error_detector = &gr_mpsk_receiver_cc::phase_error_detector_bpsk;
//bpsk;
d_decision = &gr_mpsk_receiver_cc::decision_bpsk;
break;
case 4: // optimized algorithms for QPSK
- d_phase_error_detector =
&gr_mpsk_receiver_cc::phase_error_detector_generic; //qpsk;
+ d_phase_error_detector = &gr_mpsk_receiver_cc::phase_error_detector_qpsk;
//qpsk;
d_decision = &gr_mpsk_receiver_cc::decision_qpsk;
break;
@@ -104,8 +104,6 @@
d_decision = &gr_mpsk_receiver_cc::decision_generic;
break;
}
-
- set_history(3); // ensure 2 extra input sample is
available
}
gr_mpsk_receiver_cc::~gr_mpsk_receiver_cc ()
@@ -119,24 +117,21 @@
unsigned ninputs = ninput_items_required.size();
for (unsigned i=0; i < ninputs; i++)
ninput_items_required[i] = (int) ceil((noutput_items * d_omega) +
d_interp->ntaps());
- //ninput_items_required[i] = (int)(d_omega);
-
}
// FIXME add these back in an test difference in performance
float
gr_mpsk_receiver_cc::phase_error_detector_qpsk(gr_complex sample) const
{
- float phase_error = ((sample.real()>0 ? 1.0 : -1.0) * sample.imag() -
- (sample.imag()>0 ? 1.0 : -1.0) * sample.real());
+ float phase_error = -((sample.real()>0 ? 1.0 : -1.0) * sample.imag() -
+ (sample.imag()>0 ? 1.0 : -1.0) * sample.real());
return -phase_error;
}
-// FIXME add these back in an test difference in performance
float
gr_mpsk_receiver_cc::phase_error_detector_bpsk(gr_complex sample) const
{
- return (sample.real()*sample.imag());
+ return -(sample.real()*sample.imag());
}
float gr_mpsk_receiver_cc::phase_error_detector_generic(gr_complex sample)
const
@@ -200,7 +195,10 @@
d_phase += d_freq; // increment the phase based on the frequency of the
rotation
// Keep phase clamped and not walk to infinity
- d_phase = gr_branchless_clip(d_phase, M_TWOPI);
+ while(d_phase > M_TWOPI)
+ d_phase -= M_TWOPI;
+ while(d_phase < -M_TWOPI)
+ d_phase += M_TWOPI;
nco = gr_expj(d_phase+d_theta); // get the NCO value for derotating the
current sample
sample = nco*symbol; // get the downconverted symbol
@@ -262,7 +260,10 @@
d_phase += d_freq + d_alpha*phase_error; // adjust phase based on error
// Make sure we stay within +-2pi
- d_phase = gr_branchless_clip(d_phase, M_TWOPI);
+ while(d_phase > M_TWOPI)
+ d_phase -= M_TWOPI;
+ while(d_phase < -M_TWOPI)
+ d_phase += M_TWOPI;
// Limit the frequency range
d_freq = gr_branchless_clip(d_freq, d_max_freq);
Modified: gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
===================================================================
--- gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
2008-11-23 16:38:54 UTC (rev 10039)
+++ gnuradio/trunk/gnuradio-core/src/python/gnuradio/blks2impl/dbpsk.py
2008-11-23 17:10:23 UTC (rev 10040)
@@ -255,8 +255,8 @@
self._mm_omega = self._samples_per_symbol
self._mm_gain_omega = .25 * self._mm_gain_mu * self._mm_gain_mu
self._costas_beta = 0.25 * self._costas_alpha * self._costas_alpha
- fmin = -0.025
- fmax = 0.025
+ fmin = -0.1
+ fmax = 0.1
self.receiver=gr.mpsk_receiver_cc(arity, 0,
self._costas_alpha, self._costas_beta,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10040 - in gnuradio/trunk/gnuradio-core/src: lib/general python/gnuradio/blks2impl,
trondeau <=