Skip to content

Commit

Permalink
first decay, then count
Browse files Browse the repository at this point in the history
  • Loading branch information
magnetophon committed May 31, 2024
1 parent ee9eed7 commit 90e3357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/buffers/histogram_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ impl VisualizerBuffer<f32> for HistogramBuffer {
// don't enqueue silence
if value > 0.0 {
let bin_index = self.find_bin(value);
self.data[bin_index] += (1.0 - self.decay_weight); // Increment the count for the bin
for i in 0..self.size - 1 {
// decay all values
self.data[i] *= self.decay_weight;
}
self.data[bin_index] += (1.0 - self.decay_weight); // Increment the count for the bin
}
}

Expand Down

0 comments on commit 90e3357

Please sign in to comment.