On Inter-Sample Peaks¶
In digital audio, the term inter-sample peak is used to refer to clipping of a digital audio signal that can occur when:
- The digital audio signal is scaled in amplitude without regard to the analog signal that it represents, and
- That digital audio signal is converted to a different sample rate.
This page will explain what an inter-sample peak (ISP) is, how it occurs, and how to handle them in the miniDSP Flex.
A brief explanation of ISPs¶
Figure 1 shows an analog signal in blue and a possible digital sampling of it in red.
This artificial signal won't occur in real music but it's useful to explain the concept. If the sample rate is 44.1 kHz, the figure shows one cycle of an 11.025 kHz sine wave. The maximum allowable levels of the digital signal are +1 and -1, and the digital samples have the value 0.707 or -0.707.
In digital music production, it's common to try and maximize the digital signal level. If this is done in a simple manner with the signal shown above, the result is as shown in Figure 2.
Each sample has been scaled up to have a value of +1 or -1. They are still within the digital range. However, the analog signal that this digital stream now represents has sections that exceed the +/-1 limit. The peaks in this underlying analog signal are referred to as the true peaks. The true peak is marked in Figure 2. For a more detailed discussion, see the BBC Whitepaper Terminology for Loudness and Level dBTP, LU and all that.
If this digital signal is then converted to a different sample rate, some of the new samples will be over the digital limit. This is illustrated in Figure 3.
Since they are over the digital limit, however, they cannot be represented correctly and will clip. The signal we end up with is shown in Figure 4, which has a lot of distortion.
The clipped samples in Figure 4 are referred to as inter-sample peaks. (The term is not quite accurate, but we use it as it's commonly used for this phenomenon. By convention, true peak is the actual peak value of the underlying analog waveform, and inter-sample peaks are the sample that exceed the digital limit after sample-rate conversion and are therefore clipped.) ISP's are also called "inter-sample overs."
ISPs with music signals¶
While the previous section used an artificial signal to illustrate the concept of ISPs, they also occur with music signals. The amount by which the true peaks of a music signal exceed the digital maximum depends on the music and the way that it was processed digitally. For example, the author of the web page What are inter-sample peaks and true peaks? has measured true peaks up to 2.4 dB over the digital limit.
It's possible that clipped inter-sample peaks are less of an issue with modern recordings, due to increased awareness of the issue in music production and greater availability of production tools that are able to measure the true peak of a digital audio track.
It's also worth also noting that most streaming services require that music uploaded to them has a maximum true peak of -1 or -2 dB. (The 1 or 2 dB headroom is to allow for errors when the music is streamed via a lossy encoding process.) The web page Mastering for Streaming: Platform Loudness and Normalization Explained, for example, lists the maximum allowed true peak – shown as e.g. -1 dBTP – of several services.
How to handle ISPs¶
As explained above, ISPs become an issue when the sample rate of a full-scale digital audio signal is changed. Most modern DAC chips oversample their incoming audio stream, and are thus susceptible to distortion from ISPs.
In the miniDSP Flex, while the internal digital processing uses floating-point arithmetic and is therefore not subject to the digital limit until the output to the DAC, it also has an integer-based asynchronous sample rate convertor (ASRC) at the input stage.
Our solution to ISPs in the Flex is to allow the user to reduce the level of the digital signal before it enters the ASRC. This is accomplished by setting the input volume offset of specific inputs to a negative value. A value of -2 to -4 dB is all that is needed:
Note that this measure is needed only if the digital signal is likely to contain ISPs. The most likely culprit is digital audio originating from a CD or file. As noted above, audio from streaming services is much less likely to have ISPs.
Note also that, if you play music from digital audio files and you use the audio player to control volume before the signal reaches the Flex, then in most cases you have already removed ISPs by reducing the level of the digital signal.
Finally, analog inputs never need a negative volume offset, as they are sampled at the internal sample rate of the Flex and there is no sample rate conversion. (Usually, in fact, they benefit from some positive volume offset, to even out the subjective loudness of different inputs.)