Changeset 3386
- Timestamp:
- 04/10/07 17:19:10 (6 years ago)
- Location:
- experimental/components/SymbolSyncPoly
- Files:
-
- 6 modified
-
SymbolSyncPoly.cpp (modified) (4 diffs)
-
SymbolSyncPoly.h (modified) (2 diffs)
-
SymbolSyncPoly.prf.xml (modified) (1 diff)
-
SymbolSyncPolyDSP.cpp (modified) (4 diffs)
-
SymbolSyncPolyDSP.h (modified) (2 diffs)
-
documentation.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/SymbolSyncPoly/SymbolSyncPoly.cpp
r3374 r3386 38 38 //Start the thread containing the writer's processing function 39 39 processing_thread->start(); 40 41 isConfigured_pulseShape = true; 42 isConfigured_k = false; 43 isConfigured_m = false; 44 isConfigured_beta = false; 45 isConfigured_Npfb = false; 40 46 41 47 } … … 120 126 CORBA::UShort simple_temp; 121 127 props[i].value >>= simple_temp; 122 simple_1_value = simple_temp; 128 _k = simple_temp; 129 isConfigured_k = true; 123 130 } else if (strcmp(props[i].id, "DCE:99bf718e-e44e-11db-99e4-00123f63025f") == 0) { 124 131 // m : symbol delay 125 132 CORBA::UShort simple_temp; 126 133 props[i].value >>= simple_temp; 127 simple_2_value = simple_temp; 134 _m = simple_temp; 135 isConfigured_m = true; 128 136 } else if (strcmp(props[i].id, "DCE:afc47b82-e44e-11db-b1f3-00123f63025f") == 0) { 129 137 // beta : excess bandwidth factor 130 138 CORBA::Float simple_temp; 131 139 props[i].value >>= simple_temp; 132 simple_3_value = simple_temp; 140 _beta = simple_temp; 141 isConfigured_beta = true; 133 142 } else if (strcmp(props[i].id, "DCE:bea3b19a-e44e-11db-a3dd-00123f63025f") == 0) { 134 // N : number of filters in bank143 // Npfb : number of filters in bank 135 144 CORBA::UShort simple_temp; 136 145 props[i].value >>= simple_temp; 137 simple_4_value = simple_temp; 146 _Npfb = simple_temp; 147 isConfigured_Npfb = true; 138 148 } else { 139 149 // unknown property … … 142 152 } 143 153 } 154 155 /// \todo configure filter bank type 156 /// 157 /// Once all properties have been configured, create the filter bank 158 if ( isConfigured_k && 159 isConfigured_m && 160 isConfigured_beta && 161 isConfigured_Npfb ) 162 { 163 DEBUG(5, SymbolSyncPoly, "configuring filter bank for " << 164 "rrcos" << ", k=" << _k << ", m=" << _m << ", beta=" << _beta << ", Npfb=" << Npfb) 165 ConfigureFilterBank("rrcos", _k, _m, _beta, _Npfb); 166 } 144 167 } 145 168 … … 150 173 PortTypes::ShortSequence I_out_0, Q_out_0; 151 174 152 153 175 PortTypes::ShortSequence *I_in_0(NULL), *Q_in_0(NULL); 154 CORBA::UShort I_in_0_length, Q_in_0_length; 176 unsigned int I_in_0_length, Q_in_0_length, N_in(0), N_out(0); 177 short * I_in(NULL); 178 short * Q_in(NULL); 179 short * I_out(NULL); 180 short * Q_out(NULL); 155 181 156 182 while( true ) 157 183 { 184 // Get data from port 158 185 dataIn_0->getData(I_in_0, Q_in_0); 159 186 187 // Read input data length 160 188 I_in_0_length = I_in_0->length(); 161 189 Q_in_0_length = Q_in_0->length(); 162 190 163 I_out_0.length(); //must define length of output 164 Q_out_0.length(); //must define length of output 165 166 /*insert code here to do work*/ 167 168 169 170 171 191 if ( I_in_0_length != Q_in_0_length ) { 192 // Not sure how to handle multiple-length inputs 193 std::cerr << "ERROR: SymbolSyncPoly_i::ProcessData()" << std::endl 194 << " => Not sure how to handle multiple-length inputs" << std::endl; 195 throw 0; 196 } else { 197 N_in = I_in_0_length; 198 } 199 200 // Configure output data length 201 if ( I_out == NULL ) { 202 I_out = new short[2*N_in/k]; 203 Q_out = new short[2*N_in/k]; 204 N_out = 2*N_in/k; 205 } else if ( N_out < (2*N_in/k) ) { 206 delete [] I_out; 207 delete [] Q_out; 208 I_out = new short[2*N_in/k]; 209 Q_out = new short[2*N_in/k]; 210 N_out = 2*N_in/k; 211 } else { 212 // Nothing to do 213 } 214 215 // Main signal processing algorithm 216 SynchronizeAndDecimate( 217 I_in, Q_in, N_in, 218 I_out, Q_out, N_out); 219 220 I_out_0.length(N_out); 221 Q_out_0.length(N_out); 222 223 /// \todo Initialize I_out_0 and Q_out_0 from array instead 224 /// of copying values in loop 225 for (unsigned int ii=0; ii<N_out; ii++) { 226 I_out_0[ii] = I_out[ii]; 227 Q_out_0[ii] = Q_out[ii]; 228 } 172 229 173 230 dataIn_0->bufferEmptied(); -
experimental/components/SymbolSyncPoly/SymbolSyncPoly.h
r3374 r3386 74 74 /// - \ref prop_m 75 75 /// - \ref prop_beta 76 /// - \ref prop_N 76 /// - \ref prop_Npfb 77 77 void configure(const CF::Properties&) 78 78 throw (CORBA::SystemException, … … 94 94 omni_thread *processing_thread; ///< for component writer function 95 95 96 // Configuration variables 96 97 //CORBA::String simple_0_value; 97 CORBA::UShort simple_1_value;98 CORBA::UShort simple_2_value;99 CORBA::Float simple_3_value;100 CORBA::UShort simple_4_value;98 unsigned int _k; 99 unsigned int _m; 100 float _beta; 101 unsigned int _Npfb; 101 102 102 103 // list components provides and uses ports 103 104 standardInterfaces_i::complexShort_p *dataIn_0; 104 105 standardInterfaces_i::complexShort_u *dataOut_0; 106 107 // configuration flags 108 bool isConfigured_pulseShape; 109 bool isConfigured_k; 110 bool isConfigured_m; 111 bool isConfigured_beta; 112 bool isConfigured_Npfb; 105 113 106 114 }; -
experimental/components/SymbolSyncPoly/SymbolSyncPoly.prf.xml
r3326 r3386 20 20 </simple> 21 21 <simple type="float" id="DCE:afc47b82-e44e-11db-b1f3-00123f63025f" name="beta" mode="readwrite"> 22 <description>Excess bandwidth factor </description>22 <description>Excess bandwidth factor, 0<beta<1</description> 23 23 <value>0.3</value> 24 24 <kind kindtype="configure"/> 25 25 </simple> 26 <simple type="ushort" id="DCE:bea3b19a-e44e-11db-a3dd-00123f63025f" name="N " mode="readwrite">26 <simple type="ushort" id="DCE:bea3b19a-e44e-11db-a3dd-00123f63025f" name="Npfb" mode="readwrite"> 27 27 <description>Number of filters in bank</description> 28 28 <value>16</value> -
experimental/components/SymbolSyncPoly/SymbolSyncPolyDSP.cpp
r3383 r3386 56 56 k = 0; 57 57 v = 0; 58 59 isConfigured = false; 58 60 } 59 61 … … 89 91 k = _k; 90 92 Npfb = (int) _Npfb; 93 94 isConfigured = true; 91 95 } 92 96 … … 126 130 unsigned int & N_out) 127 131 { 132 if ( !isConfigured ) { 133 std::cerr << "ERROR: SymbolSyncPolyDSP::SynchronizeAndDecimate() :" << std::endl 134 << " => must call ConfigureFilterBank() before invoking this method" << std::endl; 135 throw 0; 136 } 137 128 138 unsigned int i(0); 139 unsigned int N_out_max(N_out); 129 140 N_out = 0; 130 141 … … 189 200 I_out[N_out] = mf_i; 190 201 Q_out[N_out] = mf_q; 191 N_out++; 202 203 // Throw exception if buffer is too small 204 if ( N_out == N_out_max ) { 205 std::cerr << "ERROR: SymbolSyncPolyDSP::SynchronizeAndDecimate() :" << std::endl 206 << " => output array is full " << std::endl; 207 throw 0; 208 } else { 209 N_out++; 210 } 192 211 193 212 GenerateErrorSignal(); -
experimental/components/SymbolSyncPoly/SymbolSyncPolyDSP.h
r3383 r3386 65 65 /// 66 66 /// This method performs simultaneous synchronization and decimation. It 67 /// assumes that the calling platform takes care of memory management 67 /// assumes that the calling platform takes care of memory management. 68 /// N_out initially stores the number of memory elements allocated to 69 /// I_out and Q_out, and assumes that this number is sufficiently large 70 /// to run the algorithm. The method returns N_out as the actual number 71 /// of elements stored in I_out and Q_out. This is approximately 72 /// \f$ N_{out} \approx N_{in}/k \f$ 68 73 void SynchronizeAndDecimate(short * I_in, 69 74 short * Q_in, … … 120 125 flow_control lc; ///< loop flow control state 121 126 127 bool isConfigured; ///< flag set when ConfigureFilterBank() is invoked properly 128 122 129 private: 123 130 /// Disallow copy constructor -
experimental/components/SymbolSyncPoly/documentation.txt
r3371 r3386 40 40 CORBA::Float 41 41 42 \subsection prop_N Number of Filter in Bank (DCE:bea3b19a-e44e-11db-a3dd-00123f63025f)42 \subsection prop_Npfb Number of Filter in Bank (DCE:bea3b19a-e44e-11db-a3dd-00123f63025f) 43 43 CORBA::UShort 44 44