Audio #1

Merged
itten merged 11 commits from audio into main 2026-09-16 23:50:47 +03:00
Showing only changes of commit b5c3c82b1e - Show all commits
+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