Changeset 4005

Show
Ignore:
Timestamp:
05/29/07 16:01:20 (6 years ago)
Author:
jgaeddert
Message:

Functionalizing component wrapper for Demodulator component

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/Demodulator/src/Demodulator.cpp

    r3994 r4005  
    152152    unsigned int N_in(0), N_out(0); 
    153153 
     154    unsigned int i; 
     155    char * b(NULL); 
     156    short * I(NULL), * Q(NULL); 
     157 
    154158    while( true ) { 
    155159        // Get data from port 
     
    161165 
    162166        // Configure output data length 
     167        bits_out.length(N_out); 
     168 
     169        // Copy data 
     170        ///\todo Copying data is incredibly inefficient; need to initialize 
     171        /// CORBA array on buffer and vise versa 
     172        b = new char[N_out]; 
     173        I = new short[N_in]; 
     174        Q = new short[N_in]; 
     175 
     176        for (i=0; i<N_in; i++) { 
     177            I[i] = (*I_in)[i]; 
     178            Q[i] = (*Q_in)[i]; 
     179        } 
    163180 
    164181        // Signal processing goes here 
     182        DemodulateSequence(I, Q, N_in, b); 
     183 
     184        for (i=0; i<N_out; i++) { 
     185            bits_out[i] = b[i]; 
     186        } 
    165187 
    166188        dataIn_0->bufferEmptied(); 
     
    168190    } 
    169191 
     192    delete [] b; 
     193    delete [] I; 
     194    delete [] Q; 
     195 
    170196} 
    171197