[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r4660 - gnuradio/branches/developers/trondeau/digital-
From: |
trondeau |
Subject: |
[Commit-gnuradio] r4660 - gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general |
Date: |
Tue, 27 Feb 2007 10:42:25 -0700 (MST) |
Author: trondeau
Date: 2007-02-27 10:42:25 -0700 (Tue, 27 Feb 2007)
New Revision: 4660
Modified:
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
Log:
minor adjustments
Modified:
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
===================================================================
---
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
2007-02-27 15:26:44 UTC (rev 4659)
+++
gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general/gr_mpsk_receiver_cc.cc
2007-02-27 17:42:25 UTC (rev 4660)
@@ -123,14 +123,16 @@
}
+// 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());
- return phase_error;
+ 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
{
@@ -143,6 +145,7 @@
return -arg(sample*conj(d_constellation[d_current_const_point]));
}
+// FIXME add these back in an test difference in performance
unsigned int
gr_mpsk_receiver_cc::decision_bpsk(gr_complex sample) const
{
@@ -154,6 +157,7 @@
return index;
}
+// FIXME add these back in an test difference in performance
unsigned int
gr_mpsk_receiver_cc::decision_qpsk(gr_complex sample) const
{
@@ -178,7 +182,7 @@
// Develop all possible constellation points and find the one that minimizes
// the Euclidean distance (error) with the sample
for(unsigned int m=0; m < d_M; m++) {
- gr_complex diff = ( d_constellation[m] - sample)*( d_constellation[m] -
sample);
+ gr_complex diff = norm(d_constellation[m] - sample);
if(fabs(diff.real()) < min_s) {
min_s = fabs(diff.real());
@@ -275,7 +279,12 @@
// Make phase and frequency corrections based on sampled value
phase_error = (*this.*d_phase_error_detector)(sample);
-
+
+ if (phase_error > 1)
+ phase_error = 1;
+ else if (phase_error < -1)
+ phase_error = -1;
+
d_freq += d_beta*phase_error; // adjust frequency based on error
d_phase += d_freq + d_alpha*phase_error; // adjust phase based on error
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r4660 - gnuradio/branches/developers/trondeau/digital-wip2/gnuradio-core/src/lib/general,
trondeau <=