On this page

A master is checked, limited to a chosen ceiling and delivered as a lossless file. Most listeners then hear it through a lossy codec, and the waveform that comes out of the decoder is not the one that went in. Its peaks can be higher. This guide explains why, reports an experiment that measures the effect on defined test signals, and describes how to test a real master instead of relying on a rule of thumb.

The short answer

  • Leave room. A true-peak ceiling of −1 dBTP is a sound default, and −2 dBTP for a loud, dense master. That matches Spotify's published advice and the measurements below.
  • The rise is not a fixed number. In the experiment on this page it ranged from nothing to about 2.5 dB, depending on the signal and the codec. Clipped, dense material rose most.
  • The only reliable figure is your own. Encoding and decoding your master takes a few minutes: the step-by-step check has the commands, a sheet to fill in and a rule for what to change.

The rest of this guide explains why peaks move at all and reports the experiment in full.

What a transform codec keeps and what it discards

AAC and Ogg Vorbis are perceptual transform codecs, and so is the CELT layer that Opus uses for music; Opus also has a linear-prediction layer, SILK, for speech, and can combine the two. None of them stores samples. In the transform case the encoder cuts the signal into overlapping blocks, converts each block to a set of frequency coefficients with a modified discrete cosine transform (MDCT), and then quantizes those coefficients, spending more bits where a psychoacoustic model predicts that errors would be audible and fewer where it predicts they would be masked. The decoder reverses the transform on the quantized coefficients and overlap-adds the blocks into a new waveform.

Where a lossy codec changes the waveformBlock diagram: PCM master, analysis filterbank (MDCT), psychoacoustic model and quantisation, bitstream, synthesis filterbank, decoded PCM whose peaks differ from the master, then conversion to fixed point or a limiter.PCM masterpeaks knownAnalysisMDCT filterbank(resample for Opus)Quantisepsychoacousticbit allocationBitstreamAAC / Vorbis / OpusSynthesisinverse MDCT,overlap-addDecoded PCMsame spectrum,new waveformOutput stageclip or limitabove full scaleQuantisation error is spread within each coded band, so sample values and inter-sample peaks change.
Figure 1. A transform codec does not store samples. It stores quantised spectral coefficients, and the decoder builds a new waveform from them. Schematic illustration, not a measurement.
CodecDefined inPoints relevant to peak level
AAC (AAC-LC)ISO/IEC 14496-3MDCT with long and short blocks. Several independent encoder implementations exist and they do not behave identically.
Ogg VorbisVorbis I specification, Xiph.Org FoundationMDCT with two block sizes; the spectrum is coded as a smooth floor curve plus a residue.
OpusRFC 6716, IETFCombines a speech layer (SILK) with a transform layer (CELT), which carries music. It operates internally at 48 kHz, so 44.1 kHz material is resampled.

The decoded audio has nearly the same spectrum as the original as far as hearing is concerned. Nothing in the process tries to preserve the shape of the waveform, and peak level is a property of the waveform.

Four mechanisms that change peaks

  1. Band-limiting. Encoders commonly discard content above a cutoff that depends on bitrate. Removing the upper harmonics of a steep waveform edge makes the remaining waveform overshoot the original level, an effect known as the Gibbs phenomenon. Hard-limited and clipped masters are full of steep edges.
  2. Quantization error. The error added in each band is shaped to be masked, but it is still added to the waveform. When many samples already sit at the ceiling, some of them are pushed over it.
  3. Changed phase relationships. Block processing, joint-stereo coding and the removal of masked components alter how the remaining components line up in time, and with them the height of the peaks.
  4. Resampling. When the codec works at a different sample rate from the source, as Opus does with 44.1 kHz input, the decoded samples fall at new instants. Inter-sample peaks of the original can become sample peaks of the decoded file.

Worked engineering example

Overshoot from band-limiting alone

Take a 1 kHz square wave sampled at 44.1 kHz with every sample at −1.00 dBFS, the extreme case of a clipped waveform.

  • Its sample peak is −1.00 dBFS. Its true peak, estimated by 4× oversampling, is already +1.10 dBTP, because reconstruction band-limits it to half the sample rate.
  • After an ideal low-pass filter at 16 kHz, with no other processing, the true peak is +0.89 dBTP.
  • The theoretical limit for a band-limited step is an overshoot of about 9% of the step height, which for a square wave is 1.43 dB above its flat level.

The overshoot varies with where the cutoff falls among the harmonics, and it never goes away. No encoder is needed to produce it.

Assumptions: an ideal square wave and an ideal brick-wall filter. Music is not a square wave, but the more a master has been clipped, the more of this behaviour it shows. This is a calculation, not an encode.

A measured experiment

To see what real encoders do, eight synthetic signals were encoded and decoded with three codecs, and the true peak of each decoded file was measured.

Measured experiment

True peak before and after encoding, 24 encodes

Run on: November 10, 2026, by script, for this guide.

Software: FFmpeg 6.1.1 with its native AAC encoder (AAC-LC) at 256 kbit/s; libvorbis 1.3.7 at quality 5; libopus 1.4 at 128 kbit/s. Default encoder settings otherwise.

Inputs: ten-second synthetic signals at 44.1 kHz, identical in both channels, stored as 32-bit floating-point WAV. No recorded music was used.

Procedure: encode; decode to 32-bit floating-point PCM so that values above full scale are preserved; estimate true peak by 4× oversampling with a 257-tap Kaiser-windowed sinc interpolator, the oversampling method of ITU-R BS.1770 with the site's own filter; ignore the first and last half second. Opus output is at 48 kHz.

Cross-check: the same decoded files were measured with FFmpeg's own true-peak meter. The largest disagreement across the 24 files was 0.27 dB.

Test signalSourceAAC 256kVorbis q5Opus 128k
997 Hz sine, peak −1 dBFS−1.00−0.99
(+0.01)
−0.82
(+0.18)
−0.89
(+0.11)
11,025 Hz sine with samples off the peaks, sample peak −1 dBFS+2.01+2.01
(+0.00)
+2.31
(+0.30)
+2.17
(+0.16)
1 kHz square wave, −1 dBFS+1.10+1.36
(+0.26)
+2.02
(+0.91)
+1.58
(+0.48)
Pink noise, hard-clipped at −1 dBFS+1.74+3.86
(+2.12)
+2.66
(+0.92)
+2.63
(+0.89)
The same noise, scaled to −1 dBTP−1.00+1.48
(+2.48)
−0.29
(+0.71)
+0.27
(+1.27)
The same noise, scaled to −2 dBTP−2.00−1.93
(+0.07)
−1.37
(+0.63)
−1.00
(+1.00)
Five-note sawtooth chord, hard-clipped at −1 dBFS−0.42+1.16
(+1.58)
+0.16
(+0.58)
+0.29
(+0.71)
The same chord, scaled to −1 dBTP−1.00+0.24
(+1.24)
−0.42
(+0.58)
−0.56
(+0.44)

All values are true peak in dBTP; the figure in brackets is the change from the source in dB. The clipped noise and the clipped chord have crest factors of 6.37 dB and 6.27 dB, meaning that their peaks are only about 6 dB above their RMS level, which is extremely dense.

Retained: the generating script, the encoder command lines and the raw results are kept by SUNO.click and are available on request through the contact page. Scope: these results describe these signals, these encoder versions and these settings. They are not a prediction for any streaming service, which uses its own encoders and bitrates, and they involve no listening.

True peak before and after lossy encodingGrouped bars of measured true-peak level for six synthetic signals: the source and the decoded output of AAC, Ogg Vorbis and Opus encodes. Every decoded bar is higher than its source bar, by between 0.07 and 2.48 dB.−3−2−101234True peak (dBTP)SquarePink clipPink −1 TPPink −2 TPChord clipChord −1 TPsourceAAC 256kVorbis q5Opus 128k
Figure 2. Measured true peak of six synthetic test signals before and after encoding and decoding (FFmpeg 6.1.1; AAC-LC 256 kbit/s, libvorbis quality 5, libopus 128 kbit/s). Measured experiment run for this guide; see the method box.

The figure plots the six signals with steep waveform edges. The two sine tones are left out because their bars barely differ.

Reading the results

  • Every encode raised the true peak or left it unchanged. The changes ranged from +0.00 to +2.48 dB.
  • Steady tones barely moved. The 997 Hz sine changed by +0.18 dB at most.
  • Dense, clipped signals moved most. By up to 2.5 dB, and by 0.4 dB or more in all but one of the fifteen cases.
  • The change is not a fixed offset. For the clipped noise, lowering the source from −1 to −2 dBTP reduced the AAC overshoot from +2.48 dB to +0.07 dB, a far larger difference than the 1 dB change in level, while the Vorbis and Opus figures changed only slightly. The cause was not investigated; the observation is that an encoder's behaviour near full scale can depend strongly on level.
  • Sample peaks can jump after resampling. The 11,025 Hz test tone has a sample peak of −1.00 dBFS and a true peak of +2.01 dBTP. After Opus, which resamples to 48 kHz, the decoded sample peak was +2.17 dBFS: the inter-sample peak had become an ordinary one.
  • Headroom at the source decided the outcome. Of the six encodes made from the clipped noise and the clipped chord at −1 dBTP, three decoded above 0 dBTP. All three encodes made from the noise at −2 dBTP stayed below it.

No single number summarises this table, which is the main finding. A statement such as “codecs add about one decibel” is true for some rows and wrong by a factor of two for others.

What happens to the overshoot at playback

A decoder that outputs floating-point audio preserves values above full scale, and what follows depends on the player. If normalization then turns the track down by more than the overshoot, nothing clips. If the track is played at full level, or the decoder outputs fixed-point audio, the overs are clipped or caught by a limiter in the device. The audible result ranges from nothing to a slight roughness on the loudest transients. This is the reason delivery recommendations ask for true-peak headroom in the first place.

What services use

Services choose their own codecs, encoders and bitrates and revise them over time. At the time of writing, their public help pages state the following:

  • Spotify lists AAC for its web player and tiers of up to roughly 320 kbit/s in its apps, which have long used Ogg Vorbis for lossy playback.
  • YouTube Music lists AAC and Opus at up to 256 kbit/s.
  • Apple Music delivers AAC alongside lossless ALAC.

An encoder used by a service is not the encoder in a DAW or in FFmpeg, even when the format name is the same. Apple, for example, provides its own tools for auditioning and checking the result of its AAC encoder as part of its Apple Digital Masters programme.

Choosing headroom

Published guidance and the experiment point the same way. Spotify advises keeping masters below −1 dBTP, and below −2 dBTP for masters louder than −14 LUFS, on the grounds that louder masters are more susceptible to distortion added in transcoding. EBU R 128 sets −1 dBTP as the maximum for broadcast. A ceiling of −1 dBTP is a reasonable default, and the denser and more clipped the master, the stronger the case for more. The true peak and LUFS guide discusses ceilings together with loudness normalization, and the headroom estimator shows how much margin normalization itself leaves.

The reliable answer for a specific master is to test it.

Testing a master

The procedure is the one used in the experiment: encode, decode to floating point, and measure true peak. The companion page, How to Check Your Master After AAC and Opus Encoding, walks through it with a sheet to fill in and a second measured run at three ceilings. In brief, with FFmpeg:

ffmpeg -i master.wav -c:a libopus -b:a 128k test.opus
ffmpeg -i test.opus -c:a pcm_f32le decoded.wav
ffmpeg -nostats -i decoded.wav -af ebur128=peak=true -f null -

The last command prints a summary that includes the true peak. Replace the first line to test other codecs: -c:a aac -b:a 256k test.m4a for FFmpeg's AAC encoder, or -c:a libvorbis -q:a 5 test.ogg for Vorbis. Points to keep in mind:

  • Decode to pcm_f32le. Decoding to 16-bit or 24-bit integers clips the overs and hides them.
  • Test the loudest section of the song, or the whole file.
  • If the decoded true peak exceeds 0 dBTP, lower the limiter ceiling by somewhat more than the excess and test again, since the overshoot does not scale linearly with level.
  • Treat the result as an indication. The service's encoder will differ from the one used for the test.

Summary

  • Lossy codecs preserve how audio sounds, not the waveform, so peaks change.
  • The change depends on the signal, the codec, the encoder implementation and the level. In this experiment it ranged from nothing to 2.5 dB.
  • Clipped and heavily limited material overshoots most.
  • A −1 dBTP ceiling is a sound default; dense masters warrant more, and a test encode removes the guesswork.

Primary technical references

  1. J.-M. Valin, K. Vos and T. Terriberry, RFC 6716: Definition of the Opus Audio Codec, Internet Engineering Task Force, 2012.
  2. Xiph.Org Foundation, Vorbis I specification.
  3. ISO/IEC 14496-3, Information technology: Coding of audio-visual objects, Part 3: Audio. The AAC standard.
  4. ITU-R, Recommendation BS.1770: Algorithms to measure audio programme loudness and true-peak audio level.
  5. FFmpeg, Codecs documentation and Filters documentation (the ebur128 filter used for the cross-check).
  6. Spotify for Artists, Loudness normalization, and Spotify, Audio quality (checked November 10, 2026).
  7. YouTube Music Help, Change your audio quality (checked November 10, 2026).
  8. Apple, Apple Digital Masters, and Apple Support, About lossless audio in Apple Music.