Changeset 3767
- Timestamp:
- 05/09/07 17:14:43 (6 years ago)
- Location:
- experimental/components/CostasLoop/src
- Files:
-
- 2 modified
-
CostasLoop.cpp (modified) (4 diffs)
-
CostasLoopDSP.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
experimental/components/CostasLoop/src/CostasLoop.cpp
r3729 r3767 26 26 #include "CostasLoop.h" 27 27 28 #undef LOGGING 29 28 30 CostasLoop_i::CostasLoop_i(const char *uuid, omni_condition *condition) : 29 31 Resource_impl(uuid), component_running(condition) 30 32 { 33 UpdateLoopFilterCoefficients(0.001); 34 31 35 dataIn_0 = new standardInterfaces_i::complexShort_p("IF_in"); 32 36 dataOut_0 = new standardInterfaces_i::complexShort_u("baseband_out"); … … 128 132 129 133 PortTypes::ShortSequence *I_in_0(NULL), *Q_in_0(NULL); 130 unsigned int I_in_0_length, Q_in_0_length; 134 unsigned int I_in_0_length, Q_in_0_length, N; 135 136 #ifdef LOGGING 137 std::ofstream input_log; 138 input_log.open("cl_input_log.dat"); 139 140 std::ofstream output_log; 141 output_log.open("cl_output_log.dat"); 142 #endif 131 143 132 144 while( true ) … … 151 163 I_out_0.length( I_in_0_length ); 152 164 Q_out_0.length( Q_in_0_length ); 165 166 N = I_in_0_length; 153 167 } 154 168 155 // 169 #ifdef LOGGING 170 for ( unsigned int i=0; i<N; i++ ) 171 input_log << (*I_in_0)[i] << " " << (*Q_in_0)[i] << std::endl; 172 #endif 173 156 174 // do work here 157 // 175 for ( unsigned int i=0; i<N; i++ ) { 176 LockPhase( (*I_in_0)[i], (*Q_in_0)[i], I_out_0[i], Q_out_0[i] ); 177 } 178 179 #ifdef LOGGING 180 for ( unsigned int i=0; i<N; i++ ) 181 output_log << I_out_0[i] << " " << Q_out_0[i] << std::endl; 182 #endif 183 158 184 159 185 DEBUG(7, CostasLoop, "Emptying port buffer...") … … 164 190 165 191 } 166 } 167 168 192 193 #ifdef LOGGING 194 input_log.close(); 195 output_log.close(); 196 #endif 197 198 } 199 200 -
experimental/components/CostasLoop/src/CostasLoopDSP.cpp
r3755 r3767 57 57 BT = ( BT < BT_MIN ) ? BT_MIN : BT; 58 58 BT = ( BT > BT_MAX ) ? BT_MAX : BT; 59 float k1 = Ac;59 float k1 = 1.0f; 60 60 61 61 beta = 2*BT/(XI+1/(4*XI))/k1; 62 62 alpha = 2*XI*beta; 63 64 beta /= Ac; 65 alpha /= Ac; 63 66 } 64 67 … … 88 91 // switch (order) 89 92 pd2 = ( I_out > 0.0f ) ? Q_out : -Q_out; 90 pd2 /= Ac;91 93 } 92 94