Persist complex contour channel replay
This commit is contained in:
parent
cbdd176610
commit
cdaef8b0ad
7 changed files with 753 additions and 31 deletions
|
|
@ -190,6 +190,12 @@ if (args.Any(arg => string.Equals(arg, "--complex-contour-asio-f32", StringCompa
|
|||
ParseStringOption(args, "--song", MimirBioacousticContestants.CanaryPacketTrill.Id));
|
||||
}
|
||||
|
||||
if (args.Any(arg => string.Equals(arg, "--complex-contour-replay-panel", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return RunComplexContourReplayPanel(
|
||||
ParseStringOption(args, "--output", "calibration/bioacoustic/complex-contour-replay-panel.json"));
|
||||
}
|
||||
|
||||
if (args.Any(arg => string.Equals(arg, "--calibrate-contestant-asio-f32", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return CalibrateContestantAsioFloat32(
|
||||
|
|
@ -1727,11 +1733,49 @@ static int AnalyzeComplexContourAsioFloat32(
|
|||
double scheduleOffsetSamples,
|
||||
double predictedDelaySamples,
|
||||
string songId)
|
||||
{
|
||||
var result = EstimateComplexContourAsioFloat32(
|
||||
inputPath,
|
||||
sampleRate,
|
||||
channels,
|
||||
referenceChannel,
|
||||
candidateChannel,
|
||||
seconds,
|
||||
scheduleOffsetSamples,
|
||||
predictedDelaySamples,
|
||||
songId);
|
||||
if (result == null)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
var bands = string.Join(",", result.StrongestBands.Select(group =>
|
||||
$"{group.CenterHz:0}Hz:{group.DelayResidualSamples:+0.00;-0.00;0.00}samp/{group.PhaseResidualRadians:+0.00;-0.00;0.00}rad"));
|
||||
Console.WriteLine(
|
||||
$"complex-contour-asio-f32 input={result.InputPath} reference=asio-ch{result.ReferenceChannel} candidate=asio-ch{result.CandidateChannel} " +
|
||||
$"delaySamples={result.DelaySamples:0.000000} delayUs={result.DelayMicroseconds:0.000} " +
|
||||
$"predictedDelaySamples={result.PredictedDelaySamples:0.000000} predictionErrorSamples={result.PredictionErrorSamples:0.000000} predictionErrorUs={result.PredictionErrorMicroseconds:0.000} " +
|
||||
$"confidence={result.Confidence:0.000} directHits={result.DirectHits} maeSamples={result.MeanAbsoluteErrorSamples:0.000000} phaseMaeRad={result.MeanAbsolutePhaseErrorRadians:0.000} " +
|
||||
$"referenceHits={result.ReferenceHits} candidateHits={result.CandidateHits} reflectionTaps={result.ReflectionTaps.Length} " +
|
||||
$"firstReflectionSamples={result.FirstReflectionSamples:0.000} bands={bands}");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ComplexContourReplayResult? EstimateComplexContourAsioFloat32(
|
||||
string inputPath,
|
||||
int sampleRate,
|
||||
int channels,
|
||||
int referenceChannel,
|
||||
int candidateChannel,
|
||||
double seconds,
|
||||
double scheduleOffsetSamples,
|
||||
double predictedDelaySamples,
|
||||
string songId)
|
||||
{
|
||||
if (!File.Exists(inputPath))
|
||||
{
|
||||
Console.Error.WriteLine($"complex-contour ASIO analysis failed: input not found: {inputPath}");
|
||||
return 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
var profile = MimirBioacousticContestants.BuiltIn.FirstOrDefault(profile =>
|
||||
|
|
@ -1739,14 +1783,14 @@ static int AnalyzeComplexContourAsioFloat32(
|
|||
if (profile == null)
|
||||
{
|
||||
Console.Error.WriteLine($"complex-contour ASIO analysis failed: unknown song '{songId}'");
|
||||
return 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
if (referenceChannel < 0 || referenceChannel >= channels ||
|
||||
candidateChannel < 0 || candidateChannel >= channels)
|
||||
{
|
||||
Console.Error.WriteLine("complex-contour ASIO analysis failed: channel index outside capture channel count");
|
||||
return 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
var channelSamples = ReadInterleavedFloat32(inputPath, channels, out var frameCount);
|
||||
|
|
@ -1766,26 +1810,122 @@ static int AnalyzeComplexContourAsioFloat32(
|
|||
eventIndices,
|
||||
scheduleOffsetSamples + predictedDelaySamples,
|
||||
Math.Max(48, sampleRate / 900));
|
||||
var tracker = new MimirDirectPathTracker(sampleRate);
|
||||
var estimate = tracker.Update(referenceHits, candidateHits, predictedDelaySamples);
|
||||
var estimate = new MimirDirectPathTracker(sampleRate).Update(referenceHits, candidateHits, predictedDelaySamples);
|
||||
if (estimate == null)
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"complex-contour-asio-f32 status=no-lock input={inputPath} reference=asio-ch{referenceChannel} candidate=asio-ch{candidateChannel} " +
|
||||
$"referenceHits={referenceHits.Count} candidateHits={candidateHits.Count} predictedDelaySamples={predictedDelaySamples:0.000}");
|
||||
return 1;
|
||||
return null;
|
||||
}
|
||||
|
||||
var strongestBands = estimate.BandObservations
|
||||
.GroupBy(observation => Math.Round(observation.CenterHz / 250.0) * 250.0)
|
||||
.Select(group =>
|
||||
{
|
||||
var totalWeight = Math.Max(1.0e-9, group.Sum(observation => Math.Max(observation.Weight, 1.0e-9)));
|
||||
return new ComplexContourBandResidual(
|
||||
group.Key,
|
||||
totalWeight,
|
||||
group.Sum(observation => observation.DelayResidualSamples * Math.Max(observation.Weight, 1.0e-9)) / totalWeight,
|
||||
group.Sum(observation => observation.PhaseResidualRadians * Math.Max(observation.Weight, 1.0e-9)) / totalWeight);
|
||||
})
|
||||
.OrderByDescending(group => group.Weight)
|
||||
.Take(8)
|
||||
.ToArray();
|
||||
var predictionError = estimate.DelaySamples - predictedDelaySamples;
|
||||
var firstReflection = estimate.ReflectionTaps.FirstOrDefault();
|
||||
Console.WriteLine(
|
||||
$"complex-contour-asio-f32 input={inputPath} reference=asio-ch{referenceChannel} candidate=asio-ch{candidateChannel} " +
|
||||
$"delaySamples={estimate.DelaySamples:0.000000} delayUs={estimate.DelayMicroseconds:0.000} " +
|
||||
$"predictedDelaySamples={predictedDelaySamples:0.000000} predictionErrorSamples={predictionError:0.000000} predictionErrorUs={predictionError * 1_000_000.0 / sampleRate:0.000} " +
|
||||
$"confidence={estimate.Confidence:0.000} directHits={estimate.DirectHitCount} maeSamples={estimate.MeanAbsoluteErrorSamples:0.000000} " +
|
||||
$"referenceHits={referenceHits.Count} candidateHits={candidateHits.Count} reflectionTaps={estimate.ReflectionTaps.Count} " +
|
||||
$"firstReflectionSamples={(firstReflection?.RelativeDelaySamples ?? double.NaN):0.000}");
|
||||
return 0;
|
||||
return new ComplexContourReplayResult(
|
||||
"",
|
||||
inputPath,
|
||||
sampleRate,
|
||||
referenceChannel,
|
||||
candidateChannel,
|
||||
predictedDelaySamples,
|
||||
estimate.DelaySamples,
|
||||
estimate.DelayMicroseconds,
|
||||
predictionError,
|
||||
predictionError * 1_000_000.0 / sampleRate,
|
||||
estimate.Confidence,
|
||||
estimate.DirectHitCount,
|
||||
estimate.MeanAbsoluteErrorSamples,
|
||||
estimate.MeanAbsolutePhaseErrorRadians,
|
||||
referenceHits.Count,
|
||||
candidateHits.Count,
|
||||
estimate.ReflectionTaps.ToArray(),
|
||||
estimate.ReflectionTaps.FirstOrDefault()?.RelativeDelaySamples ?? double.NaN,
|
||||
strongestBands);
|
||||
}
|
||||
|
||||
static int RunComplexContourReplayPanel(string outputPath)
|
||||
{
|
||||
var cases = new[]
|
||||
{
|
||||
new ComplexContourReplayCase(
|
||||
"stored-shotgun",
|
||||
"artifacts/asio/scarlett-canary-packet-anchor-rich-192k-f32.raw",
|
||||
CandidateChannel: 1,
|
||||
PredictedDelaySamples: 534.343605),
|
||||
new ComplexContourReplayCase(
|
||||
"stored-cardioid",
|
||||
"artifacts/asio/scarlett-canary-packet-anchor-rich-192k-f32.raw",
|
||||
CandidateChannel: 0,
|
||||
PredictedDelaySamples: 839.071083),
|
||||
new ComplexContourReplayCase(
|
||||
"fresh-shotgun",
|
||||
"artifacts/asio/scarlett-canary-packet-anchor-rich-latest-192k-f32.raw",
|
||||
CandidateChannel: 1,
|
||||
PredictedDelaySamples: 544.244999),
|
||||
new ComplexContourReplayCase(
|
||||
"fresh-cardioid",
|
||||
"artifacts/asio/scarlett-canary-packet-anchor-rich-latest-192k-f32.raw",
|
||||
CandidateChannel: 0,
|
||||
PredictedDelaySamples: 781.490952)
|
||||
};
|
||||
|
||||
var failures = 0;
|
||||
var results = new List<ComplexContourReplayResult>(cases.Length);
|
||||
foreach (var replayCase in cases)
|
||||
{
|
||||
Console.WriteLine($"complex-contour-panel case={replayCase.Id}");
|
||||
var result = EstimateComplexContourAsioFloat32(
|
||||
replayCase.InputPath,
|
||||
sampleRate: 192_000,
|
||||
channels: 4,
|
||||
referenceChannel: 2,
|
||||
replayCase.CandidateChannel,
|
||||
seconds: 4.0,
|
||||
scheduleOffsetSamples: 1623.0,
|
||||
replayCase.PredictedDelaySamples,
|
||||
MimirBioacousticContestants.CanaryPacketTrill.Id);
|
||||
if (result == null)
|
||||
{
|
||||
failures++;
|
||||
continue;
|
||||
}
|
||||
|
||||
results.Add(result with { CaseId = replayCase.Id });
|
||||
var bands = string.Join(",", result.StrongestBands.Take(4).Select(group =>
|
||||
$"{group.CenterHz:0}Hz:{group.DelayResidualSamples:+0.00;-0.00;0.00}samp/{group.PhaseResidualRadians:+0.00;-0.00;0.00}rad"));
|
||||
Console.WriteLine(
|
||||
$"complex-contour-asio-f32 input={result.InputPath} reference=asio-ch{result.ReferenceChannel} candidate=asio-ch{result.CandidateChannel} " +
|
||||
$"delaySamples={result.DelaySamples:0.000000} delayUs={result.DelayMicroseconds:0.000} " +
|
||||
$"predictedDelaySamples={result.PredictedDelaySamples:0.000000} predictionErrorSamples={result.PredictionErrorSamples:0.000000} predictionErrorUs={result.PredictionErrorMicroseconds:0.000} " +
|
||||
$"confidence={result.Confidence:0.000} directHits={result.DirectHits} maeSamples={result.MeanAbsoluteErrorSamples:0.000000} phaseMaeRad={result.MeanAbsolutePhaseErrorRadians:0.000} " +
|
||||
$"referenceHits={result.ReferenceHits} candidateHits={result.CandidateHits} reflectionTaps={result.ReflectionTaps.Length} " +
|
||||
$"firstReflectionSamples={result.FirstReflectionSamples:0.000} bands={bands}");
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(outputPath) ?? ".");
|
||||
File.WriteAllText(
|
||||
outputPath,
|
||||
JsonSerializer.Serialize(
|
||||
new ComplexContourReplayPanelReceipt(
|
||||
"mimir.bioacoustic.complex-contour-replay.v1",
|
||||
DateTimeOffset.UtcNow,
|
||||
results.ToArray()),
|
||||
new JsonSerializerOptions { WriteIndented = true }));
|
||||
Console.WriteLine($"complex-contour-panel-receipt path={outputPath} cases={results.Count}");
|
||||
return failures == 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
static int CalibrateContestantAsioFloat32(
|
||||
|
|
@ -4810,3 +4950,41 @@ public sealed record BioacousticPhysicalBandCalibration(
|
|||
double ExpectedEnergy,
|
||||
double Gain,
|
||||
bool Usable);
|
||||
|
||||
public sealed record ComplexContourReplayCase(
|
||||
string Id,
|
||||
string InputPath,
|
||||
int CandidateChannel,
|
||||
double PredictedDelaySamples);
|
||||
|
||||
public sealed record ComplexContourReplayPanelReceipt(
|
||||
string Schema,
|
||||
DateTimeOffset CreatedUtc,
|
||||
ComplexContourReplayResult[] Cases);
|
||||
|
||||
public sealed record ComplexContourReplayResult(
|
||||
string CaseId,
|
||||
string InputPath,
|
||||
int SampleRate,
|
||||
int ReferenceChannel,
|
||||
int CandidateChannel,
|
||||
double PredictedDelaySamples,
|
||||
double DelaySamples,
|
||||
double DelayMicroseconds,
|
||||
double PredictionErrorSamples,
|
||||
double PredictionErrorMicroseconds,
|
||||
double Confidence,
|
||||
int DirectHits,
|
||||
double MeanAbsoluteErrorSamples,
|
||||
double MeanAbsolutePhaseErrorRadians,
|
||||
int ReferenceHits,
|
||||
int CandidateHits,
|
||||
MimirAcousticReflectionTap[] ReflectionTaps,
|
||||
double FirstReflectionSamples,
|
||||
ComplexContourBandResidual[] StrongestBands);
|
||||
|
||||
public sealed record ComplexContourBandResidual(
|
||||
double CenterHz,
|
||||
double Weight,
|
||||
double DelayResidualSamples,
|
||||
double PhaseResidualRadians);
|
||||
|
|
|
|||
|
|
@ -27,14 +27,70 @@ public sealed record MimirAcousticReflectionTap(
|
|||
double Weight,
|
||||
int HitCount);
|
||||
|
||||
public sealed record MimirDirectPathBandObservation(
|
||||
double CenterHz,
|
||||
double Weight,
|
||||
double DelayResidualSamples,
|
||||
double PhaseResidualRadians);
|
||||
|
||||
public sealed record MimirDirectPathBandCorrection(
|
||||
double CenterHz,
|
||||
double DelayCorrectionSamples,
|
||||
double PhaseCorrectionRadians,
|
||||
double Weight);
|
||||
|
||||
public sealed record MimirDirectPathEstimate(
|
||||
double DelaySamples,
|
||||
double DelayMicroseconds,
|
||||
double Confidence,
|
||||
double MeanAbsoluteErrorSamples,
|
||||
double MeanAbsolutePhaseErrorRadians,
|
||||
int DirectHitCount,
|
||||
IReadOnlyList<MimirDirectPathBandObservation> BandObservations,
|
||||
IReadOnlyList<MimirAcousticReflectionTap> ReflectionTaps);
|
||||
|
||||
public sealed class MimirDirectPathChannelModel(IReadOnlyList<MimirDirectPathBandCorrection> corrections)
|
||||
{
|
||||
public IReadOnlyList<MimirDirectPathBandCorrection> Corrections { get; } = corrections;
|
||||
|
||||
public static MimirDirectPathChannelModel Empty { get; } = new([]);
|
||||
|
||||
public static MimirDirectPathChannelModel Learn(MimirDirectPathEstimate estimate, double binHz = 250.0)
|
||||
{
|
||||
var corrections = estimate.BandObservations
|
||||
.GroupBy(observation => Math.Round(observation.CenterHz / binHz) * binHz)
|
||||
.Select(group =>
|
||||
{
|
||||
var totalWeight = Math.Max(1.0e-9, group.Sum(observation => Math.Max(observation.Weight, 1.0e-9)));
|
||||
return new MimirDirectPathBandCorrection(
|
||||
group.Key,
|
||||
group.Sum(observation => observation.DelayResidualSamples * Math.Max(observation.Weight, 1.0e-9)) / totalWeight,
|
||||
group.Sum(observation => observation.PhaseResidualRadians * Math.Max(observation.Weight, 1.0e-9)) / totalWeight,
|
||||
totalWeight);
|
||||
})
|
||||
.Where(correction => correction.Weight > 0.0)
|
||||
.OrderBy(correction => correction.CenterHz)
|
||||
.ToArray();
|
||||
return new MimirDirectPathChannelModel(corrections);
|
||||
}
|
||||
|
||||
public double DelayCorrectionFor(double centerHz, double maxDistanceHz = 375.0)
|
||||
{
|
||||
if (Corrections.Count == 0)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
var nearest = Corrections
|
||||
.Select(correction => (Correction: correction, Distance: Math.Abs(correction.CenterHz - centerHz)))
|
||||
.OrderBy(pair => pair.Distance)
|
||||
.First();
|
||||
return nearest.Distance > maxDistanceHz
|
||||
? 0.0
|
||||
: nearest.Correction.DelayCorrectionSamples;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MimirComplexContourMatchedFilterBank(
|
||||
MimirBioacousticContestantRenderer renderer,
|
||||
int sampleRate,
|
||||
|
|
@ -241,6 +297,7 @@ public sealed record MimirDirectPathTrackerOptions(
|
|||
double TrackingLoopBandwidth = 0.20,
|
||||
double MaximumTrackingCorrectionSamples = 12.0,
|
||||
double PredictionGateSamples = 10.0,
|
||||
MimirDirectPathChannelModel? ChannelModel = null,
|
||||
int MinimumDirectHits = 8);
|
||||
|
||||
public sealed class MimirDirectPathTracker(
|
||||
|
|
@ -260,7 +317,7 @@ public sealed class MimirDirectPathTracker(
|
|||
.Where(hit => hit.Rank == 0)
|
||||
.GroupBy(hit => (hit.EventIndex, hit.Kind, hit.SyllableIndex))
|
||||
.ToDictionary(group => group.Key, group => group.OrderByDescending(hit => hit.Score).First());
|
||||
var deltas = new List<(double Delay, double Weight)>();
|
||||
var observations = new List<MimirDirectPathObservation>();
|
||||
foreach (var candidate in candidateHits)
|
||||
{
|
||||
if (!referenceByAnchor.TryGetValue((candidate.EventIndex, candidate.Kind, candidate.SyllableIndex), out var reference))
|
||||
|
|
@ -275,15 +332,21 @@ public sealed class MimirDirectPathTracker(
|
|||
? 0.0
|
||||
: phaseDelta * sampleRate / (Math.Tau * candidate.CenterHz);
|
||||
var maxPhaseCorrection = sampleRate / Math.Max(1.0, candidate.CenterHz) * 0.5;
|
||||
deltas.Add((sampleDelay + Math.Clamp(phaseDelay, -maxPhaseCorrection, maxPhaseCorrection), weight));
|
||||
var channelCorrection = (options.ChannelModel ?? MimirDirectPathChannelModel.Empty).DelayCorrectionFor(candidate.CenterHz);
|
||||
observations.Add(new MimirDirectPathObservation(
|
||||
sampleDelay + Math.Clamp(phaseDelay, -maxPhaseCorrection, maxPhaseCorrection) - channelCorrection,
|
||||
sampleDelay,
|
||||
phaseDelta,
|
||||
candidate.CenterHz,
|
||||
weight));
|
||||
}
|
||||
|
||||
if (deltas.Count < options.MinimumDirectHits)
|
||||
if (observations.Count < options.MinimumDirectHits)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var clusters = ClusterDelays(deltas);
|
||||
var clusters = ClusterDelays(observations);
|
||||
if (clusters.Length == 0)
|
||||
{
|
||||
return null;
|
||||
|
|
@ -320,15 +383,33 @@ public sealed class MimirDirectPathTracker(
|
|||
|
||||
delaySamples = updatedDelay;
|
||||
hasLock = true;
|
||||
var directResiduals = deltas
|
||||
.Where(delta => Math.Abs(delta.Delay - direct.Delay) <= options.DirectClusterRadiusSamples)
|
||||
var directResiduals = observations
|
||||
.Where(observation => Math.Abs(observation.Delay - direct.Delay) <= options.DirectClusterRadiusSamples)
|
||||
.ToArray();
|
||||
var totalWeight = Math.Max(1.0e-9, directResiduals.Sum(delta => Math.Max(delta.Weight, 1.0e-9)));
|
||||
var mae = directResiduals.Sum(delta => Math.Abs(delta.Delay - direct.Delay) * Math.Max(delta.Weight, 1.0e-9)) / totalWeight;
|
||||
var totalWeight = Math.Max(1.0e-9, directResiduals.Sum(observation => Math.Max(observation.Weight, 1.0e-9)));
|
||||
var mae = directResiduals.Sum(observation => Math.Abs(observation.Delay - direct.Delay) * Math.Max(observation.Weight, 1.0e-9)) / totalWeight;
|
||||
var bandObservations = directResiduals
|
||||
.Select(observation =>
|
||||
{
|
||||
var delayResidual = observation.Delay - direct.Delay;
|
||||
var phaseResidual = WrapRadians(observation.PhaseDeltaRadians -
|
||||
Math.Tau * observation.CenterHz * (direct.Delay - observation.SampleDelay) / sampleRate);
|
||||
return new MimirDirectPathBandObservation(
|
||||
observation.CenterHz,
|
||||
observation.Weight,
|
||||
delayResidual,
|
||||
phaseResidual);
|
||||
})
|
||||
.ToArray();
|
||||
var meanAbsolutePhaseError = bandObservations.Length == 0
|
||||
? 0.0
|
||||
: bandObservations.Sum(observation => Math.Abs(observation.PhaseResidualRadians) * Math.Max(observation.Weight, 1.0e-9)) /
|
||||
Math.Max(1.0e-9, bandObservations.Sum(observation => Math.Max(observation.Weight, 1.0e-9)));
|
||||
var confidence = Math.Clamp(
|
||||
direct.Weight / Math.Max(1.0e-9, clusters.Sum(cluster => cluster.Weight)) *
|
||||
Math.Clamp(direct.Count / 16.0, 0.0, 1.0) *
|
||||
(1.0 / (1.0 + mae / Math.Max(1.0, sampleRate * 0.00005))),
|
||||
(1.0 / (1.0 + mae / Math.Max(1.0, sampleRate * 0.00005))) *
|
||||
(1.0 / (1.0 + meanAbsolutePhaseError / 0.75)),
|
||||
0.0,
|
||||
1.0);
|
||||
var reflectionTaps = clusters
|
||||
|
|
@ -346,18 +427,20 @@ public sealed class MimirDirectPathTracker(
|
|||
updatedDelay * 1_000_000.0 / sampleRate,
|
||||
confidence,
|
||||
mae,
|
||||
meanAbsolutePhaseError,
|
||||
direct.Count,
|
||||
bandObservations,
|
||||
reflectionTaps);
|
||||
}
|
||||
|
||||
private MimirDelayCluster[] ClusterDelays(IReadOnlyList<(double Delay, double Weight)> deltas)
|
||||
private MimirDelayCluster[] ClusterDelays(IReadOnlyList<MimirDirectPathObservation> observations)
|
||||
{
|
||||
var sorted = deltas.OrderBy(delta => delta.Delay).ToArray();
|
||||
var sorted = observations.OrderBy(observation => observation.Delay).ToArray();
|
||||
var clusters = new List<MimirDelayCluster>();
|
||||
var index = 0;
|
||||
while (index < sorted.Length)
|
||||
{
|
||||
var members = new List<(double Delay, double Weight)> { sorted[index] };
|
||||
var members = new List<MimirDirectPathObservation> { sorted[index] };
|
||||
var end = index + 1;
|
||||
while (end < sorted.Length &&
|
||||
sorted[end].Delay - members[0].Delay <= options.DirectClusterRadiusSamples)
|
||||
|
|
@ -379,6 +462,13 @@ public sealed class MimirDirectPathTracker(
|
|||
|
||||
private sealed record MimirDelayCluster(double Delay, double Weight, int Count);
|
||||
|
||||
private sealed record MimirDirectPathObservation(
|
||||
double Delay,
|
||||
double SampleDelay,
|
||||
double PhaseDeltaRadians,
|
||||
double CenterHz,
|
||||
double Weight);
|
||||
|
||||
private static double WrapRadians(double radians)
|
||||
{
|
||||
while (radians <= -Math.PI)
|
||||
|
|
|
|||
Loading…
Reference in a new issue