Common Audio Quality Issues Potentially Caused by Resampling

Resampling refers to the process of changing the sample rate of a digital audio signal. It involves converting the audio from one sample rate (e.g. 44.1 kHz) to another (e.g. 48 kHz). Resampling is commonly done in audio production for various reasons:

To match the sample rate of other audio tracks or hardware devices. For example, resample a 44.1 kHz track to 48 kHz to match a video project timeline or external hardware mixer.

To reduce file size and strain on CPU by downsampling unneeded high sample rate audio. For example, resample a 96 kHz recording to 44.1 kHz for distribution.

To take advantage of higher sample rates for increased frequency response and resolution when upsampling. For example, resample a 44.1 kHz track to 96 kHz before further processing and mastering.

To alter the pitch/tempo of audio material independently of speed/duration.

While resampling is often necessary in production workflows, it can potentially introduce audible artifacts and quality issues if not done carefully. The rest of this article will examine some of these potential problems.

Aliasing

Aliasing refers to the introduction of audio artifacts and distortions caused by improper audio sampling and reconstruction. It occurs when the sampling rate is insufficient to accurately capture the original analog audio waveform.

Resampling audio to a lower sample rate can easily cause aliasing. When downsampling, the higher frequencies in the original audio get “folded over” into lower frequencies. This results in unwanted artifacts and distortions.

Strategies to avoid aliasing from resampling include:

  • Applying an anti-aliasing filter before downsampling to remove high frequencies that could cause aliasing.
  • Choosing a modest downsampling amount, like 48 kHz to 44.1 kHz, instead of extreme downsampling.
  • Carefully listening and comparing the resampled audio to catch any aliasing.
  • Upsampling to a very high sample rate before final downsampling can also help.

Proper anti-aliasing is key for resampling. Light downsampling minimizes the chance of audible aliasing. Careful listening checks can confirm no unwanted artifacts are introduced.

Loss of High Frequencies

When audio is resampled to a lower sample rate, the new maximum frequency that can be represented is reduced. This means that any content above the new Nyquist frequency (half the new sample rate) will be lost. For example, resampling a 48 kHz file down to 44.1 kHz means that any frequencies above 22.05 kHz will be cut off.

As this DSP Stack Exchange thread explains, any high frequency content above the new Nyquist frequency is technically aliased down into the audible range. However, the result is effectively the same – the original ultrasonic content is lost. This can potentially remove high frequency harmonics, ambient details, and overall clarity from the audio.

When resampling audio, it is generally advised to low pass filter the audio before downsampling to attenuate any extreme high frequencies. This can help prevent harsh aliasing. However, any content above the new target sample rate will still be removed. There is no way to preserve the full bandwidth when downsampling audio.

Distortion

Downsampling can introduce distortion into the resampled audio if not done carefully. This distortion occurs because downsampling reduces the sample rate, which can introduce aliasing and cause information loss. Aliasing happens when frequencies above the new Nyquist frequency fold over into lower frequencies, resulting in nonlinear distortion and intermodulation.

To minimize distortion when downsampling:

  • Use a high quality sample rate converter with anti-aliasing filters to avoid aliasing. Good converters apply low pass filtering before downsampling to attenuate frequencies above the target Nyquist frequency.
  • Apply dithering to improve resolution and reduce quantization distortion when converting to a lower bit depth. Dithering adds low level noise to mask quantization error.
  • Use oversampling techniques. Oversample by a factor of 2-4x, then apply a sharp filter and downsample. This moves aliasing out of band.
  • Carefully choose the target sample rate to avoid excessive information loss. Higher sample rates have less distortion.

Proper anti-aliasing and dithering are key for clean downsampling. With careful resampling methods, distortion can be minimized.

Loss of Dynamics

Resampling audio can result in a reduction of dynamics, which are the variations in loudness that create a sense of movement and excitement in the music. This occurs because resampling takes an audio file and converts it to a new sample rate. In the process, the file’s volume levels may be adjusted to better fit the new sample rate, often via normalization or peak limiting. This can flatten out the natural dynamic variations 1.

To help preserve dynamics when resampling:

  • Avoid normalizing or peak limiting the file as part of the resampling process.
  • Use high-quality sample rate conversion algorithms that intelligently map volume levels to the new rate.
  • Resample while the audio file is at its native, unprocessed state to retain the original dynamics.
  • Adjust the target sample rate minimally to limit changes in volume mapping.
  • Compress the audio file gently prior to resampling to control peaks before sample rate conversion.

Artifacting

Artifacting refers to audible distortions or unwanted noises that are introduced into the audio signal during processing. Artifacting is commonly caused by aggressive audio compression or sample rate conversion procedures. When an audio file is resampled to a different sample rate, artifacts can occur for a few reasons:

One cause is aliasing, which happens when the original audio contains frequencies above the Nyquist frequency (half the new sample rate). These frequencies fold over into the audible range during resampling, introducing odd harmonic distortions.

Quantization error can also lead to artifacts, as the original waveform is approximated when converted to the new sample rate. This rounding of values introduces noise and distortion in the audio.

Other artifacts like crackling or clipping may occur if the bit depth is reduced during the conversion process. Going from 24-bit to 16-bit audio will increase the noise floor. Additionally, intersample peaks can cause clipping if dithering is not applied.

According to one analysis, “the up-sampling process will always change the signal in some measurable way. However, if it’s done properly the changes are often inaudible or negligible in real-world listening.” [1] Careful resampling with quality sample rate conversion algorithms can minimize audible artifacts.

Loss of Resolution

When audio is resampled to a lower sample rate, the bit depth is often reduced as well. This leads to a loss of resolution in the digital audio signal. According to Stack Exchange, reducing the bit depth introduces quantization distortion, which is heard as graininess or roughness in the audio. To minimize this, dithering should be applied before reducing bit depth. Dithering adds a small amount of noise to mask the distortion.

As explained on Hydrogenaud, dithering combined with noise shaping can eliminate rounding errors and quantization distortion when reducing bit depth. This helps retain as much quality as possible when going from a higher to lower bit depth. According to iZotope, higher bit depths allow reconstructing the analog waveform with more precision. So reducing bit depth loses some of that precision and resolution.

Stereo Imaging Issues

One common audio quality issue that can arise from improper resampling is distorted stereo imaging and loss of stereo width. Resampling a stereo audio file, especially at non-integer ratios, can alter the phase relationships between the left and right channels, causing them to become out of sync or distorted (Resampling stereo imaging problems forum). This can make the stereo field collapse, losing width and proper panning.

For example, downsampling a high sample rate stereo file like 192kHz down to 44.1kHz often requires non-integer resampling ratios. This can cause phase issues between channels, resulting in a thinner, mono-compatible sound rather than a wide stereo image. Stereo reverbs and delays may also lose their sense of space and depth when resampled. Careful resampling with high-quality sinc interpolation and dithering can help minimize stereo imaging distortions.

Experts recommend avoiding unnecessary resampling steps whenever possible, especially multiple resampling passes which exacerbate phase issues. If resampling is required for a workflow, using integer ratios between sample rates is ideal to preserve stereo imaging. Testing for audible phase cancellation and mono compatibility after resampling can also help diagnose and correct stereo width problems (https://www.reddit.com/r/audioengineering/comments/12uu68i/is_there_a_problem_with_resampling_24bit_to_32bit/).

Strategies for Avoiding Issues

There are some tips for resampling audio without degrading quality:

Use high sample rates – When resampling to a lower sample rate, start with the highest possible sample rate (96kHz or 192kHz) to minimize loss of high frequencies (according to this forum discussion). The higher the initial sample rate, the less information you will lose.

Avoid excessive resampling – Each time you resample, there is potential for quality loss. So try to do any sample rate conversions early in your workflow before you start layering and processing tracks.

Use high quality resampling algorithms – Not all resamplers are equal. Use a high quality resampling algorithm like SoX or iZotope RX to minimize artifacts and distortion.

Listen critically – There may be subtle changes to high frequencies, stereo imaging, transients etc. So use your ears to detect any undesirable effects, and tweak settings or try a different resampler if needed.

Compare with original file – When possible, compare with the unprocessed original audio to detect any quality loss or distortion introduced by resampling.

Consider end usage – If final output is a compressed format like MP3, quality differences from resampling may not be noticeable. But for high quality releases, stick to original or highest sample rates.

Conclusion

In summary, resampling audio can lead to several issues that degrade audio quality in different ways. The most common problems are:

  • Aliasing – false high frequencies caused by undersampling
  • Loss of high frequencies – reduced treble due to downsampling
  • Distortion – clipping, intermodulation distortion from sample rate conversion
  • Loss of dynamics – reduced dynamic range from quantization
  • Artifacting – clicks, pops, jitter from improper sample rate conversion
  • Loss of resolution – reduced bit depth from quantization
  • Stereo imaging issues – collapsed or unstable stereo field

Being aware of these potential issues can help audio engineers avoid or minimize audio degradation when resampling. Carefully choosing conversion settings, using high quality sample rate converters, and only resampling when necessary are good practices. With proper precautions, resampled audio can maintain excellent quality and transparency.

Leave a Reply

Your email address will not be published. Required fields are marked *