liveBook · Manning

Waveform

As explained in Transformers in Action

A waveform is a representation of a time-varying signal, such as an audio signal.

A waveform represents a time-varying signal as a sequence of amplitude values sampled at discrete points in time. Digital audio stores these values at thousands of time positions, preserving the signal's temporal structure while containing frequency information implicitly. section 6.3.5

Audio models usually do not consume the raw waveform directly. Short-time Fourier transform analysis divides it into overlapping windows and converts each window into frequency information, producing a spectrogram with time, frequency, and amplitude dimensions. section 6.3.5

A practical audio pipeline treats the waveform as the handoff between extraction and model inference:

  • Extract a mono waveform from a video and resample it to the audio encoder's expected 16 kHz rate. section 6.3.6
  • Provide the waveform and sampling rate to a reusable multimodal inference helper alongside a text prompt. section 6.3.6

Inspecting and querying an audio waveform

A 16 kHz waveform can be visualized as a mel spectrogram with librosa using an 1,024-point FFT, a 256-sample hop, and 80 mel bands. The same waveform can then support prompts for instrument and genre analysis or speech transcription and summarization.

Figure 6.7 Mel spectrogram of the trumpet example from the Librosa library
figure

Use the mel spectrogram figure to inspect how waveform energy is distributed across time and perceptual frequency. section 6.3.5

How Transformers in Action covers it

How deep it goes
Defines amplitude samples and traces conversion through spectrograms, but stops short of detailing encoder internals.
Examples
Demonstrates video extraction, 16 kHz mono WAV conversion, mel inspection, music analysis, and speech transcription.
What it assumes
Assumes basic digital audio handling while teaching waveform normalization and model-ready representation from raw audio.
What you can do after
Operate/configure an audio pipeline that extracts, validates, visualizes, and queries waveform data.
How it connects
Connects audio tokenization, short-time Fourier transform, spectrograms, mel spectrograms, and transformer encoders.

Also explained in

Compare how 2 books explain waveform →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Transformers in Action. The section links point to the parts of the book it draws on.