added taplen/L also to history length

This commit is contained in:
Ahmet Inan 2012-09-17 19:04:29 +02:00
parent 72f990f3d4
commit 9ae9159578
2 changed files with 6 additions and 2 deletions

View file

@ -125,7 +125,9 @@ int main(int argc, char **argv)
short *pcm_buff = (short *)malloc(sizeof(short) * channels * factor_M);
// 0.1 second history + enough room for delay and taps
int buff_len = 0.1 * rate + factor_M + 2 * fmaxf(cnt_delay, dat_delay);
int buff_len = 0.1 * rate + factor_M
+ fmaxf(cnt_delay, dat_delay)
+ fmaxf(cnt_taps, dat_taps) / factor_L;
struct buffer *buffer = alloc_buffer(buff_len);
const float sync_porch_len = 0.003;

View file

@ -349,7 +349,9 @@ int demodulate(struct pcm *pcm, float *cnt_freq, float *dat_freq, float *drate)
pcm_buff = (short *)malloc(sizeof(short) * channels * factor_M);
// 0.1 second history + enough room for delay and taps
int buff_len = 0.1 * rate + factor_M + 2 * fmaxf(cnt_delay, dat_delay);
int buff_len = 0.1 * rate + factor_M
+ fmaxf(cnt_delay, dat_delay)
+ fmaxf(cnt_taps, dat_taps) / factor_L;
buffer = alloc_buffer(buff_len);
// start immediately below