Adapter slice buffers and gap handling in base class
- Audioadapter
- Add buffer slicing in Audioadapter, mostly borrowed from buffer slicing in
_TSTransSink
- Previously when we request a offset segment of data, the Audioadapter will first concatenate all the data in the Audioadapter, then use array slicing to select the targeted slice of data. Now the Audioadapter will first slice the buffers to the requested slice, then do concatenation. This lowered sys usage from 7-9% to 4-5%
- Add methods to get gap information in requested offset segment
- Will be used in
_TSTransSink
- Will be used in
- add typing and fix mypy errors
- Add buffer slicing in Audioadapter, mostly borrowed from buffer slicing in
-
_TSTransSink
- Add
skip_gaps
option inAdapterConfig
- if
skip_gaps=True
, the audioadapter will return a gap buffer if there are any gaps in the requested segment. - if
skip_gaps=False
(default), the audioadapter will fill gaps with zeros if there are a combination of gaps and nongaps in the requested segment.
- if
- use
Audioadapter()
instead ofdeque()
forself.inbufs
, and use theget_sliced_buffers()
method in the audioadapter to slice buffers when buffers are aligned.- The goal was to use just one audioadapter/deque in the
_TSTransSink
base class, currently there are two, one for aligning buffers, and one for handling overlap requests. But I haven't reconciled the two, thought I could do it in a separate MR? I was thinking about reconciling the two so we can also handle the fixed global buffer stride.
- The goal was to use just one audioadapter/deque in the
- Add
related to the gated-whitening MR: sgn-ligo!17 (merged)
Edited by Yun-Jing Huang