|
35 | 35 | /* This needs square roots, may take more cpu time than it's worth */ |
36 | 36 | #define EST_EBNO |
37 | 37 |
|
38 | | -/* This is a flag to make the mod/demod allocate their memory on the stack instead of the heap */ |
39 | | -/* At large sample rates, there's not enough stack space to run the demod */ |
40 | | -#define DEMOD_ALLOC_STACK |
41 | | - |
42 | 38 | /* This is a flag for the freq. estimator to use a precomputed/rt computed hann window table |
43 | 39 | On platforms with slow cosf, this will produce a substantial speedup at the cost of a small |
44 | 40 | amount of memory |
@@ -472,14 +468,8 @@ void fsk_demod_freq_est(struct FSK *fsk, COMP fsk_in[], float *freqs, int M) { |
472 | 468 | int freqi[M]; |
473 | 469 | int st,en,f_zero; |
474 | 470 |
|
475 | | - /* Array to do complex FFT from using kiss_fft */ |
476 | | - #ifdef DEMOD_ALLOC_STACK |
477 | | - kiss_fft_cpx *fftin = (kiss_fft_cpx*)alloca(sizeof(kiss_fft_cpx)*Ndft); |
478 | | - kiss_fft_cpx *fftout = (kiss_fft_cpx*)alloca(sizeof(kiss_fft_cpx)*Ndft); |
479 | | - #else |
480 | 471 | kiss_fft_cpx *fftin = (kiss_fft_cpx*)malloc(sizeof(kiss_fft_cpx)*Ndft); |
481 | 472 | kiss_fft_cpx *fftout = (kiss_fft_cpx*)malloc(sizeof(kiss_fft_cpx)*Ndft); |
482 | | - #endif |
483 | 473 |
|
484 | 474 | st = (fsk->est_min*Ndft)/Fs + Ndft/2; if (st < 0) st = 0; |
485 | 475 | en = (fsk->est_max*Ndft)/Fs + Ndft/2; if (en > Ndft) en = Ndft; |
@@ -605,14 +595,13 @@ void fsk_demod_freq_est(struct FSK *fsk, COMP fsk_in[], float *freqs, int M) { |
605 | 595 | //fprintf(stderr, "fsk->tone_spacing: %d\n",fsk->tone_spacing); |
606 | 596 | for (int m=0; m<M; m++) |
607 | 597 | fsk->f2_est[m] = foff + m*fsk->tone_spacing; |
| 598 | + |
608 | 599 | #ifdef MODEMPROBE_ENABLE |
609 | 600 | modem_probe_samp_f("t_f2_est",fsk->f2_est,M); |
610 | 601 | #endif |
611 | 602 |
|
612 | | - #ifndef DEMOD_ALLOC_STACK |
613 | 603 | free(fftin); |
614 | 604 | free(fftout); |
615 | | - #endif |
616 | 605 | } |
617 | 606 |
|
618 | 607 | /* core demodulator function */ |
|
0 commit comments