#include #include #include #include "complex.h" #define FS 32.78 *pow(10,6) void gen_sig(float *sig, int size); void g_sig(struct complex *data, struct complex32 *data32, struct complex16 *data16,int size); int main(){ const int size = 307200; 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); return 0; } void g_sig(struct complex *data, struct complex32 *data32, struct complex16 *data16,int size){ int write = 0; int j; // 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; for (j=0;j