1
0
Fork 0

Filter out DC bin in Diopser's spectrum analyzer

This commit is contained in:
Robbert van der Helm 2022-11-18 01:41:37 +01:00
parent 420c3099f5
commit 8e9a1d1b60

View file

@ -86,7 +86,7 @@ impl View for SpectrumAnalyzer {
// We'll match up the bin's x-coordinate with the filter frequency parameter
let frequency = (bin_idx as f32 / spectrum.len() as f32) * nyquist;
let t = self.frequency_range.normalize(frequency);
if !(0.0..=1.0).contains(&t) {
if t <= 0.0 || t >= 1.0 {
continue;
}