1 Fundamental concepts
1.1 Definition and purpose
A spectrogram is a graphical display of how the frequency content of a signal changes over time. It is used to reveal patterns that are not visible in a simple waveform or in a single, time-averaged spectrum. In practice, spectrograms help analysts identify bursts, steady tones, evolving harmonics, and broadband noise.
1.2 Relationship to signals and spectra
A signal can be described in the time domain as changing amplitude over time, while a spectrum summarizes how much energy is present at different frequencies. A spectrogram combines both views by showing a sequence of spectra taken over short time intervals. This makes it especially useful for nonstationary signals, whose frequency makeup changes during observation.
1.3 Time-frequency representation
Spectrograms belong to the broader class of time-frequency representations. These methods map signal behavior onto two dimensions, with one axis for time and another for frequency. The resulting image can show when particular frequency components appear, persist, or fade, giving a compact summary of complex temporal structure.
2 Construction methods
2.1 Short-time Fourier transform
The most common way to generate a spectrogram is through the short-time Fourier transform. The signal is divided into short segments, and a Fourier transform is computed for each segment. The collection of these local spectra is then arranged in time order to form the display.
2.1.1 Windowing
Before each transform is computed, the segment is usually multiplied by a window function. Windowing reduces abrupt edges at the boundaries of the segment, which helps limit spectral leakage. Different windows, such as Hann or Hamming windows, offer different compromises between sharpness and side-lobe suppression.
2.1.2 Overlap and hop size
Adjacent windows often overlap so that changes in the signal can be tracked more smoothly. The hop size is the distance between successive window positions, and smaller hops produce denser time sampling. Greater overlap can improve visual continuity, although it also increases computation.
2.2 Other computation methods
Although the short-time Fourier transform is standard, other methods can also produce spectrogram-like displays. These alternatives are often chosen when the signal has features that are better represented at varying scales or when specialized analysis is needed.
2.2.1 Wavelet-based methods
Wavelet methods analyze the signal using scaled versions of a prototype wavelet. They provide flexible frequency resolution that varies across the spectrum, with finer detail at higher frequencies or vice versa depending on the formulation. The resulting image is often called a scalogram, though it serves a similar interpretive role.
2.2.2 Filter bank approaches
Filter bank methods pass the signal through multiple bandpass filters and track the output energy in each band over time. This approach is common in speech and audio processing, where frequency bands may be arranged on perceptual scales. Filter bank outputs can be used directly or transformed into compact feature sets.
2.3 Parameter selection
The appearance and usefulness of a spectrogram depend strongly on analysis parameters. Choices such as window length, overlap, and frequency scaling affect how well the display captures detail in time and frequency.
2.3.1 Time resolution
Short windows improve the ability to locate fast changes in time, such as transients or brief bursts. However, very short segments may blur the frequency content and make narrow tones harder to distinguish. Time resolution is therefore a key design choice when studying rapid events.
2.3.2 Frequency resolution
Longer windows improve the ability to separate nearby frequencies. This is valuable when examining harmonics, pitch, or closely spaced spectral lines. The trade-off is that longer windows reduce precision in the timing of short-lived events.
3 Display and interpretation
3.1 Axes and scales
A spectrogram is usually drawn as a two-dimensional plot with time on the horizontal axis and frequency on the vertical axis. The intensity at each point is represented by color or brightness. The choice of scale affects how readily different structures can be interpreted.
3.1.1 Linear frequency scale
On a linear scale, equal vertical spacing corresponds to equal frequency differences. This format is straightforward and is often used in technical analysis, especially when attention is focused on exact frequency values. It is well suited to examining narrowband components and evenly spaced partials.
3.1.2 Logarithmic frequency scale
A logarithmic scale compresses higher frequencies and expands lower ones. Because many natural signals and human perception are organized in ratio-based intervals, this arrangement can be helpful for audio analysis. It often makes harmonic relationships and octave structures easier to see.
3.2 Color maps and intensity encoding
Intensity may be encoded with grayscale, rainbow-like palettes, or other color maps. Bright regions typically indicate stronger energy, while darker areas indicate weaker components. Careful palette choice matters because color can influence readability, perceived contrast, and the ability to compare adjacent features.
3.3 Reading patterns in a spectrogram
Experienced observers can infer signal properties from recurring visual forms. Lines, bands, and patches each correspond to characteristic acoustic or physical events. The pattern language of spectrograms makes them useful for both qualitative inspection and quantitative measurement.
3.3.1 Harmonics
Harmonics appear as a set of regularly spaced horizontal bands above a fundamental frequency. They are common in voiced speech, musical tones, and other periodic signals. The spacing between the bands reflects the underlying repetition rate.
3.3.2 Formants
Formants are broad regions of enhanced energy, especially important in speech analysis. They arise from resonances in the vocal tract and help distinguish vowels and other articulated sounds. In a spectrogram, formants may appear as dark or bright bands depending on the display convention.
3.3.3 Transients and noise
Transients show up as short, sharp vertical structures because they contain many frequencies at once. Noise often appears as a diffuse, textured region rather than a thin line. These patterns help analysts distinguish abrupt impacts, fricatives, environmental sounds, and random fluctuations.
4 Types of spectrograms
4.1 Amplitude spectrogram
An amplitude spectrogram represents the magnitude of each frequency component in each time window. It provides a direct view of signal strength without squaring the values. This form is intuitive and is often used for visualization and basic inspection.
4.2 Power spectrogram
A power spectrogram displays the squared magnitude of the spectral coefficients. Because power is proportional to energy, this format is useful when quantitative comparisons are needed. It is widely used in engineering and scientific analysis.
4.3 Log-spectrogram
A log-spectrogram applies a logarithmic transform to the amplitude or power values. This reduces the dominance of very strong components and makes weaker details more visible. It is especially helpful for signals with a wide dynamic range.
4.4 Mel spectrogram
A mel spectrogram uses frequency bands spaced according to a perceptual mel scale rather than a purely linear axis. This compresses higher frequencies while preserving detail at lower frequencies. It is common in speech and audio processing, particularly in machine learning workflows.
4.5 Cepstrogram
A cepstrogram is based on the cepstrum, which is derived by transforming spectral information into a domain related to periodicity in the spectrum. It can emphasize repetition patterns such as pitch or echo delays. Although less common than standard spectrograms, it is useful in specialized analysis.
5 Applications
5.1 Speech and language analysis
Spectrograms are widely used to study pronunciation, articulation, and phonetic structure. They help reveal vowels, consonants, syllable boundaries, and pitch movement. In linguistics and speech technology, they provide a visual bridge between articulation and acoustic output.
5.2 Music analysis
In music, spectrograms can show notes, overtones, attack phases, and timbral differences. They are useful for studying instrument identification, tuning, vibrato, and sound synthesis. Composers and engineers also use them to inspect recordings and edit sound design details.
5.3 Acoustic ecology
Researchers in acoustic ecology use spectrograms to examine soundscapes from natural and built environments. They can help identify birds, insects, weather-related sounds, machinery, and other sources of ambient audio. Such displays are valuable for cataloging habitats and monitoring environmental change.
5.4 Biomedical signal analysis
Spectrograms are also applied to biomedical signals that vary over time, such as certain physiological recordings. They may help detect rhythmic patterns, bursts, or abnormal episodes in a visual format. In this setting, they support exploratory analysis and feature extraction.
5.5 Seismology and geophysics
In seismology, spectrograms can display how ground-motion energy changes during events. They help distinguish continuous background activity from discrete arrivals and can reveal frequency shifts over the course of a signal. Similar techniques are used in geophysical monitoring and event classification.
5.6 Radar and sonar
Radar and sonar systems often use spectrograms to examine frequency variation in returned signals. These displays can highlight motion-related shifts, pulse structures, and changing reflectivity. They are useful for tracking targets and interpreting complex echoes.
6 Instrumentation and software
6.1 Analog and historical methods
Early spectrograms were produced with specialized analog equipment that analyzed sound continuously and printed the results as traces or density patterns. These devices played an important role in speech research and phonetics before digital processing became standard. Historical methods established many of the conventions still used today.
6.2 Digital signal analysis tools
Modern spectrograms are usually computed with software on general-purpose computers or embedded systems. Signal processing libraries and visualization programs can generate them from recorded data with adjustable parameters. Digital tools make it easy to zoom, rescale, and compare multiple displays.
6.3 Real-time spectrogram displays
Real-time displays update as the signal is acquired, allowing immediate feedback. They are used in live audio monitoring, instrumentation, education, and debugging. Continuous updating can help users recognize patterns quickly, although the chosen settings still determine the clarity of the image.
7 Advantages and limitations
7.1 Strengths
Spectrograms provide an intuitive visual summary of complex, time-varying signals. They can expose structure that is difficult to detect in raw waveform data. Their flexibility also makes them adaptable to many scientific and technical domains.
7.2 Trade-offs in resolution
A central limitation is the balance between time and frequency resolution. Settings that improve one dimension often reduce detail in the other. As a result, no single spectrogram configuration is optimal for every signal or analytical task.
7.3 Common sources of error
Interpretation can be affected by poor parameter choices, sampling limitations, aliasing, and window artifacts. Misleading color scales or inadequate normalization may also distort perception. In addition, the display reflects analysis choices, so a spectrogram should not be treated as a direct photograph of the signal.
8 Related concepts
8.1 Fourier transform
The Fourier transform decomposes a signal into sinusoidal components. It underlies many spectrogram construction methods and explains how frequency information is obtained from time-domain data.
8.2 Spectra and periodograms
A spectrum shows frequency content, usually without time variation, while a periodogram estimates spectral power from a signal segment. Both are closely related to the slices that make up a spectrogram.
8.3 Scalograms
A scalogram is a time-scale representation often derived from wavelet analysis. It serves a role similar to a spectrogram, though its vertical axis is based on scale rather than direct frequency.
8.4 Time-frequency analysis
Time-frequency analysis is the broader field concerned with methods that describe how spectral content evolves over time. Spectrograms are among the most widely used tools in this field and often serve as an entry point for more advanced techniques.