truth fix

This commit is contained in:
Dmitry Sergeev
2026-09-16 22:47:14 +03:00
parent 70c966dbad
commit b5c3c82b1e
+3
View File
@@ -39,6 +39,9 @@ func NewSineGenerator(
return nil, fmt.Errorf("base frequency must be finite and greater than zero, got %g", baseFrequency) return nil, fmt.Errorf("base frequency must be finite and greater than zero, got %g", baseFrequency)
} }
// Keep every generated tone below the Nyquist frequency (the
// KotelnikovNyquistShannon sampling limit), sampleRate/2
// Nyquist leaved as compromise for common English terminology
sampleRate := float64(rate.Num) / float64(rate.Den) sampleRate := float64(rate.Num) / float64(rate.Den)
highestFrequency := float64(cfg.Channels()) * baseFrequency highestFrequency := float64(cfg.Channels()) * baseFrequency
nyquist := sampleRate / 2 nyquist := sampleRate / 2