Fix AWGN channel
This commit is contained in:
committed by
luis_pereira87
parent
abb6fadd19
commit
9b594ff3b6
@@ -354,7 +354,7 @@ int main(int argc, char **argv)
|
||||
printf("-b number of HARQ bits (1-2)\n");
|
||||
printf("-B payload to be transmitted on PUCCH\n");
|
||||
printf("-m initial cyclic shift m0\n");
|
||||
printf("-T to check nacktoack miss for format 1");
|
||||
printf("-T to check nacktoack miss for format 1\n");
|
||||
exit (-1);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1616,6 +1616,22 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag) {
|
||||
struct complexd phase, alpha, beta;
|
||||
start_meas(&desc->random_channel);
|
||||
|
||||
// For AWGN channel, the received signal (Srx) is equal to transmitted signal (Stx) plus noise (N), i.e., Srx = Stx + N,
|
||||
// therefore, the channel matrix is the identity matrix.
|
||||
if (desc->modelid == AWGN) {
|
||||
for (aarx=0; aarx<desc->nb_rx; aarx++) {
|
||||
for (aatx = 0; aatx < desc->nb_tx; aatx++) {
|
||||
desc->ch[aarx+(aatx*desc->nb_rx)][0].r = aarx%desc->nb_tx == aatx ? 1.0 : 0.0;
|
||||
desc->ch[aarx+(aatx*desc->nb_rx)][0].i = 0.0;
|
||||
acorr[aarx+(aatx*desc->nb_rx)].r = desc->ch[aarx+(aatx*desc->nb_rx)][0].r;
|
||||
acorr[aarx+(aatx*desc->nb_rx)].i = desc->ch[aarx+(aatx*desc->nb_rx)][0].i;
|
||||
}
|
||||
}
|
||||
cblas_zcopy(desc->nb_tx*desc->nb_rx, (void *) acorr, 1, (void *) desc->a[0], 1);
|
||||
stop_meas(&desc->random_channel);
|
||||
desc->first_run = 0;
|
||||
return 0;
|
||||
}
|
||||
bzero(acorr,desc->nb_tx*desc->nb_rx*sizeof(struct complexd));
|
||||
|
||||
for (i=0; i<(int)desc->nb_taps; i++) {
|
||||
|
||||
Reference in New Issue
Block a user