Analyze normalized mono PCM using a Hann-windowed real FFT. More...
Public Member Functions | |
| bool | is_zeroized (self) |
| Return whether an ambient-noise calibration is active. | |
| None | start_zeroize (self) |
| Begin collecting ambient-noise calibration blocks. | |
| None | finish_zeroize (self) |
| Commit the collected ambient-noise calibration. | |
| None | clear_zeroize (self) |
| Discard the current ambient-noise calibration. | |
| MusicAnalysisState | analyze (self, Sequence[float] samples, int sample_rate_hz) |
| Analyze one block of normalized mono PCM samples. | |
Protected Member Functions | |
| np.ndarray | _gate_spectral_leakage (self, np.ndarray magnitude) |
| Suppress bins far below the strongest spectral component. | |
Analyze normalized mono PCM using a Hann-windowed real FFT.
|
protected |
Suppress bins far below the strongest spectral component.
A Hann window greatly reduces FFT leakage, but it does not eliminate it. Without a floor, adaptive per-band normalization can promote tiny leakage in an otherwise empty band to full-scale activity on the first frame.
| MusicAnalysisState audio.music_analysis.music_analyzer.MusicAnalyzer.analyze | ( | self, | |
| Sequence[float] | samples, | ||
| int | sample_rate_hz | ||
| ) |
Analyze one block of normalized mono PCM samples.
| samples | Normalized mono PCM samples. |
| sample_rate_hz | Source sample rate in hertz. |
Reimplemented from audio.music_analysis.music_analyzer_if.MusicAnalyzerIf.
| bool audio.music_analysis.music_analyzer.MusicAnalyzer.is_zeroized | ( | self | ) |
Return whether an ambient-noise calibration is active.
Reimplemented from audio.music_analysis.music_analyzer_if.MusicAnalyzerIf.