📄 midamble.h
字号:
#ifndef _MIDAMBLE_H__#define _MIDAMBLE_H__#include "mmx.h"#include "spc.h"#include "antenna.h"#define NUM_MIDAMBLE_DEF 4#define MAX_MIDAMBLE_PERIOD 512#define MAX_CHANNELS 16#define MAX_SPREADING_FACTOR 16#define MAX_CH_EST 4typedef struct{ // length in chips unsigned int length; // sequence period in chips unsigned int period; // sequence shift between 2 consecutive channels [chips] unsigned int shift; // max number of channels allowed by the midamble. unsigned int max_channels; // midamble generator (of length 'period' bits) unsigned int *generator; // midamble table. Contains the midamble for each user. // Is a vector of size length*max_channels bits unsigned int *midamble_table; // channel estimation fields // midamble generator in the frequency domain (length: period mmx_t units) // format: |Re0 -Im0 Im0 Re0|... mmx_t *generatorF; // twiddle for FFT mmx_t *twiddleFFT; // twiddle for IFFT mmx_t *twiddleIFFT; // reverse buffer: it is used when reordering the elements before the FFT/IFFT unsigned short *revbuf; // For the estimation-channel function int (*estimate_channel)(mmx_t *, mmx_t *, mmx_t *, mmx_t *, mmx_t *, unsigned short int *);} midamble_t;typedef struct{ // get_sequence is a pointer to the function that loads the spreading table // (given the amplitude and the index) unsigned int (*get_sequence)(void *, void * ,void *,void *, void *); // pointer to the spreading sequence !! Warning: 64 may be a limitation!! mmx_t spreading_sequence[64]; /** This vector is used to store the channel estimates given by * a certain midamble 'mid'. The vector is divided into * 'mid->max_channels' parts. Each part has length * 'mid->shift*DAQ_SAMPLES_PER_CHIP' mmx_t elements. The i-th part * contains the response of the 'max_channels-i' channel * (for i=0...max_channels-1) The format of the mmx_t element is * | Re0 Im0 Re0 Im0 | Re1 Im1 Re1 Im1 | ... */ mmx_t estimates[ DAQ_SAMPLES_PER_CHIP * MAX_MIDAMBLE_PERIOD ]; // temp buffer for the spreading sequence mmx_t temp_buffer[ DAQ_SAMPLES_PER_CHIP * ( MAX_MIDAMBLE_PERIOD + 2 * MAX_CHANNELS * (MAX_SPREADING_FACTOR-1))]; mmx_t temp_sequence[ MAX_SPREADING_FACTOR ]; /** is the pointer to the MF vector (real part). * The vector is divided into 'max_channels' parts, each one */ short matched_filter_Re[ DAQ_SAMPLES_PER_CHIP * MAX_MIDAMBLE_PERIOD ]; /** is the pointer to the MF vector (imag part). * The vector is divided into 'max_channels' parts, each one */ short matched_filter_Im[ DAQ_SAMPLES_PER_CHIP * MAX_MIDAMBLE_PERIOD ]; /** chosen length of the channel estimate, can be lengthened * or shortened according to performance/complexity requirements */ int estimation_length;} estimation_vars_t;extern midamble_t midamble_def[ NUM_MIDAMBLE_DEF ];void midamble_prepare( void );int midamble_write( int mid_type, SYMBOL_COMPLEX *out_mid, unsigned int amp, unsigned short mid_index );int midamble_add( int mid_type, SYMBOL_COMPLEX *out_mid, unsigned int amp, unsigned short mid_index );int midamble_get_nbr_channels( int mid_type );int midamble_get_length( int mid_type );int rcv_module_init(void);void rcv_module_exit( void );int send_module_init(void);void send_module_exit( void );//Mimo partint mimo_mid_module_init( void );void mimo_mid_module_exit( void );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -