#include #include #include #include "complex.h" //#define M_PI 3.141592653 void gen_sig(float *sig, int size); void g_sig(struct complex *data, struct complex32 *data32, struct complex16 *data16,int size, const double foff, const double FS); int main(){ const int size = 307200; const double FS = 30.72e6; const double foff = 200; // 200 Hz printf("%d\n", size); float sig[size]; struct complex *data; struct complex32 *data32; struct complex16 *data16; //data = malloc(sizeof(struct complex)); // data32 = malloc(sizeof(struct complex32)); //data16 = malloc(sizeof(struct complex16)); printf("FS: %f\n" ,FS); if ((data=malloc(sizeof(struct complex)*(size_t)size))==NULL) { fprintf(stderr, "Out of memory!\n"); exit(1); } if ((data16=malloc(sizeof(struct complex16)*(size_t)size))==NULL) { fprintf(stderr, "Out of memory!\n"); exit(1); } if ((data32=malloc(sizeof(struct complex32)*(size_t)size))==NULL) { fprintf(stderr, "Out of memory!\n"); exit(1); } g_sig(data,data32, data16, size, foff,FS); return 0; } void g_sig(struct complex *data, struct complex32 *data32, struct complex16 *data16,int size, const double foff, const double FS){ int write = 0; // Generating a table got 100 MHz channel int cp0 = 160; // First cyclic prefix int cp = 144; // Normal cyclic prefix int cpe = 512; // Extended cyclic prefix int deltaF = 200; //Hz int ofdm_size = 2048; int j; /*for (j=0; j