Changeset 9519
- Timestamp:
- 08/22/09 22:18:16 (4 years ago)
- Location:
- ossiedev/branches/hvolos/components/MIMODec
- Files:
-
- 3 modified
-
MIMODec.cpp (modified) (4 diffs)
-
MIMODec.h (modified) (1 diff)
-
MIMODec.prf.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/branches/hvolos/components/MIMODec/MIMODec.cpp
r9492 r9519 18 18 Mr=1; 19 19 Nt=1; 20 MIMOmethod= "STBC";20 MIMOmethod=0; 21 21 Modmethod="BPSK"; 22 22 … … 99 99 if (strcmp(props[i].id, "DCE:74a38a7c-3b3e-11de-b7e0-0000e80014f9") == 0) { 100 100 const char * prop_str; 101 //string prop_str; 101 102 props[i].value >>= prop_str; 102 MIMOmethod=prop_str; 103 //prop_str=prop_char; 104 105 if (strcmp(prop_str,"MRC")) { 106 MIMOmethod=0; 107 108 } else if (strcmp(prop_str,"STBC")) { 109 MIMOmethod=1; 110 111 } else if (strcmp(prop_str,"VBLAST")) { 112 MIMOmethod=2; 113 }; 103 114 } 104 115 … … 128 139 129 140 while (1) { 130 Mr=4; 131 Nt=2; 141 //Mr=4; 142 //Nt=2; 143 132 144 NH=Mr*Nt; 133 145 dataIn->getData(I_in, Q_in); … … 143 155 144 156 cx_mat H(Mr,Nt); 157 MIMOmethod=0; 158 std::cout<<Mr<<"X"<<Nt<<" M:"<< MIMOmethod<<" DL:"<<Data_length<<std::endl; 145 159 for (int i=0;i<Mr;i++) { 146 160 for (int j=0;j<Nt;j++) { 147 161 H(i,j)=cx_double((*I_in)[i*Mr+j],(*Q_in)[i*Mr+j])/10000.0; 148 //std::cout<<"Iin:"<<(*I_in)[i*2+j]; 162 //std::cout<<"Iin:"<<(*I_in)[i*2+j]<<" "; 163 std::cout<<"H("<<i<<","<<j<<")="<<H(i,j)<<" "; 149 164 } 150 165 } 151 //std::cout<<std::endl; 152 153 /*Alamouti 154 for i=1:2:length(RX_symbols1), 155 r1=RX_symbols1(i); 156 r2=RX_symbols1(i+1); 157 RX_symbols(i)=r1*conj(H(1,1))+conj(r2)*H(1,2); 158 RX_symbols(i+1)=r1*conj(H(1,2))-conj(r2)*H(1,1); 159 end; 160 */ 166 std::cout<<std::endl; 161 167 162 168 cx_double r1; 163 169 cx_double r2; 164 170 cx_mat rx_symbols(((Data_length-NH)/Mr),1); 165 short int j=0; 166 //std::cout<<"Decode"<<std::endl; 167 //std::cout<<"Hdec="<<H; 168 169 for (short int i=NH; i<Data_length;i+=2*Mr) { 170 rx_symbols(j,0)=0; 171 rx_symbols(j+1,0)=0; 172 173 for (short int k=0;k<Mr;k++) { 174 r1=cx_double((*I_in)[i+k],(*Q_in)[i+k]); 175 r2=cx_double((*I_in)[i+Mr+k],(*Q_in)[i+Mr+k]); 176 rx_symbols(j,0)+=r1*conj(H(k,0))+conj(r2)*H(k,1); 177 rx_symbols(j+1,0)+=r1*conj(H(k,1))-conj(r2)*H(k,0); 178 171 short int j=0; 172 173 switch (MIMOmethod) { 174 case 0: 175 j=0; 176 177 for (short int i=NH; i<Data_length;i+=Mr) { 178 rx_symbols(j,0)=0; 179 180 for (short int k=0;k<Mr;k++) { 181 r1=cx_double((*I_in)[i+k],(*Q_in)[i+k]); 182 rx_symbols(j,0)+=r1*conj(H(k,0)); 183 std::cout<<i<<","<<j<<","<<k<<std::endl; 184 } 185 186 j+=1; 179 187 } 180 188 181 j+=2; 182 } 189 break; 190 case 1: 191 //std::cout<<std::endl; 192 193 /*Alamouti 194 for i=1:2:length(RX_symbols1), 195 r1=RX_symbols1(i); 196 r2=RX_symbols1(i+1); 197 RX_symbols(i)=r1*conj(H(1,1))+conj(r2)*H(1,2); 198 RX_symbols(i+1)=r1*conj(H(1,2))-conj(r2)*H(1,1); 199 end; 200 */ 201 202 203 204 j=0; 205 //std::cout<<"Decode"<<std::endl; 206 //std::cout<<"Hdec="<<H; 207 208 for (short int i=NH; i<Data_length;i+=2*Mr) { 209 rx_symbols(j,0)=0; 210 rx_symbols(j+1,0)=0; 211 212 for (short int k=0;k<Mr;k++) { 213 r1=cx_double((*I_in)[i+k],(*Q_in)[i+k]); 214 r2=cx_double((*I_in)[i+Mr+k],(*Q_in)[i+Mr+k]); 215 rx_symbols(j,0)+=r1*conj(H(k,0))+conj(r2)*H(k,1); 216 rx_symbols(j+1,0)+=r1*conj(H(k,1))-conj(r2)*H(k,0); 217 218 } 219 220 j+=2; 221 } 222 223 break; 224 case 2: 225 break; 226 } 227 183 228 double scale=1; 184 229 for (short int i=0; i<((Data_length-NH)/Mr);i++) { -
ossiedev/branches/hvolos/components/MIMODec/MIMODec.h
r9452 r9519 68 68 /// Main signal processing method 69 69 void ProcessData(); 70 70 71 71 omni_condition *component_running; ///< for component shutdown 72 72 omni_thread *processing_thread; ///< for component writer function 73 73 74 74 CORBA::Short Mr; //number of rx antennas 75 75 CORBA::Short Nt; //number of tx antennas 76 const char * MIMOmethod; 76 short int MIMOmethod; 77 std::string MIMOmethodstr; 77 78 const char * Modmethod; 78 79 79 80 80 81 // list components provides and uses ports 81 82 standardInterfaces_i::complexShort_u *dataOut; 82 83 standardInterfaces_i::complexShort_p *dataIn; 83 84 84 85 }; 85 86 #endif -
ossiedev/branches/hvolos/components/MIMODec/MIMODec.prf.xml
r9492 r9519 6 6 <description>These are the properties to configure the device manager</description> 7 7 <simple id="DCE:4c5f385e-3b3e-11de-b7e0-0000e80014f9" mode="readonly" name="No of TX Antennas" type="short"> 8 <value> 2</value>8 <value>1</value> 9 9 <description>Specifies the number of TX antennas. 1 disables the MIMO encoding</description> 10 10 <kind kindtype="configure"/> 11 11 </simple> 12 12 <simple id="DCE:74a38a7c-3b3e-11de-b7e0-0000e80014f9" mode="readonly" name="MIMO Method" type="string"> 13 <value> STBC</value>14 <description>The MIMO method used, currently supports STBC (Alamouti) and VBLAST</description>13 <value>MRC</value> 14 <description>The MIMO method used, currently supports MRC, STBC (Alamouti) and VBLAST</description> 15 15 <kind kindtype="configure"/> 16 16 </simple>