git-svn-id: https://svn.code.sf.net/p/freetel/code@662 01035d8c-6547-0410-b346-abe4f9...
authorwittend99 <wittend99@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 5 Sep 2012 02:47:34 +0000 (02:47 +0000)
committerwittend99 <wittend99@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 5 Sep 2012 02:47:34 +0000 (02:47 +0000)
fdmdv2/build/fdmdv2.mk
fdmdv2/src/fdmdv2_main.cpp
fdmdv2/src/fdmdv2_main.h
fdmdv2/src/fdmdv2_plot.cpp
fdmdv2/src/fdmdv2_plot.h
fdmdv2/src/fdmdv2_plot_spectrum.cpp
fdmdv2/src/fdmdv2_plot_waterfall.cpp
fdmdv2/src/fdmdv2_plot_waterfall.h
fdmdv2/src/fdmdv2_process_audio.cpp

index ed18971c271def37dbb3e5461f902014c555f58f..734f6ed3ed76e394c88c45a64a5473e9e633b19b 100644 (file)
@@ -50,8 +50,8 @@ LibPath                := $(LibraryPathSwitch). $(LibraryPathSwitch)/bin/MinGW/m
 AR       := ar rcus\r
 CXX      := g++\r
 CC       := gcc\r
-CXXFLAGS :=  -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no)  -DSVN_REVISION=\"647\"  $(Preprocessors)\r
-CFLAGS   :=  -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no)  -DSVN_REVISION=\"647\"  $(Preprocessors)\r
+CXXFLAGS :=  -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no)  -DSVN_REVISION=\"658\"  $(Preprocessors)\r
+CFLAGS   :=  -O2 -Wall $(shell wx-config --cxxflags --unicode=yes --debug=no)  -DSVN_REVISION=\"658\"  $(Preprocessors)\r
 \r
 \r
 ##\r
index 668048b70e6fcb4ffbb0dafdecbedc4e6e47e861..4cbd0f3eeaaf2c0463db35b127d631dfc54b2af7 100644 (file)
@@ -469,7 +469,6 @@ void MainFrame::startTxStream()
             wxMessageBox(wxT("Tx Stream Start Error."), wxT("Error"), wxOK);\r
             return;\r
         }
-//        OnTogBtnOnOff->SetLabel(wxT("Stop"));\r
     }\r
 }\r
 \r
@@ -483,7 +482,6 @@ void MainFrame::stopTxStream()
         m_TxRunning = false;\r
         m_txPa->stop();\r
         m_txPa->streamClose();\r
-//        OnTogBtnOnOff->SetLabel(wxT("Start"));\r
     }\r
 }\r
 \r
@@ -496,7 +494,6 @@ void MainFrame::abortTxStream()
     {\r
         m_TxRunning = false;\r
         m_txPa->abort();\r
-//        OnTogBtnOnOff->SetLabel(wxT("Start"));\r
     }\r
 }\r
 \r
index c372752ac8f584f71c97fd1c1cd8cebcfa02ed0a..986743ccb736f9b8df2626bad9dbd02a7a54044b 100644 (file)
@@ -69,7 +69,8 @@ class MainFrame : public TopFrame
 {
     public:
         MainFrame(wxWindow *parent);
-        virtual ~MainFrame();
+        virtual ~MainFrame();\r
+
         PlotPanel*      m_panelDefaultA;\r
         PlotPanel*      m_panelDefaultB;\r
         PlotSpectrum*   m_panelSpectrum;\r
@@ -90,6 +91,7 @@ class MainFrame : public TopFrame
         PaError         m_rxErr;
         PaError         m_txErr;
         wxSound         *m_sound;
+        float           av_mag[FDMDV_NSPEC];\r
 
         void DoStartThread();\r
         void DoPauseThread();\r
index fd57b157f57b58c695b16fff106ca7d8d11180f2..a1d4e9c9794eec4c0f8746e8a5b48e6ac0594d02 100644 (file)
@@ -148,12 +148,6 @@ void PlotPanel::drawGraticule(wxAutoBufferedPaintDC&  dc)
     char buf[15];\r
     wxString s;\r
 \r
-    // Draw a filled rectangle with aborder\r
-    wxBrush ltBlueBrush = wxBrush(LIGHT_BLUE_COLOR);\r
-    dc.SetBrush(ltBlueBrush);\r
-    dc.SetPen(wxPen(BLACK_COLOR, 1));\r
-    dc.DrawRectangle(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_w, m_h);\r
-\r
     // Vertical gridlines\r
     dc.SetPen(m_penShortDash);\r
     for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < m_w; p += GRID_INCREMENT)\r
@@ -197,6 +191,13 @@ void PlotPanel::draw(wxAutoBufferedPaintDC&  dc)
     m_w = m_rectGrid.GetWidth();\r
 \r
     dc.Clear();\r
+\r
+    // Draw a filled rectangle with aborder\r
+    wxBrush ltBlueBrush = wxBrush(LIGHT_BLUE_COLOR);\r
+    dc.SetBrush(ltBlueBrush);\r
+    dc.SetPen(wxPen(BLACK_COLOR, 1));\r
+    dc.DrawRectangle(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_w, m_h);\r
+\r
     drawGraticule(dc);\r
 }\r
 \r
index 069ff805d00157f05c546be418570957336cd5fe..48200bfcf2b9be5de1af990ce80e198584bdf763 100644 (file)
@@ -69,24 +69,24 @@ class PlotPanel : public wxPanel
 {\r
     public:\r
         PlotPanel(wxFrame* parent);\r
-        void            paintEvent(wxPaintEvent & evt);\r
-        void            draw(wxAutoBufferedPaintDC& dc);\r
-        void            drawGraticule(wxAutoBufferedPaintDC& dc);\r
-        wxPen           m_penShortDash;\r
-        wxPen           m_penDotDash;\r
-        wxRect          m_rectCtrl;\r
-        wxRect          m_rectGrid;\r
-        wxRect          m_rectPlot;\r
-//        int             m_gridLeftOffset;\r
-//        int             m_gridRightOffset;\r
-//        int             m_gridTopOffset;\r
-//        int             m_gridBottomOffset;\r
-        double          m_label_size;\r
-        wxSize          m_Bufsz;\r
-        wxBitmap        *m_bmp;\r
-        wxImagePixelData *m_pBmp;\r
-        //wxNativePixelData   *m_pBmp;\r
-        //wxAlphaPixelData    *m_pBmp;\r
+        void                paintEvent(wxPaintEvent & evt);\r
+        void                draw(wxAutoBufferedPaintDC& dc);\r
+        void                drawGraticule(wxAutoBufferedPaintDC& dc);\r
+        wxPen               m_penShortDash;\r
+        wxPen               m_penDotDash;\r
+        wxRect              m_rectCtrl;\r
+        wxRect              m_rectGrid;\r
+        wxRect              m_rectPlot;\r
+//        int                 m_gridLeftOffset;\r
+//        int                 m_gridRightOffset;\r
+//        int                 m_gridTopOffset;\r
+//        int                 m_gridBottomOffset;\r
+        double              m_label_size;\r
+        wxSize              m_Bufsz;\r
+        wxBitmap            *m_bmp;\r
+        wxImagePixelData    *m_pBmp;\r
+        //wxNativePixelData     *m_pBmp;\r
+        //wxAlphaPixelData      *m_pBmp;\r
 \r
         // some useful events\r
         void    OnMouseMove(wxMouseEvent& event);\r
@@ -96,7 +96,8 @@ class PlotPanel : public wxPanel
         void    OnClose(wxCloseEvent& event ){ event.Skip(); }
         void    OnSize( wxSizeEvent& event );\r
         void    OnErase(wxEraseEvent& event);\r
-        void    OnPaint(wxPaintEvent& event);
+        void    OnPaint(wxPaintEvent& event);\r
+
         double  SetZoomFactor(double zf);\r
         double  GetZoomFactor(double zf);\r
         //void OnUpdateUI( wxUpdateUIEvent& event ){ event.Skip(); }\r
index 4751986a27f232a13b7e8e55f5c0e281d1e2f3b2..fc5de6167aa3177128bbb8f01f56145d24228979 100644 (file)
@@ -56,12 +56,6 @@ void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
     char buf[15];\r
     wxString s;\r
 \r
-    // Draw a filled rectangle with aborder\r
-    wxBrush ltBlueBrush = wxBrush(LIGHT_YELLOW_COLOR);\r
-    dc.SetBrush(ltBlueBrush);\r
-    dc.SetPen(wxPen(BLACK_COLOR, 1));\r
-    dc.DrawRectangle(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_w, m_h);\r
-\r
     // Vertical gridlines\r
     dc.SetPen(m_penShortDash);\r
     for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < m_w; p += GRID_INCREMENT)\r
@@ -82,7 +76,6 @@ void PlotSpectrum::drawGraticule(wxAutoBufferedPaintDC&  dc)
         dc.DrawText(buf, p - PLOT_BORDER + XLEFT_OFFSET, m_h + YBOTTOM_OFFSET/2);\r
     }\r
     // Label the Y-Axis\r
-    //for(p = GRID_INCREMENT; p < (h - YBOTTOM_OFFSET); p += GRID_INCREMENT)\r
     for(p = (m_h - GRID_INCREMENT); p > PLOT_BORDER; p -= GRID_INCREMENT)\r
     {\r
         sprintf(buf, "%1.0f", (double)((m_h - p) * -10));\r
@@ -119,6 +112,13 @@ void PlotSpectrum::draw(wxAutoBufferedPaintDC&  dc)
     m_w = m_rectGrid.GetWidth();\r
 \r
     dc.Clear();\r
+\r
+    // Draw a filled rectangle with aborder\r
+    wxBrush ltBlueBrush = wxBrush(LIGHT_YELLOW_COLOR);\r
+    dc.SetBrush(ltBlueBrush);\r
+    dc.SetPen(wxPen(BLACK_COLOR, 1));\r
+    dc.DrawRectangle(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_w, m_h);\r
+\r
     drawGraticule(dc);\r
 /*
     Fl_Box::draw();
index 8dde733e4d0a20b305be67e26e23ce0f232eb924..cdad731a88c172ae3463c252f4b01d593728fdfa 100644 (file)
@@ -55,12 +55,13 @@ END_EVENT_TABLE()
 PlotWaterfall::PlotWaterfall(wxFrame* parent): PlotPanel(parent)\r
 {
     int   i;
-
+\r
+    m_bmp = new wxBitmap(MAX_BMP_X, MAX_BMP_Y, wxBITMAP_SCREEN_DEPTH);
     for(i = 0; i < 255; i++)
     {
-        heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
+        m_heatmap_lut[i] = heatmap((float)i, 0.0, 255.0);
     }
-    greyscale = 0;
+    m_greyscale = 0;
     SetLabelSize(10.0);\r
     m_Bufsz = GetMaxClientSize();
 };
@@ -70,10 +71,10 @@ PlotWaterfall::PlotWaterfall(wxFrame* parent): PlotPanel(parent)
 //----------------------------------------------------------------\r
 PlotWaterfall::~PlotWaterfall()
 {
-//    if(m_bmp->IsOk())\r
-//    {\r
-//        delete m_bmp;\r
-//    }
+    if(!m_bmp->IsNull())\r
+    {\r
+        delete m_bmp;\r
+    }
 }
 \r
 /*\r
@@ -98,10 +99,10 @@ void PlotWaterfall::new_pixel_buf(int w, int h)
         m_bmp = new wxBitmap(w, h, wxBITMAP_SCREEN_DEPTH);\r
         //m_pBmp = m_bmp->GetBitmapData();\r
     }
-//    pixel_buf = new unsigned[buf_sz];
+//    m_pixel_buf = new unsigned[buf_sz];
 //    for(i = 0; i < buf_sz; i++)
 //    {
-//        pixel_buf[i] = 0;
+//        m_pixel_buf[i] = 0;
 //    }\r
 }
 
@@ -168,15 +169,6 @@ void PlotWaterfall::drawGraticule(wxAutoBufferedPaintDC&  dc)
     char buf[15];\r
     wxString s;\r
 \r
-//    int h = m_rectGrid.GetHeight();\r
-//    int w = m_rectGrid.GetWidth();\r
-\r
-    // Draw a filled rectangle with aborder\r
-    wxBrush ltBlueBrush = wxBrush(LIGHT_RED_COLOR);\r
-    dc.SetBrush(ltBlueBrush);\r
-    dc.SetPen(wxPen(BLACK_COLOR, 1));\r
-    dc.DrawRectangle(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_w, m_h);\r
-\r
     // Vertical gridlines\r
     dc.SetPen(m_penShortDash);\r
     for(p = (PLOT_BORDER + XLEFT_OFFSET + GRID_INCREMENT); p < m_w; p += GRID_INCREMENT)\r
@@ -240,6 +232,13 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC&  dc)
     m_w = m_rectGrid.GetWidth();\r
 \r
     dc.Clear();\r
+\r
+    // Draw a filled rectangle with aborder\r
+    wxBrush ltBlueBrush = wxBrush(LIGHT_RED_COLOR);\r
+    dc.SetBrush(ltBlueBrush);\r
+    dc.SetPen(wxPen(BLACK_COLOR, 1));\r
+    dc.DrawRectangle(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_w, m_h);\r
+\r
     drawGraticule(dc);\r
 \r
     /* detect resizing of window */
@@ -250,7 +249,7 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC&  dc)
         new_pixel_buf(m_w, m_h);
     }\r
 */\r
-/*\r
+\r
     // determine dy, the height of one "block"
     px_per_sec = (float)m_h / WATERFALL_SECS_Y;
     dy = DT * px_per_sec;
@@ -260,14 +259,14 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC&  dc)
     bytes_in_row_of_blocks = dy * m_w * sizeof(unsigned);
     for(b = 0; b < dy_blocks - 1; b++)
     {
-        pdest = pixel_buf + b * m_w * dy;
-        psrc  = pixel_buf + (b + 1) * m_w * dy;
+        pdest = m_pixel_buf + b * m_w * dy;
+        psrc  = m_pixel_buf + (b + 1) * m_w * dy;
         memcpy(pdest, psrc, bytes_in_row_of_blocks);
     }
     // create a new row of blocks at bottom
     spec_index_per_px = (float)FDMDV_NSPEC / (float) m_w;
     intensity_per_dB = (float)256 /(MAX_DB - MIN_DB);
-    last_row = pixel_buf + dy *(dy_blocks - 1)* m_w;
+    last_row = m_pixel_buf + dy *(dy_blocks - 1)* m_w;
     for(px = 0; px < m_w; px++)
     {
         index = px * spec_index_per_px;
@@ -280,7 +279,7 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC&  dc)
         {
             intensity = 0;
         }
-        if (greyscale)
+        if (m_greyscale)
         {
             for(py = 0; py < dy; py++)
             {
@@ -291,13 +290,13 @@ void PlotWaterfall::draw(wxAutoBufferedPaintDC&  dc)
         {
             for(py = 0; py < dy; py++)
             {
-                last_row[px + py * m_w] = heatmap_lut[intensity];
+                last_row[px + py * m_w] = m_heatmap_lut[intensity];
             }
         }
     }\r
-*/\r
+\r
     // update bit map
-    //fl_draw_image((unsigned char*)pixel_buf, m_x, m_y, m_w, m_h, 4, 0);\r
+    //fl_draw_image((unsigned char*)m_pixel_buf, m_x, m_y, m_w, m_h, 4, 0);\r
     //dc.DrawLines(4, m_pBmp, 0, 0 );
 }
 
index 43708ac383e2ddc8d1f048a571d894e3b0dbe516..c431c4d14ceabb47bbd45e28ad5af9ff071cea19 100644 (file)
 #include "fdmdv2_plot.h"\r
 #include "fdmdv2_defines.h"\r
 \r
+#define MAX_ZOOM    7\r
+#define MAX_BMP_X   (400 * MAX_ZOOM)\r
+#define MAX_BMP_Y   (400 * MAX_ZOOM)\r
+\r
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=\r
 // Class PlotWaterfall\r
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=\r
@@ -38,9 +42,9 @@ public:
     ~PlotWaterfall();\r
 
 protected:
-    unsigned    *pixel_buf;
-    unsigned    heatmap_lut[256];
-    int         greyscale;
+    unsigned    *m_pixel_buf;
+    unsigned    m_heatmap_lut[256];
+    int         m_greyscale;
 \r
     unsigned    heatmap(float val, float min, float max);
 \r
index 99dfcbc5668e14a0f82edde3b5c9a932b270e8de..f686644602d58d1f260ce0d8df5ea3df0811f444 100644 (file)
 #include "codec2.h"
 
 //-- Globals: Eliminate!! --------------------------------
-char         *fin_name = NULL;
-char         *fout_name = NULL;
-char         *sound_dev_name = NULL;
-FILE         *fin = NULL;
-FILE         *fout = NULL;
-struct FDMDV *fdmdv;
+//char         *fin_name = NULL;
+//char         *fout_name = NULL;
+//char         *sound_dev_name = NULL;
+//FILE         *fin = NULL;
+//FILE         *fout = NULL;
+struct FDMDV  *fdmdv_state;
 struct CODEC2 *codec2;
 //float         av_mag[FDMDV_NSPEC];                  // shared between a few classes
 extern float *av_mag;\r
@@ -98,7 +98,7 @@ float  Ts = 0.0;
 short  input_buf[2*FDMDV_NOM_SAMPLES_PER_FRAME];
 int    n_input_buf = 0;
 int    nin = FDMDV_NOM_SAMPLES_PER_FRAME;
-short *output_buf;
+short  *output_buf;
 int    n_output_buf = 0;
 int    codec_bits[2*FDMDV_BITS_PER_FRAME];
 int    state = 0;
@@ -115,27 +115,30 @@ typedef struct
 } paCallBackData;
 
 //----------------------------------------------------------------
-//
+// per_frame_rx_processing()
 //----------------------------------------------------------------
 void per_frame_rx_processing(
-                                short  output_buf[], /* output buf of decoded speech samples          */
-                                int   *n_output_buf, /* how many samples currently in output_buf[]    */
-                                int    codec_bits[], /* current frame of bits for decoder             */
-                                short  input_buf[],  /* input buf of modem samples input to demod     */
-                                int   *n_input_buf,  /* how many samples currently in input_buf[]     */
-                                int   *nin,          /* amount of samples demod needs for next call   */
-                                int   *state,        /* used to collect codec_bits[] halves           */
-                                struct CODEC2 *c2    /* Codec 2 states                                */
+                                short   output_buf[],  /* output buf of decoded speech samples          */
+                                int     *n_output_buf, /* how many samples currently in output_buf[]    */
+                                int     codec_bits[],  /* current frame of bits for decoder             */
+                                short   input_buf[],   /* input buf of modem samples input to demod     */
+                                int     *n_input_buf,  /* how many samples currently in input_buf[]     */
+                                int     *nin,          /* amount of samples demod needs for next call   */
+                                int     *state,        /* used to collect codec_bits[] halves           */
+                                struct  CODEC2 *c2     /* Codec 2 states                                */
                             )
 {
-    struct FDMDV_STATS stats;
-    int    sync_bit;
-    float  rx_fdm[FDMDV_MAX_SAMPLES_PER_FRAME];
-    int    rx_bits[FDMDV_BITS_PER_FRAME];
-    unsigned char  packed_bits[BYTES_PER_CODEC_FRAME];
-    float  rx_spec[FDMDV_NSPEC];
-    int    i, nin_prev, bit, byte;
-    int    next_state;
+    struct FDMDV_STATS  stats;
+    int                 sync_bit;
+    float               rx_fdm[FDMDV_MAX_SAMPLES_PER_FRAME];
+    int                 rx_bits[FDMDV_BITS_PER_FRAME];
+    unsigned char       packed_bits[BYTES_PER_CODEC_FRAME];
+    float               rx_spec[FDMDV_NSPEC];
+    int                 i;\r
+    int                 nin_prev;\r
+    int                 bit;\r
+    int                 byte;
+    int                 next_state;
 
     assert(*n_input_buf <= (2 * FDMDV_NOM_SAMPLES_PER_FRAME));
 
@@ -158,12 +161,12 @@ void per_frame_rx_processing(
     while(*n_input_buf >= *nin)
     {
         // demod per frame processing
-        for(i=0; i<*nin; i++)
+        for(i = 0; i < *nin; i++)
         {
             rx_fdm[i] = (float)input_buf[i]/FDMDV_SCALE;
         }
         nin_prev = *nin;
-        fdmdv_demod(fdmdv, rx_bits, &sync_bit, rx_fdm, nin);
+        fdmdv_demod(fdmdv_state, rx_bits, &sync_bit, rx_fdm, nin);
         *n_input_buf -= nin_prev;
         assert(*n_input_buf >= 0);
 
@@ -174,8 +177,8 @@ void per_frame_rx_processing(
         }
 
         // compute rx spectrum & get demod stats, and update GUI plot data
-        fdmdv_get_rx_spectrum(fdmdv, rx_spec, rx_fdm, nin_prev);
-        fdmdv_get_demod_stats(fdmdv, &stats);
+        fdmdv_get_rx_spectrum(fdmdv_state, rx_spec, rx_fdm, nin_prev);
+        fdmdv_get_demod_stats(fdmdv_state, &stats);
         new_data(rx_spec);
 //        aScatter->add_new_samples(stats.rx_symbols);
 //        aTimingEst->add_new_sample(stats.rx_timing);
@@ -197,14 +200,15 @@ void per_frame_rx_processing(
         {
             case 0:
                 // mute output audio when out of sync
-                if(*n_output_buf < 2*codec2_samples_per_frame(c2) - N8)
+                if(*n_output_buf < 2 * codec2_samples_per_frame(c2) - N8)
                 {
-                    for(i=0; i<N8; i++)
+                    for(i=0; i<N8; i++)\r
+                    {
                         output_buf[*n_output_buf + i] = 0;
-
+                    }
                     *n_output_buf += N8;
                 }
-                assert(*n_output_buf <= (2*codec2_samples_per_frame(c2)));
+                assert(*n_output_buf <= (2 * codec2_samples_per_frame(c2)));
                 if((stats.fest_coarse_fine == 1) && (stats.snr_est > 3.0))
                 {
                     next_state = 1;
@@ -216,7 +220,7 @@ void per_frame_rx_processing(
                 {
                     next_state = 2;
                     // first half of frame of codec bits
-                    memcpy(codec_bits, rx_bits, FDMDV_BITS_PER_FRAME*sizeof(int));
+                    memcpy(codec_bits, rx_bits, FDMDV_BITS_PER_FRAME * sizeof(int));
                 }
                 else
                 {
@@ -239,10 +243,10 @@ void per_frame_rx_processing(
                     // second half of frame of codec bits
                     memcpy(&codec_bits[FDMDV_BITS_PER_FRAME], rx_bits, FDMDV_BITS_PER_FRAME*sizeof(int));
                     // pack bits, MSB received first
-                    bit = 7;
+                    bit  = 7;
                     byte = 0;
                     memset(packed_bits, 0, BYTES_PER_CODEC_FRAME);
-                    for(i=0; i<BITS_PER_CODEC_FRAME; i++)
+                    for(i = 0; i < BITS_PER_CODEC_FRAME; i++)
                     {
                         packed_bits[byte] |= (codec_bits[i] << bit);
                         bit--;
@@ -259,7 +263,7 @@ void per_frame_rx_processing(
                         codec2_decode(c2, &output_buf[*n_output_buf], packed_bits);
                         *n_output_buf += codec2_samples_per_frame(c2);
                     }
-                    assert(*n_output_buf <= (2*codec2_samples_per_frame(c2)));
+                    assert(*n_output_buf <= (2 * codec2_samples_per_frame(c2)));
                 }
                 break;
         }
@@ -274,9 +278,9 @@ void new_data(float mag_dB[])
 {
     int i;
 
-    for(i=0; i<FDMDV_NSPEC; i++)
+    for(i = 0; i < FDMDV_NSPEC; i++)
     {
-        av_mag[i] = (1.0 - BETA)*av_mag[i] + BETA*mag_dB[i];
+        av_mag[i] = (1.0 - BETA) * av_mag[i] + BETA * mag_dB[i];
     }
 }
 
@@ -317,9 +321,9 @@ void update_gui(int nin, float *Ts)
 //  is not doing GUI work.  We use this function for providing file
 //  input to update the GUI when simulating real time operation.
 //----------------------------------------------------------------
+/*
 void idle(void*)
 {
-/*
     int ret, i;
     if(fin_name != NULL)
     {
@@ -345,18 +349,22 @@ void idle(void*)
     // simulate time delay from real world A/D input, and pause betwen
     // screen updates
     usleep(20000);
-*/
 }
-
+*/
+\r
+/*
 //----------------------------------------------------------------
 // This routine will be called by the PortAudio engine when audio
 //  is available.
 //----------------------------------------------------------------
-static int callback(const void *inputBuffer, void *outputBuffer,
-                    unsigned long framesPerBuffer,
-                    const PaStreamCallbackTimeInfo* timeInfo,
-                    PaStreamCallbackFlags statusFlags,
-                    void *userData)
+static int callback(\r
+                        const void *inputBuffer,\r
+                        void *outputBuffer,
+                        unsigned long framesPerBuffer,
+                        const PaStreamCallbackTimeInfo* timeInfo,
+                        PaStreamCallbackFlags statusFlags,
+                        void *userData\r
+                    )
 {
     paCallBackData *cbData = (paCallBackData*)userData;
     unsigned int    i;
@@ -425,7 +433,7 @@ static int callback(const void *inputBuffer, void *outputBuffer,
         in8k[i] = in8k[i+N8];
     }
     assert(outputBuffer != NULL);
-    /* write signal to both channels */
+    // write signal to both channels
     for(i = 0; i < N48; i++)
     {
         out48k_short[i] = (short)out48k[i];
@@ -436,8 +444,9 @@ static int callback(const void *inputBuffer, void *outputBuffer,
         wptr[1] = out48k_short[i];
     }
     return paContinue;
-}
-
+}\r
+*/
+/*
 //----------------------------------------------------------------
 // arg_callback()
 //----------------------------------------------------------------
@@ -475,3 +484,4 @@ int arg_callback(int argc, char **argv, int &i)
     }
     return 0;
 }
+*/\r