fix: stabilize localization comparison semantics
This commit is contained in:
@@ -601,14 +601,23 @@ export function estimateDasWorkload(options) {
|
||||
};
|
||||
}
|
||||
|
||||
export function finalizeDasBands(rawMaps, workload, experiment, rawScale = "power") {
|
||||
export function finalizeDasBands(
|
||||
rawMaps,
|
||||
workload,
|
||||
experiment,
|
||||
rawScale = "power",
|
||||
options = {},
|
||||
) {
|
||||
if (rawScale !== "power" && rawScale !== "score") {
|
||||
throw new RangeError('rawScale must be "power" or "score".');
|
||||
}
|
||||
const averageBandBins = options.averageBandBins !== false;
|
||||
return experiment.frequencyBands.map((band, bandIndex) => {
|
||||
const rawMap = rawMaps[bandIndex];
|
||||
for (let pointIndex = 0; pointIndex < workload.pointCount; pointIndex += 1) {
|
||||
rawMap[pointIndex] /= workload.bandBins[bandIndex].length;
|
||||
if (averageBandBins) {
|
||||
for (let pointIndex = 0; pointIndex < workload.pointCount; pointIndex += 1) {
|
||||
rawMap[pointIndex] /= workload.bandBins[bandIndex].length;
|
||||
}
|
||||
}
|
||||
const rawPeak = findPeak(rawMap);
|
||||
const displayMap = Float32Array.from(rawMap);
|
||||
|
||||
Reference in New Issue
Block a user