move get_dft() and get_idft() from pss_nr.c to tools_defs.h
This commit is contained in:
@@ -33,7 +33,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
#define CEILIDIV(a,b) ((a+b-1)/b)
|
||||
@@ -322,6 +324,65 @@ adftfunc_t dft_ftab[]={
|
||||
};
|
||||
#endif
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : get_dft
|
||||
*
|
||||
* PARAMETERS : size of ofdm symbol
|
||||
*
|
||||
* RETURN : function for discrete fourier transform
|
||||
*
|
||||
* DESCRIPTION : get dft function depending of ofdm size
|
||||
*
|
||||
*********************************************************************/
|
||||
static inline
|
||||
dft_size_idx_t get_dft(int ofdm_symbol_size)
|
||||
{
|
||||
switch (ofdm_symbol_size) {
|
||||
case 128:
|
||||
return DFT_128;
|
||||
case 256:
|
||||
return DFT_256;
|
||||
case 512:
|
||||
return DFT_512;
|
||||
case 1024:
|
||||
return DFT_1024;
|
||||
case 1536:
|
||||
return DFT_1536;
|
||||
case 2048:
|
||||
return DFT_2048;
|
||||
case 3072:
|
||||
return DFT_3072;
|
||||
case 4096:
|
||||
return DFT_4096;
|
||||
case 6144:
|
||||
return DFT_6144;
|
||||
case 8192:
|
||||
return DFT_8192;
|
||||
case 9216:
|
||||
return DFT_9216;
|
||||
case 12288:
|
||||
return DFT_12288;
|
||||
case 18432:
|
||||
return DFT_18432;
|
||||
case 24576:
|
||||
return DFT_24576;
|
||||
case 36864:
|
||||
return DFT_36864;
|
||||
case 49152:
|
||||
return DFT_49152;
|
||||
case 73728:
|
||||
return DFT_73728;
|
||||
case 98304:
|
||||
return DFT_98304;
|
||||
default:
|
||||
printf("function get_dft : unsupported ofdm symbol size \n");
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function;
|
||||
}
|
||||
|
||||
typedef enum idft_size_idx {
|
||||
IDFT_128, IDFT_256, IDFT_512, IDFT_1024, IDFT_1536, IDFT_2048, IDFT_3072, IDFT_4096,
|
||||
IDFT_6144, IDFT_8192, IDFT_9216, IDFT_12288, IDFT_18432, IDFT_24576, IDFT_36864, IDFT_49152,
|
||||
@@ -336,6 +397,64 @@ aidftfunc_t idft_ftab[]={
|
||||
};
|
||||
#endif
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* NAME : get_idft
|
||||
*
|
||||
* PARAMETERS : size of ofdm symbol
|
||||
*
|
||||
* RETURN : index pointing to the dft func in the dft library
|
||||
*
|
||||
* DESCRIPTION : get idft function depending of ofdm size
|
||||
*
|
||||
*********************************************************************/
|
||||
static inline
|
||||
idft_size_idx_t get_idft(int ofdm_symbol_size)
|
||||
{
|
||||
switch (ofdm_symbol_size) {
|
||||
case 128:
|
||||
return IDFT_128;
|
||||
case 256:
|
||||
return IDFT_256;
|
||||
case 512:
|
||||
return IDFT_512;
|
||||
case 1024:
|
||||
return IDFT_1024;
|
||||
case 1536:
|
||||
return IDFT_1536;
|
||||
case 2048:
|
||||
return IDFT_2048;
|
||||
case 3072:
|
||||
return IDFT_3072;
|
||||
case 4096:
|
||||
return IDFT_4096;
|
||||
case 6144:
|
||||
return IDFT_6144;
|
||||
case 8192:
|
||||
return IDFT_8192;
|
||||
case 9216:
|
||||
return IDFT_9216;
|
||||
case 12288:
|
||||
return IDFT_12288;
|
||||
case 18432:
|
||||
return IDFT_18432;
|
||||
case 24576:
|
||||
return IDFT_24576;
|
||||
case 36864:
|
||||
return IDFT_36864;
|
||||
case 49152:
|
||||
return IDFT_49152;
|
||||
case 73728:
|
||||
return IDFT_73728;
|
||||
case 98304:
|
||||
return IDFT_98304;
|
||||
default:
|
||||
printf("function get_idft : unsupported ofdm symbol size \n");
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return IDFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function
|
||||
}
|
||||
|
||||
|
||||
/*!\fn int32_t rotate_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N,uint16_t output_shift)
|
||||
|
||||
Reference in New Issue
Block a user