---
title: Constant-Q Transform Chromagrams
url: https://www.emergentmind.com/topics/constant-q-transform-cqt-chromagrams
type: topic
---

# Constant-Q Transform Chromagrams

Constant‑Q Transform (CQT) chromagrams are time‑varying pitch‑class representations derived from a constant‑Q time–frequency analysis. In their standard form, they are octave‑folded matrices whose vertical axis indexes pitch classes such as \(C, C^\#, \dots, B\), while the horizontal axis indexes time and the cell value encodes pitch‑class energy. Their defining front end is the Constant‑Q Transform, a logarithmically spaced filterbank in which the ratio between center frequency and bandwidth is constant across bins, making the representation particularly well aligned with musical pitch, harmony, and transposition structure [2410.06927]. Across recent work, CQT chromagrams appear both as explicit features for chord and key analysis and as a conceptual substrate for broader pitch‑aligned neural representations, but their utility is strongly task dependent: they are well suited to harmonic music analysis and often poorly matched to broadband, non‑harmonic audio classification [2509.07756].

## 1. Constant‑Q basis and musical frequency geometry

The mathematical basis of a CQT chromagram is the Constant‑Q Transform itself. In the constant‑Q setting, the center frequency \(f_k\) and bandwidth \(B_k\) or \(\Delta f_k\) of bin \(k\) satisfy
\[
Q = \frac{f_k}{B_k},
\]
with \(Q\) constant across bins. Multiple papers also describe the associated logarithmic frequency grid as
\[
f_k = f_{\min} 2^{k/B},
\]
where \(B\) is the number of bins per octave [2510.10173]. A standard discrete formulation uses bin‑dependent window lengths,
\[
X(k,n) = \sum_{m=0}^{N_k-1} x[n-m]\, w_k[m]\, e^{-2\pi i f_k m/f_s},
\qquad
N_k \approx \frac{Q f_s}{f_k},
\]
so that low frequencies are analyzed with longer windows and high frequencies with shorter windows [2505.04451].

This construction yields the characteristic CQT time–frequency trade‑off. At lower frequencies, bandwidths are narrower, frequency resolution is higher, and time resolution is poorer; at higher frequencies, bandwidths are wider, time resolution improves, and frequency resolution decreases [2410.06927]. In contrast to the STFT, whose fixed window imposes constant absolute bandwidth, the CQT allocates resolution in a way that follows musical interval structure. Several papers emphasize that this logarithmic spacing makes octave relations and semitone shifts geometrically regular in the representation, which is one reason CQT is repeatedly described as especially suitable for music analysis, MIR, and pitch‑structured modeling [2605.12310].

The same geometry underlies claims of approximate pitch equivariance in convolutional systems. When pitch is shifted in audio, the corresponding harmonic pattern moves approximately as a vertical translation on a log‑frequency CQT image, so convolutional filters can be reused across registers. This argument is explicit in timbre transfer and diffusion work built on high‑resolution CQT representations, and it provides an important conceptual bridge between raw CQT images and octave‑folded chromagrams [1811.09620].

## 2. From CQT coefficients to octave‑folded chroma

A CQT chromagram is obtained by collapsing CQT energy across octaves into pitch classes. One recent system defines it directly as a 12‑dimensional, time‑varying representation in which each dimension corresponds to one pitch class independent of octave [2510.10173]. More generally, if \(X^{\mathrm{CQ}}(m,k)\) denotes the CQT coefficient at time frame \(m\) and log‑frequency bin \(k\), then a chroma mapping takes the form
\[
C(m,p) = \sum_{k \in K(p)} W(p,k)\,\left|X^{\mathrm{CQ}}(m,k)\right|,
\]
where \(p\) indexes pitch classes and \(W(p,k)\) is a weighting matrix assigning CQT bins to chroma bins [2509.07756]. Equivalent formulations sum over sets \(\mathcal{K}_p\) of bins whose pitches belong to the same class modulo octave:
\[
c(p,n)=\sum_{k\in \mathcal{K}_p} |X(k,n)|.
\]

Operationally, the workflow is consistent across implementations. First, a magnitude or power CQT spectrogram is computed on a logarithmic frequency grid. Second, CQT bins are mapped to pitch classes modulo octave, typically producing 12 pitch‑class channels. Third, the per‑frame chroma vectors may be normalized, often by library defaults such as those in `librosa.feature.chroma_cqt`; later variants such as CENS apply additional normalization and quantization on top of a CQT‑chromagram base rather than redefining the underlying chroma representation [2410.06927].

The chromagram’s information geometry is therefore markedly different from that of the underlying CQT. The CQT retains octave height, while the chromagram folds octave‑separated bins into a single pitch‑class axis. This makes chromagrams transposition‑ and register‑tolerant in a musically useful way, but it also discards absolute register. A recurring practical implication is that octave folding is beneficial when harmonic function matters more than register, and detrimental when absolute spectral region or octave placement is discriminative. One score‑following study explicitly avoids full chroma collapse for this reason, preferring normalized CQT energy vectors with octave resolution because classical chromagrams can confuse repeated pitch‑class patterns appearing in different octaves [2205.03247].

## 3. Representation properties and comparison with adjacent front ends

CQT chromagrams are often contrasted with STFT chromagrams, mel spectrograms, and MFCCs. STFT chromagrams begin from a linear‑frequency STFT with fixed window length; they can provide good temporal resolution but have limited low‑frequency resolution and are more sensitive to tuning and absolute frequency placement. CQT chromagrams, by contrast, inherit logarithmic spacing and higher low‑frequency resolution from the constant‑Q front end, which makes them natural for harmonic analysis, melody, chord recognition, and key detection, but they incur higher computational cost and can lose temporal resolution at low frequencies because of longer analysis windows [2509.07756].

Relative to mel spectrograms and MFCCs, chromagrams encode a different inductive bias. Mel and cepstral features preserve broader spectral envelope information and are not explicitly octave folded. CQT chromagrams instead privilege pitch classes and harmonic structure. This makes them attractive where pitch‑class content is central, but it can be a liability where broadband texture, noise profile, or absolute register carries more discriminative information. This contrast appears repeatedly in environmental sound work, where chroma‑based features underperform mel‑scale or cepstral features despite their musical elegance [2410.06927].

It is also important to distinguish CQT chromagrams from full‑resolution CQT tensors used in modern neural audio systems. Polyphonic singing voice conversion, timbre transfer, and diffusion‑based inverse problems often retain the full octave‑resolved CQT rather than folding to 12 chroma bins. Those systems exploit the same log‑frequency structure that motivates chromagrams, but they preserve octave information because harmony reconstruction, timbre modeling, and exact resynthesis depend on pitch height as well as pitch class [2210.15228]. This suggests a useful taxonomy: a chromagram is not the CQT itself, but a downstream, octave‑collapsed statistic of a pitch‑aligned transform.

## 4. Computational frameworks, libraries, and parameterization

In contemporary practice, many CQT chromagrams are computed through `librosa`, and several empirical studies rely explicitly on the library’s standard CQT/chroma routines rather than custom implementations [2410.06927]. This is especially common in classification and interactive visualization work, where the emphasis is on comparing representations or building downstream systems rather than deriving new transforms. A consequence is that some papers document the conceptual transform carefully while leaving numeric defaults such as `bins_per_octave`, `f_{\min}`, hop size, or window type implicit.

Other work provides concrete parameterizations that clarify the design space. Poly‑SVC uses audio resampled to \(44.1\,\text{kHz}\), hop length \(441\) samples, \(12\) bins per octave, \(84\) total bins, and then crops the CQT to \(32\,\text{Hz}\)–\(1000\,\text{Hz}\) for singing‑range modeling [2605.12310]. TimbreTron uses \(16\,\text{kHz}\) audio, \(16\,\text{ms}\) hop size, \(48\) bins per octave, \(336\) bins over seven octaves starting at C1, and a \(Q\)-scaling parameter \(\gamma=0.8\) [1811.09620]. CQT‑Diff uses an invertible nonstationary Gabor implementation with \(64\) bins per octave over seven octaves and a rasterized constant time grid to support convolutional processing in the transform domain [2210.15228].

The literature also contains algorithmic frameworks for exact or near‑exact inversion of the CQT front end. The CQ‑NSGT and sliCQ framework constructs an invertible constant‑Q transform using nonstationary Gabor frames and slice‑wise processing for real‑time operation, overcoming the non‑invertibility and computational inefficiency of classical CQT implementations [1210.0084]. QTAM extends the invertible Q‑transform idea by demodulating each band to a slowly varying complex baseband envelope, enabling lossless decimation, exact reconstruction, and GPU‑accelerated dense time–frequency analysis [2603.29785]. These works do not produce chromagrams directly, but they matter because chromagrams are frequently computed from magnitude CQT representations that sit on top of such front ends.

Parameterization studies further show that bins per octave are not merely a cosmetic choice. A transcription study found that CQT with 12 bins per octave yielded low transcription accuracy, that moving to 24 bins per octave improved performance sharply, and that performance continued to improve up to 84 bins per octave before deteriorating again [2001.09989]. Another piano AMT pipeline used \(44.1\,\text{kHz}\) audio, \(0.0625\,\text{s}\) frames, and a C2–C8 note range, explicitly framing the CQT as the front end from which octave‑collapsed chroma could be derived if desired [2505.04451]. This suggests that chromagram quality depends not only on the octave‑folding rule but also on the spectral resolution available before folding.

## 5. Applications across harmony analysis, alignment, transcription, and neural audio

The most direct use case for CQT chromagrams remains harmonic music analysis. In a near real‑time visualization system, a Librosa CQT‑based chromagram is computed over 4‑second audio chunks, averaged across time, squared for tonal emphasis, thresholded at \(0.15\) for audible tones and \(0.2\) for chord tones, and then used to infer root, major/minor third, and fifth. A confidence score derived from the relative energies of the major and minor third determines whether the GUI and Arduino LED display are updated; only detections with Moderate or higher confidence are shown [2510.10173]. This system also illustrates a common limitation: CQT chromagrams can support interpretable triad estimation, but the prototype does not detect inversions or extended chords such as sevenths and augmented chords.

Score following and alignment provide a different perspective. A DTW/OLTW follower computes normalized CQT magnitude vectors
\[
E(t)=\frac{|C_Q(t)|}{\|C_Q(t)\|_1}
\]
from score audio and performance audio, and then aligns them with a local cost
\[
d(i,j)=\|E_i-E_j\|_1.
\]
In this setting, the CQT front end consistently and significantly outperforms a commonly used FFT‑based approach, especially under polyphony and expressive timing variation [2205.03247]. The same study explicitly argues against immediate collapse to 12‑D chroma, because octave‑invariant chromagrams can confuse structurally similar material presented in different registers.

Automatic music transcription sits between pitch salience and octave specificity. One piano AMT system feeds CQT coefficients directly into a CNN to predict a 72‑dimensional note‑activity vector spanning C2–C8 [2505.04451]. A broader representation comparison for polyphonic multi‑instrument transcription reports that high‑resolution log‑frequency STFT outperforms CQT under a simple network, even though CQT remains a musically aligned precursor from which chromagrams can be constructed [2001.09989]. A plausible implication is that chromagrams are rarely the best representation for frame‑accurate note estimation when octave identity must be preserved, but they remain compelling when the target variable is harmonic function rather than note‑level transcription.

In modern neural audio generation and conversion, octave‑resolved CQTs rather than chromagrams dominate, yet the connection to chroma remains close. TimbreTron treats log‑magnitude CQT as an image domain in which pitch shifts become approximate vertical translations, and CQT‑Diff uses an invertible CQT to precondition a diffusion model so that pitch equivariance becomes translation equivariance for convolutions [1811.09620]. Poly‑SVC similarly adopts a CQT‑based pitch representation because scalar \(F_0\) extractors are inadequate in harmony‑rich or residual‑polyphony scenarios [2605.12310]. These systems do not fold to chroma, but they show that the core constant‑Q geometry underlying chromagrams remains central in contemporary pitch‑aware deep audio models.

## 6. Task dependence, empirical performance, and recurrent misconceptions

The strongest empirical caution in the recent literature is that CQT chromagrams are not universally effective. In one ESC‑50 environmental sound study using a shared deep CNN, CQT chromagrams reached \(76.94\%\) training accuracy, \(19.25\%\) validation accuracy, training loss \(0.75\), and validation loss \(4.60\), compared with \(57.50\%\) validation accuracy for mel‑scaled spectrograms and \(56.00\%\) for MFCCs [2410.06927]. In a later ESC‑50 study with the same representational family, CQT chromagrams obtained training accuracy \(77.7\%\), validation accuracy \(21.3\%\), training loss \(0.726\), and validation loss \(3.949\), again far below mel spectrograms and MFCCs; at category level, cyclic tempograms and chromagrams as a group occupied only a \(36.2\%\)–\(45.6\%\) band for accuracy, precision, recall, and \(F_1\) [2509.07756]. These studies support a general conclusion already stated by their authors: chroma‑based features emphasize harmonic structure, which is often the wrong bias for ESC‑50’s many non‑harmonic environmental sounds.

A related caution appears in general audio representation learning. One study comparing STFT‑based mel preprocessing against CQT preprocessing for a PaSST backbone reports that STFT outperformed CQT in all tested tasks, including Beijing Opera classification (\(90.6\%\) vs. \(36.8\%\)), NSynth pitch (\(50.9\%\) vs. \(4.8\%\)), CREMA‑D emotion (\(46.5\%\) vs. \(19.4\%\)), and FSD50K mAP (\(27.8\%\) vs. \(3.5\%\)) [2303.03591]. Although this experiment concerns CQT spectrograms rather than chromagrams, it shows that pitch‑aligned front ends do not automatically yield superior learned embeddings when architecture and objective are mismatched.

The opposite pattern appears in tasks where low‑frequency pitch structure and harmonic resolution matter. A speech emotion recognition study finds that constant‑Q representations provide higher time‑invariance at low frequencies, better resolution of pitch harmonics than MFSC, and improved performance across four databases and six deep back ends [2211.16363]. This does not validate chromagrams as such, but it reinforces the broader point that the constant‑Q bias is beneficial when discriminative structure is tied to pitch and harmonics.

Two misconceptions therefore recur. The first is that CQT chromagrams are inherently superior because they are more “musical.” The evidence does not support that generalization; their success is domain specific. The second is that octave invariance is always desirable. In chord or key analysis, octave folding is often an asset; in score following, environmental audio, and note‑level transcription, losing absolute register can be damaging [2205.03247]. A precise summary is that CQT chromagrams are most effective when pitch‑class organization is the target signal and least effective when the task depends on broadband texture, absolute spectral placement, or octave‑resolved structure.

In this sense, CQT chromagrams occupy a distinct but limited place in the larger ecosystem of pitch‑aware audio representations. They are concise, musically interpretable, and grounded in a time–frequency transform whose logarithmic geometry matches tonal organization. Yet the same octave folding that gives them elegance also imposes an information bottleneck. Recent work therefore points in two complementary directions: using CQT chromagrams explicitly for harmonic inference when pitch classes are the object of interest, and retaining full octave‑resolved CQT representations when modern neural systems need the same musical geometry without sacrificing pitch height.

Source: https://www.emergentmind.com/topics/constant-q-transform-cqt-chromagrams