Phase 06: Speech & Audio

Audio Fundamentals — Waveforms, Sampling, Fourier Transform

Waveforms are the raw signal. Spectrograms are the representation. Mel features are the ML-friendly form. Every modern ASR and TTS pipeline walks this ladder, and the first rung is understanding sampling and Fourier. A microphone produces a pressure-vs-time signal. Your neural net consumes tensors. Between them sits a stack of conventions that, when violated, produce silent bugs: the model trains fine but the WER doubles, or TTS ships a hiss, or a voice cloning system memorizes the microphone instead of the speaker. Every bug in speech systems traces back to one of three questions: What sample rate was the data recorded at, and what does the model expect? Is the signal aliased? Are you operating on raw samples or on a frequency representation? Get these right and the rest of Phase 6 is tractable. Get them wrong and even Whisper-Large-v4 produces garbage. Waveform, sampling, DFT, and frequency bins visualized Waveform. A one-dimensional array of floats in [-1.0, 1.0]. Indexed by sample number. To convert to seconds, divide by the sample rate: t = n / sr. A 10-second clip at 16 kHz is an array of 160,000 floats. Sampling rate (sr). How many samples per second. Common rates in 2026: Nyquist-Shannon. A sample rate of sr can unambiguously represent frequencies up to sr/2. The sr/2 boundary is the Nyquist frequency.…

Audio Fundamentals — Waveforms, Sampling, Fourier Transform: Waveforms are the raw signal. Spectrograms are the representation. Mel features are the…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.