Changeset 3374

Show
Ignore:
Timestamp:
04/09/07 12:29:24 (6 years ago)
Author:
jgaeddert
Message:

adding more functionality

Location:
experimental/components/SymbolSyncPoly
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/SymbolSyncPoly/SymbolSyncPoly.cpp

    r3330 r3374  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2007 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE SymbolSyncPoly. 
  • experimental/components/SymbolSyncPoly/SymbolSyncPoly.h

    r3330 r3374  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2007 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE SymbolSyncPoly. 
  • experimental/components/SymbolSyncPoly/SymbolSyncPolyDSP.cpp

    r3371 r3374  
    4949    b = 0; 
    5050    b_soft = 0.0f; 
    51     Npfb = 16; 
     51    Npfb = 0; 
     52    k = 0; 
     53    v = 0; 
    5254} 
    5355 
     
    7779    } else { 
    7880        std::cerr << "ERROR: SymbolSyncPolyDSP::CreateFilterBank() :" << std::endl 
    79                   << "  => unknown filter type " << type << std::endl; 
     81                  << "  => unknown/unsupported filter type " << type << std::endl; 
    8082        throw 0; 
    8183    } 
    8284 
     85    k = _k; 
    8386    Npfb = (int) _Npfb; 
    8487} 
     
    107110} 
    108111 
     112// Main signal processing loop 
     113void SymbolSyncPolyDSP::SynchronizeAndDecimate(short * I_in, 
     114        short * Q_in, 
     115        unsigned int N_in, 
     116        short *& I_out, 
     117        short *& Q_out, 
     118        unsigned int & N_out) 
     119{ 
     120    unsigned int i(0); 
     121    while ( i<N_in ) { 
     122        v++; 
     123 
     124        switch ( lc ) { 
     125            case SHIFT: 
     126                // Shift sample into state registers, normal operation 
     127                MF_i->PushInput( I_in[i] ); 
     128                dMF_i->PushInput( I_in[i] ); 
     129                MF_q->PushInput( Q_in[i] ); 
     130                dMF_q->PushInput( Q_in[i] ); 
     131                i++; 
     132                break; 
     133            case SKIP: 
     134                // 'Skip' input sample by incrementing index by two 
     135 
     136                if ( i < (N_in-1) ) { 
     137                    for (unsigned int k=0; k<2; k++) { 
     138                        MF_i->PushInput( I_in[i] ); 
     139                        dMF_i->PushInput( I_in[i] ); 
     140                        MF_q->PushInput( Q_in[i] ); 
     141                        dMF_q->PushInput( Q_in[i] ); 
     142                        i++; 
     143                    } 
     144                } else { 
     145                    // not enough samples in input buffer: save state and 
     146                    // wait for more 
     147                    /// \todo configure 
     148                    return; 
     149                } 
     150 
     151                // return loop control to normal 'shift' state 
     152                lc = SHIFT; 
     153                break; 
     154            case STUFF: 
     155                // 'Stuff' (repeat) input sample by not incrementing index 
     156                // This effectively does not update filter states 
     157 
     158                // return loop control to normal 'shift' state 
     159                lc = SHIFT; 
     160                break; 
     161            default:; 
     162        } 
     163 
     164        if ( v>=k ) { 
     165            // Enable output 
     166             
     167            // Filter in-phase signal with MF and dMF with filter bank b 
     168            MF_i->ComputeOutput(mf_i, b); 
     169            dMF_i->ComputeOutput(dmf_i, b); 
     170             
     171            // Filter quadrature signal with MF and dMF with filter bank b 
     172            MF_q->ComputeOutput(mf_q, b); 
     173            dMF_q->ComputeOutput(dmf_q, b); 
     174             
     175            // Store result in output buffer 
     176            // I_out[x] = mf_i; 
     177            // Q_out[x] = mf_q; 
     178             
     179            GenerateErrorSignal(); 
     180             
     181            AdvanceLoopFilter(); 
     182             
     183            ComputeFilterBankIndex(); 
     184        } 
     185 
     186    } // while 
     187} 
    109188 
    110189 
     190 
  • experimental/components/SymbolSyncPoly/SymbolSyncPolyDSP.h

    r3371 r3374  
    6161    void SynchronizeAndDecimate(short * I_in, 
    6262            short * Q_in, 
    63             int N_in, 
     63            unsigned int N_in, 
    6464            short *& I_out, 
    6565            short *& Q_out, 
    66             int & N_out); 
     66            unsigned int & N_out); 
    6767 
    6868  protected: 
     
    106106    int Npfb;           ///< number of filters in bank 
    107107 
     108    unsigned int k;     ///< samples per symbol 
     109    unsigned int v;     ///< sample counter 
     110 
    108111    flow_control lc;    ///< loop flow control state 
    109112 
  • experimental/components/SymbolSyncPoly/autotest_sources

    • Property svn:ignore set to
      *.swp
      *.bak
  • experimental/components/SymbolSyncPoly/main.cpp

    r3326 r3374  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2007 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE SymbolSyncPoly.