commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r3460 - in gnuradio/branches/developers/jcorgan/wip/ez


From: jcorgan
Subject: [Commit-gnuradio] r3460 - in gnuradio/branches/developers/jcorgan/wip/ezdop/src/host: ezdop hunter/src tests
Date: Sat, 2 Sep 2006 16:19:04 -0600 (MDT)

Author: jcorgan
Date: 2006-09-02 16:19:04 -0600 (Sat, 02 Sep 2006)
New Revision: 3460

Modified:
   gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.cc
   gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.h
   gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/doppler.cc
   gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/hunter.cc
   gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/tests/dopper.cc
Log:
Work in progress.


Modified: gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.cc      
2006-09-02 21:07:58 UTC (rev 3459)
+++ gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.cc      
2006-09-02 22:19:04 UTC (rev 3460)
@@ -224,7 +224,7 @@
 
 typedef boost::scoped_array<unsigned char> unsigned_char_scoped_array;
 
-int ezdop::read_iq(complex<float> *buffer, unsigned int samples)
+int ezdop::read_iq(complex<float> *buffer, unsigned int samples, float &volume)
 {
     assert(d_online);
     assert(d_device);
@@ -276,6 +276,7 @@
             d_in_phase -= d_val;
         else if (d_ant == 1)            // -Q
             d_quadrature -= d_val;
+
         d_val = 0;
     
         // Update expected antenna and sequence
@@ -296,5 +297,6 @@
         d_state = ST_LO;  // Switch states
     };
 
+    volume = 0.0;
     return j;
 }

Modified: gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.h
===================================================================
--- gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.h       
2006-09-02 21:07:58 UTC (rev 3459)
+++ gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/ezdop/ezdop.h       
2006-09-02 22:19:04 UTC (rev 3460)
@@ -57,7 +57,7 @@
     int read_raw(unsigned char *buffer, unsigned int length);
 
     // Read synced, downconverted I and Q samples, one per rotation
-    int read_iq(complex<float> *buffer, unsigned int samples);
+    int read_iq(complex<float> *buffer, unsigned int samples, float &volume);
 
     // Status
     bool is_online() const { return d_online; }

Modified: 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/doppler.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/doppler.cc   
    2006-09-02 21:07:58 UTC (rev 3459)
+++ 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/doppler.cc   
    2006-09-02 22:19:04 UTC (rev 3460)
@@ -191,14 +191,11 @@
 
 bool EZDoppler::SetFilter(int n)
 {
-    // TODO: reimplement filtering
+    float beta = 30.0/(n*m_ezdop->rate()); // Empirically determined
 
-    float beta = 10.0/(n*n* m_ezdop->rate()); // Empirically determined
-
     m_alpha = complex<float>(1.0-beta, 0.0);
     m_beta = complex<float>(beta, 0.0);
 
-    wxLogDebug(_T("EZDoppler::SetFilter: %i %f %f"), n, 1.0-beta, beta);
     return true;
 }
 
@@ -211,7 +208,7 @@
 {
     int nsamples = (int)(m_ezdop->rate()*QUANTUM);
 
-    if (!m_ezdop->read_iq(buffer, nsamples))
+    if (!m_ezdop->read_iq(buffer, nsamples, volume))
         return false;
 
     for (int i=0; i < nsamples; i++)
@@ -227,11 +224,11 @@
     complex<float> cal = complex<float>(cos(cal_angle), sin(cal_angle));
     m_output = m_phase*cal;
 
-    in_phase = m_output.real()*nsamples;
-    quadrature = m_output.imag()*nsamples;
-    volume = 0.0; // not yet implemented in libezdop
-
-    wxLogDebug(_T("%f %f %f"), in_phase, quadrature, volume);
+    in_phase = m_output.real()*nsamples/512.0;
+    quadrature = m_output.imag()*nsamples/512.0;
+    // adjust volume
+    
+//  wxLogDebug(_T("%f %f %f"), in_phase, quadrature, volume);
     return true;
 }
 
@@ -250,7 +247,7 @@
 
     wxASSERT(rate >= 0 && rate < 7);
     if (rate < 6)
-        m_calibration[m_selected_rate] = offset;
+        m_calibration[rate] = offset;
     else
         m_offset = offset;
 

Modified: 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/hunter.cc
===================================================================
--- 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/hunter.cc    
    2006-09-02 21:07:58 UTC (rev 3459)
+++ 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/hunter/src/hunter.cc    
    2006-09-02 22:19:04 UTC (rev 3460)
@@ -513,19 +513,6 @@
     m_sample.Phase(atan2(event.m_quadrature, event.m_in_phase));
 
     UpdateDopplerStatus(true);
-
-    if (m_log && m_gps_started && m_capture &&
-        m_sample.Speed() >= 5.0 && m_sample.Valid()) {
-        m_log->Add(m_sample);
-        if (m_one_shot == true) {
-            StopCapture();
-            CalcSolution();
-            if (m_search.HasSolution()) {
-                UpdateSearchStatus(true);
-                UpdateSearchDirection(true);
-            }
-        }
-    }
 }
 
 void HunterFrame::UpdateDopplerStatus(bool display)
@@ -606,7 +593,7 @@
     static int delay;
     
     if (which == 0) {       // Set up doppler 
-        delay = XRCCTRL(*this, "doppler_filter_slider", 
wxSlider)->GetValue()*2; // Empirically determined
+        delay = XRCCTRL(*this, "doppler_filter_slider", wxSlider)->GetValue(); 
// Empirically determined
         if (delay == 0)
             delay = 1;
     }
@@ -699,12 +686,20 @@
     UpdateGPSValidity(update.m_gprmc->m_valid);                 // Colors red 
for invalid, black for valid
     UpdateGPSStatus(true);                                      // gps lat, 
lon, heading, speed
     UpdateKnownDirection();                                     // actual 
bearing and range
-
     CalcKnownStatistics();
-    if (m_capture)
+
+    if (m_log && m_capture && m_doppler_started &&
+        m_sample.Speed() >= 5.0 && m_sample.Valid()) {
+        m_log->Add(m_sample);
         CalcSolution();
-    if (m_search.HasSolution())
+        if (m_one_shot == true)
+            StopCapture();
+    }
+
+    if (m_search.HasSolution()) {
+        UpdateSearchStatus(true);
         UpdateSearchDirection(true);
+    }
         
     delete update.m_gprmc;
 }

Modified: 
gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/tests/dopper.cc
===================================================================
--- gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/tests/dopper.cc     
2006-09-02 21:07:58 UTC (rev 3459)
+++ gnuradio/branches/developers/jcorgan/wip/ezdop/src/host/tests/dopper.cc     
2006-09-02 22:19:04 UTC (rev 3460)
@@ -57,9 +57,11 @@
     else
        printf("failed.\n");
 
+    float volume;
+
     for (int i = 0; i < chunks; i++) {
         printf("Asking EZDOP for %i samples...", samples);
-        int rd = dop->read_iq(buffer, samples);
+        int rd = dop->read_iq(buffer, samples, volume);
        printf("got %i --- ", rd);
        if (rd != samples)
            printf("*****\n");





reply via email to

[Prev in Thread] Current Thread [Next in Thread]