Skip to content

Fix output length calculation in interpolator, was producing less output than it should

Yun-Jing Huang requested to merge interpolator into master

Output length calculation is less than what it should be. It won't effect the output value, but might introduce some latency.

An example downsampling:

inrate 128, outrate 64, buffer_size 1s

half_length = 32

kernel_length = 2 * half_length * factor+1 = 129

blockstrideout = 32

blockstridein = blockstrideout * factor = 64

The first buffer has 128 samples, and we should be able to process the first 64 samples [0-63] (blockstridein), by padding 64 (half of kernel_length) zeros in front and padding the [64-127] samples at the end. But current output length calculation in gstlal shows that output length of first buffer is zero, and we have to wait for the second buffer.

As shown in the following figures, the interpolator will produce more output after bug fix.

Before bug fix: image After bug fix: image The diff of the downsampled output between the two is the same for the first three seconds.

Merge request reports