Open gavv opened 1 year ago
Hello I'd like to try to solve this issue
@Nystana Thanks!
I'm wortking on this issue and I'd like to ask whether there is a way how can I easily test this, my setup is no Hardware apart from headphones with mic on maybe I can find speakers, and also these new options are part of which option group and what is their type expected to be? @gavv Thank you!
Also how should we go about controbuting I was able to clone this project without forking it, what is the proper way to contribute?
Could you please explain the behvaior of the steps and impulse generator I'm having difficulties find where to se the flags for the frame
Overview
Implement two new options, --min-latency and --max-latency, that define allowed range for latency measurements.
When min and max are provided, signal-estimator should perform measurement only in time window
[T + min; T + max]
, whereT
is time of the output impulse.We should also allow providing only min or only max, for convenience.
These options may be very useful when there are duplicate loopback paths and you need to filter out unwanted ones. For example, when input microphone hears impulse twice, first time when we play it, and second time when it is looped back from measured loopback.
Implementation
This can be implemented quite easily using decorator pattern. We can add a new implementation of IEstimator that wraps another (underlying) IEstimator instance and works as follows:
T
); then it just passes the frame to add_output() of underlying IEstimator[T + min; T + max]
; if so, it just passes the frame to add_input() of underlying IEstimator; otherwise, it passes zero frame to underlying IEstimatorIn other words, the new IEstimator wraps another IEstimator, it passes output frames to it as is, and it zeroizes input frame outside of the allowed range.
With this decorator approach, the logic of min/max latency will work with any IEstimator implementation (i.e. both StepsLatencyEstimator and CorrelationLatencyEstimator).
To make it work, we'll also need to add a flag to Frame indicating whether it contains impulse. We can add has_impulse() and set_has_impulse() methods to Frame, and then we can modify StepsGenerator and ImpulseGenerator to set the flag for frames that have output impulse.