fixed file name, updated the IF4 frame structure, added dummy functions for frame generation
This commit is contained in:
@@ -0,0 +1,114 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
OpenAirInterface
|
||||||
|
Copyright(c) 1999 - 2014 Eurecom
|
||||||
|
|
||||||
|
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
|
||||||
|
OpenAirInterface is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenAirInterface.The full GNU General Public License is
|
||||||
|
included in this distribution in the file called "COPYING". If not,
|
||||||
|
see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Contact Information
|
||||||
|
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||||
|
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||||
|
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
|
||||||
|
|
||||||
|
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||||
|
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
/*! \file PHY/LTE_TRANSPORT/if4_tools.c
|
||||||
|
* \brief
|
||||||
|
* \author Mauricio Gunther, Raymond Knopp, S. Sandeep Kumar
|
||||||
|
* \date 2016
|
||||||
|
* \version 0.1
|
||||||
|
* \company Eurecom
|
||||||
|
* \email: knopp@eurecom.fr, ee13b1025@iith.ac.in
|
||||||
|
* \note
|
||||||
|
* \warning
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
typedef struct data_block_type {
|
||||||
|
|
||||||
|
} data_block;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
void allocate_data_block(long *data_block ,int length){
|
||||||
|
data_block = malloc(length*sizeof(long));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
void send_IF4(PHY_VARS_eNB *eNB, int subframe){
|
||||||
|
eNB_proc_t *proc = &eNB->proc;
|
||||||
|
//int frame=proc->frame_tx;
|
||||||
|
//int subframe=proc->subframe_tx;
|
||||||
|
|
||||||
|
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||||
|
int i,j;
|
||||||
|
|
||||||
|
float *data_block = malloc(length*sizeof(long));
|
||||||
|
|
||||||
|
|
||||||
|
// find number of consecutive non zero in values in symbol
|
||||||
|
// NrOfNonZeroValues
|
||||||
|
|
||||||
|
// how many values does the atan function output?
|
||||||
|
|
||||||
|
for(i = 0; i <= fp->symbols_per_tti; i++){
|
||||||
|
for(j = 0; j < NrOfNonZeroValues; j=j+2){
|
||||||
|
|
||||||
|
symbol = eNB->common_vars.txdataF[0][0 /*antenna number*/][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)]
|
||||||
|
|
||||||
|
data_block[j] = Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j -1])<<16 + Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j]);
|
||||||
|
data_block[j+NrOfNonZeroValues] = Atan(subframe[i][j+1])<<16 + Atan(subframe[i][j+2]);
|
||||||
|
// use memset?
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
memset(&eNB->common_vars.txdataF[0][aa][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)],
|
||||||
|
0,fp->ofdm_symbol_size*(fp->symbols_per_tti)*sizeof(int32_t));
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void recv_IF4( ) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
IF4_dl_packet gen_IF4_dl_packet( ) {
|
||||||
|
|
||||||
|
IF4_dl_packet dl_packet;
|
||||||
|
|
||||||
|
return dl_packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
IF4_ul_packet gen_IF4_ul_packet( ) {
|
||||||
|
|
||||||
|
IF4_ul_packet ul_packet;
|
||||||
|
|
||||||
|
return ul_packet;
|
||||||
|
}
|
||||||
|
|
||||||
|
IF4_prach_packet gen_IF4_prach_packet( ) {
|
||||||
|
|
||||||
|
IF4_prach_packet prach_packet;
|
||||||
|
|
||||||
|
return prach_packet;
|
||||||
|
}
|
||||||
@@ -56,7 +56,15 @@ struct IF4_frame_status {
|
|||||||
uint32_t rsvd:2;
|
uint32_t rsvd:2;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// IF4 PRACH Configuration (32 bits)
|
/// IF4 Antenna Gain
|
||||||
|
struct IF4_gain {
|
||||||
|
/// Reserved
|
||||||
|
uint32_t rsvd:10;
|
||||||
|
/// FFT Exponent Output
|
||||||
|
uint32_t exponent:6;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// IF4 LTE PRACH Configuration (32 bits)
|
||||||
struct IF4_lte_prach_conf {
|
struct IF4_lte_prach_conf {
|
||||||
/// Reserved
|
/// Reserved
|
||||||
uint32_t rsvd:3;
|
uint32_t rsvd:3;
|
||||||
@@ -69,14 +77,6 @@ struct IF4_lte_prach_conf {
|
|||||||
/// FFT Exponent Output
|
/// FFT Exponent Output
|
||||||
uint32_t exponent:6;
|
uint32_t exponent:6;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// IF4 Antenna Gain
|
|
||||||
struct IF4_gain {
|
|
||||||
/// Reserved
|
|
||||||
uint32_t rsvd:10;
|
|
||||||
/// FFT Exponent Output
|
|
||||||
uint32_t exponent:6;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct IF4_dl_packet {
|
struct IF4_dl_packet {
|
||||||
/// Destination Address
|
/// Destination Address
|
||||||
@@ -84,17 +84,17 @@ struct IF4_dl_packet {
|
|||||||
/// Source Address
|
/// Source Address
|
||||||
|
|
||||||
/// Type
|
/// Type
|
||||||
|
uint16_t type;
|
||||||
/// Sub-Type
|
/// Sub-Type
|
||||||
|
uint16_t sub_type;
|
||||||
/// Reserved
|
/// Reserved
|
||||||
|
uint32_t rsvd;
|
||||||
/// Frame Status
|
/// Frame Status
|
||||||
|
IF4_frame_status frame_status;
|
||||||
/// Data Blocks
|
/// Data Blocks
|
||||||
|
|
||||||
/// Frame Check Sequence
|
/// Frame Check Sequence
|
||||||
|
uint32_t fcs;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IF4_ul_packet {
|
struct IF4_ul_packet {
|
||||||
@@ -103,22 +103,29 @@ struct IF4_ul_packet {
|
|||||||
/// Source Address
|
/// Source Address
|
||||||
|
|
||||||
/// Type
|
/// Type
|
||||||
|
uint16_t type;
|
||||||
/// Sub-Type
|
/// Sub-Type
|
||||||
|
uint16_t sub_type;
|
||||||
/// Reserved
|
/// Reserved
|
||||||
|
uint32_t rsvd;
|
||||||
/// Frame Status
|
/// Frame Status
|
||||||
|
IF4_frame_status frame_status;
|
||||||
/// Gain 0
|
/// Gain 0
|
||||||
|
IF4_gain gain0;
|
||||||
/// Gain 1
|
/// Gain 1
|
||||||
|
IF4_gain gain1;
|
||||||
/// Gain 2
|
/// Gain 2
|
||||||
|
IF4_gain gain2;
|
||||||
/// Gain 3
|
/// Gain 3
|
||||||
|
IF4_gain gain3;
|
||||||
/// Gain 4
|
/// Gain 4
|
||||||
|
IF4_gain gain4;
|
||||||
/// Gain 5
|
/// Gain 5
|
||||||
|
IF4_gain gain5;
|
||||||
/// Gain 6
|
/// Gain 6
|
||||||
|
IF4_gain gain6;
|
||||||
/// Gain 7
|
/// Gain 7
|
||||||
|
IF4_gain gain7;
|
||||||
/// Data Blocks
|
/// Data Blocks
|
||||||
|
|
||||||
/// Frame Check Sequence
|
/// Frame Check Sequence
|
||||||
@@ -126,10 +133,30 @@ struct IF4_ul_packet {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct IF4_prach_packet {
|
struct IF4_prach_packet {
|
||||||
|
/// Destination Address
|
||||||
|
|
||||||
|
/// Source Address
|
||||||
|
|
||||||
|
/// Type
|
||||||
|
uint16_t type;
|
||||||
|
/// Sub-Type
|
||||||
|
uint16_t sub_type;
|
||||||
|
/// Reserved
|
||||||
|
uint32_t rsvd;
|
||||||
|
/// LTE Prach Configuration
|
||||||
|
IF4_lte_prach_conf prach_conf;
|
||||||
|
/// Prach Data Block (one antenna)
|
||||||
|
|
||||||
|
/// Frame Check Sequence
|
||||||
|
uint32_t fcs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IF4_dl_packet gen_IF4_dl_packet();
|
||||||
|
|
||||||
|
IF4_ul_packet gen_IF4_ul_packet();
|
||||||
|
|
||||||
|
IF4_prach_packet gen_IF4_prach_packet();
|
||||||
|
|
||||||
void send_IF4(PHY_VARS_eNB *eNB, int subframe);
|
void send_IF4(PHY_VARS_eNB *eNB, int subframe);
|
||||||
|
|
||||||
void recv_IF4(PHY_VARS_eNB *eNB, int subframe);
|
void recv_IF4(PHY_VARS_eNB *eNB, int subframe);
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
typedef struct data_block_type {
|
|
||||||
|
|
||||||
} data_block;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
void allocate_data_block(long *data_block ,int length){
|
|
||||||
data_block = malloc(length*sizeof(long));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void send_IF4(PHY_VARS_eNB eNB, int subframe){
|
|
||||||
eNB_proc_t *proc = &eNB->proc;
|
|
||||||
//int frame=proc->frame_tx;
|
|
||||||
//int subframe=proc->subframe_tx;
|
|
||||||
|
|
||||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
|
||||||
int i,j;
|
|
||||||
|
|
||||||
float *data_block = malloc(length*sizeof(long));
|
|
||||||
|
|
||||||
|
|
||||||
// find number of consecutive non zero in values in symbol
|
|
||||||
// NrOfNonZeroValues
|
|
||||||
|
|
||||||
// how many values does the atan function output?
|
|
||||||
|
|
||||||
for(i = 0; i <= fp->symbols_per_tti; i++){
|
|
||||||
for(j = 0; j < NrOfNonZeroValues; j=j+2){
|
|
||||||
|
|
||||||
symbol = eNB->common_vars.txdataF[0][0 /*antenna number*/][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)]
|
|
||||||
|
|
||||||
data_block[j] = Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j -1])<<16 + Atan(symbol[fp->ofmd_symbol_size - NrOfNonZeroValues + j]);
|
|
||||||
data_block[j+NrOfNonZeroValues] = Atan(subframe[i][j+1])<<16 + Atan(subframe[i][j+2]);
|
|
||||||
// use memset?
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
memset(&eNB->common_vars.txdataF[0][aa][subframe*fp->ofdm_symbol_size*(fp->symbols_per_tti)],
|
|
||||||
0,fp->ofdm_symbol_size*(fp->symbols_per_tti)*sizeof(int32_t));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user