rescaled waterfall and spectrum to be 300Hz wide, as per fdmdv1
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 27 Nov 2012 03:39:17 +0000 (03:39 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 27 Nov 2012 03:39:17 +0000 (03:39 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@1082 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2/src/fdmdv2_defines.h
fdmdv2/src/fdmdv2_main.cpp
fdmdv2/src/fdmdv2_plot_spectrum.cpp
fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp

index f751c717c80e87b336157c909384d8791010e6f9..92ad3de8d0976c899fd831c3c808f1469b5a1672 100644 (file)
@@ -31,7 +31,7 @@
 #define STEP_MAG_DB         5.0     // magnitude axis step
 #define BETA                0.95    // constant for time averaging spectrum data
 #define MIN_F_HZ            0       // min freq on Waterfall and Spectrum
-#define MAX_F_HZ            4000    // max freq on Waterfall and Spectrum
+#define MAX_F_HZ            3000    // max freq on Waterfall and Spectrum
 #define STEP_F_HZ           500     // major (e.g. text legend) freq step on Waterfall and Spectrum graticule
 #define STEP_MINOR_F_HZ     100     // minor (ticks) freq step on Waterfall and Spectrum graticule
 #define WATERFALL_SECS_Y    30      // number of seconds respresented by y axis of waterfall
index 216576502f03bedf5a12e6713fc387bdb5140449..b4cfbfedf4c3d4d71733344e05142032050e3061 100644 (file)
@@ -309,7 +309,7 @@ MainFrame::MainFrame(wxWindow *parent) : TopFrame(parent)
     wxGetApp().m_playFileToMicInPath = pConfig->Read("/File/playFileToMicInPath", wxT(""));
     wxGetApp().m_recFileFromRadioPath = pConfig->Read("/File/recFileFromRadioPath", wxT(""));
     wxGetApp().m_recFileFromRadioSecs = pConfig->Read("/File/recFileFromRadioSecs", 30);
-    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileToFromRadioPath", wxT(""));
+    wxGetApp().m_playFileFromRadioPath = pConfig->Read("/File/playFileFromRadioPath", wxT(""));
 
     bool slow = false; // prevents compile error when using default bool
     wxGetApp().m_snrSlow = pConfig->Read("/Audio/snrSlow", slow);
@@ -2216,7 +2216,7 @@ void per_frame_rx_processing(
                     data_flag_index = codec2_get_spare_bit_index(c2);
                     assert(data_flag_index != -1); // not supported for all rates
                     
-                    if (0/*codec_bits[data_flag_index]*/) {
+                    if (codec_bits[data_flag_index]) {
                         //printf("data_flag_index: %d\n", data_flag_index);
                         //printf("rx data bits: ");
                         //for(i=0; i<BITS_PER_CODEC_FRAME; i++)
index 12940be07ec5ff10be5068190f3d67c38ccf25bd..0e894f9291230a422e5abecca61eb15095c3b5da 100644 (file)
@@ -123,12 +123,13 @@ void PlotSpectrum::draw(wxAutoBufferedPaintDC& dc)
         pen.SetWidth(1);
         dc.SetPen(pen);
 
-       index_to_px = (float)m_rGrid.GetWidth()/FDMDV_NSPEC;
+        index_to_px = ((float)FDMDV_MAX_F_HZ/(float)MAX_F_HZ)*(float)m_rGrid.GetWidth()/FDMDV_NSPEC;
        mag_dB_to_py = (float)m_rGrid.GetHeight()/(MAX_MAG_DB-MIN_MAG_DB);
+        int last_index = ((float)MAX_F_HZ/(float)FDMDV_MAX_F_HZ)*FDMDV_NSPEC;
 
        prev_x = PLOT_BORDER + XLEFT_OFFSET;
        prev_y = PLOT_BORDER;
-        for(index = 0; index < FDMDV_NSPEC; index++)
+        for(index = 0; index < last_index; index++)
         {
             x = index*index_to_px;
            mag = g_avmag[index];
index 65eb040138dc75a71812e51b2b39962906b8ea47..a4fc3148c09007d7c0e60bf85d4b3768f763480e 100644 (file)
@@ -339,7 +339,7 @@ void PlotWaterfall::plotPixelData()
     //printf("max_mag: %f m_max_mag: %f\n", max_mag, m_max_mag);
     //intensity_per_dB  = (float)256 /(MAX_MAG_DB - MIN_MAG_DB);
     intensity_per_dB  = (float)256 /(m_max_mag - m_min_mag);
-    spec_index_per_px = (float)FDMDV_NSPEC / (float) m_rGrid.GetWidth();
+    spec_index_per_px = ((float)MAX_F_HZ/(float)FDMDV_MAX_F_HZ)*(float)FDMDV_NSPEC / (float) m_rGrid.GetWidth();
 
     /*
     printf("h %d w %d px_per_sec %d dy %d dy_blocks %d spec_index_per_px: %f\n",