• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

What is the point of upsampling?

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
It doesn't. Once the noise is embedded in the data, there is no way of separating it from the signal - any more than you could reduce tape hiss from a digital recording from a tape.

There was a demo by @danadam in another thread. Hang on...

...here it is:
https://audiosciencereview.com/foru...4-1-collection-a-good-idea.53641/post-1954662
"Upsampling" means different things to different folks. If all you do is increase the sampling rate then the original noise floor remains. If the upsampler includes interpolation, oversampling, and noise modulation then the quantization noise floor can be reduced, by effectively increasing the resolution (so arguably more than purely upsampling).
 

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
2,849
Likes
6,390
Location
Berlin, Germany
Upsampling" means different things to different folks. If all you do is increase the sampling rate then the original noise floor remains. If the upsampler includes interpolation, oversampling, and noise modulation then the quantization noise floor can be reduced.
The point is, while a correct statement, it applies to the process of upsampling proper. But the quantization noise baked into the source stream it cannot reduce, only preserve as good as possible, because it is "the signal". And this source quantization noise, like when from a 16bit CD source, is dominating the noise theater.
 

terryforsythe

Addicted to Fun and Learning
Forum Donor
Joined
May 4, 2022
Messages
557
Likes
606
But the quantization noise baked into the source stream it cannot reduce
DonH56 is correct. That is why dithering is used. If properly implemented, dithering spreads the quantization noise over a wider frequency spectrum, and then the higher inaudible frequencies are filtered out, which effectively reduces quantization noise. And yes, dithering can be implemented entirely in the digital domain after the music already is quantized. Some DACs are able do this. It is analogous to applying dithering to a digital image to sharpen the image.
 

AnalogSteph

Major Contributor
Joined
Nov 6, 2018
Messages
3,423
Likes
3,382
Location
.de
And yes, dithering can be implemented entirely in the digital domain after the music already is quantized. Some DACs are able do this.
I would even argue that there aren't a lot of them that don't, as dithering with noise shaping is an integral part of virtually every DAC design these days.
It is analogous to applying dithering to a digital image to sharpen the image.
You can sharpen an image at the expense of increased noise, but that's basically just the equivalent of cranking up the treble. Improved definition but more hiss, as you'd expect.

Either way, the point of @KSTR et.al. was that your output can never become better than the source material. You can keep added noise to an absolute minimum (and at the current performance level of audio DACs that's generally the case these days), but that's your limit: A perfect reconstruction. I thought that would be so obvious as to not even be worth discussing.
 

Bebelalu55

New Member
Joined
May 7, 2024
Messages
2
Likes
1
Location
France
Thank you all for your contributions and to DonH56 for his explanations and graphs.

So I was wrong assuming that the potential benefit of oversampling is to move the filter higher (or use a gentler slope) and reduce its impact on the audible spectrum?
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
Thank you all for your contributions and to DonH56 for his explanations and graphs.

So I was wrong assuming that the potential benefit of oversampling is to move the filter higher (or use a gentler slope) and reduce its impact on the audible spectrum?
Assuming we are talking DACs and not ADCs, oversampling allows you to move up the corner frequency of the anti-image filter, and it can be lower in order, but the primary filter in most DACs is implemented in the digital domain so there is no audible advantage to oversampling. You can implement very high order digital filters without significantly (or hardly at all) affecting the audio band.

The output filter was more an issue when it was purely a high-order analog filter and before oversampling delta-sigma DACs became the norm for audio reproduction. Even then, studies were done showing the impact was less than people claimed, natch. Even when it imposed significant phase shift in the upper octave (10~20 kHz), it was the same for both (or all) channels, and people did not hear it AFAIK. Not something I studied much, however; by that time (mid-1980's) my career had taken a different path. Still data converters, but higher in frequency, and more demanding of pulse integrity.

On the rest of the debate, I have worked with systems that increased effective resolution and reduced quantization noise during upsampling by various interpolation and/or modulation schemes, but that is well beyond answering a relatively simple question and some do consider that part of the "process" vs. just purely oversampling. I tend to think of oversampling as just increasing the sampling rate, while upsampling includes additional processing that can also increase the bit depth. I was not thinking of dither, but have also used colored (band-limited) noise (dither) effectively, again to reduce in-band quantization noise at the cost of higher noise outside the band of interest.
 
Last edited:

antcollinet

Master Contributor
Forum Donor
Joined
Sep 4, 2021
Messages
7,971
Likes
13,523
Location
UK/Cheshire
"Upsampling" means different things to different folks. If all you do is increase the sampling rate then the original noise floor remains. If the upsampler includes interpolation, oversampling, and noise modulation then the quantization noise floor can be reduced, by effectively increasing the resolution (so arguably more than purely upsampling).
Still doesn't work. Resolution is increased, but the original noise floor is copied into the higher resolution - it is part of the signal and indistinguishable from it, and the upsampling cant attenuate the noise that has already been added, separately from the signal.

It is like I said previously - if any other type of noise had been added to the signal, eg tape hiss, you wouldn't expect upsampling to be able to reduce it. Quantisation noise once it has been added (Ie once a signal has been quantised) is no different. It cannot be removed or attenuated. It is indistinguishable in the signal from any other sort of noise.

Look at it another way - play a CD into a DAC. The DAC is a sigma delta type so it upsamples and up rezzes to fit the capability of the DAC output. But you don't get better than 16 bit noise floor on the output. You can't. That noise is baked into the input digital data.
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
Still doesn't work. Resolution is increased, but the original noise floor is copied into the higher resolution - it is part of the signal and indistinguishable from it, and the upsampling cant attenuate the noise that has already been added, separately from the signal.

It is like I said previously - if any other type of noise had been added to the signal, eg tape hiss, you wouldn't expect upsampling to be able to reduce it. Quantisation noise once it has been added (Ie once a signal has been quantised) is no different. It cannot be removed or attenuated. It is indistinguishable in the signal from any other sort of noise.

Look at it another way - play a CD into a DAC. The DAC is a sigma delta type so it upsamples and up rezzes to fit the capability of the DAC output. But you don't get better than 16 bit noise floor on the output. You can't. That noise is baked into the input digital data.
The recorded analog noise floor passes through, but quantization noise whilst still in the digital domain can be modified -- digitally -- before the final conversion back to analog. To reduce the quantization noise, the digital data must be manipulated, which may (or may not) be part of the "upsampling" process. The usual example is simple linear interpolation, adding points between the original samples in both amplitude and time, so the effective quantization error is reduced and spread over a wider frequency band. At least that's the way it worked in our radar system; maybe audio is different...
 

antcollinet

Master Contributor
Forum Donor
Joined
Sep 4, 2021
Messages
7,971
Likes
13,523
Location
UK/Cheshire
but quantization noise whilst still in the digital domain can be modified -- digitally -- before the final conversion back to analog
No, it can't. Once quantisation has taken place the noise is irrevocably baked into the digital signal. Still, we are not going to get anywhere by simply contradicting.

If you are motivated, I suggest you take a 16 bit digital file, measure the noise floor (I think delta-wave will do this for you? Then try and find ANY upsampling method that will reduce that noise floor.

You wont find anything that gets it below the -96dB or so of 16 bit audio.

I'll leave it there.
 
Last edited:

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
20,955
Likes
38,090
I think what DonH56 is saying, is yes upsampling can reduce quantization noise. If you have noise above quantization noise in the original file, then yes it will still be there. However, the part due to quantization will be less if upsampled properly. Maybe it is covered by other noise, like a digital file of an analog tape, but the quantization caused noise will be lowered. Even without upsampling, you can save digital files with different dither levels like shaped dither which can alter noise floors caused by the quantization errors.

With shaped dither you can create and recover signals below -96 db FS with 16 bits. How far below will depend upon how the dither is done or how much upsampling you do.
 
Last edited:

danadam

Major Contributor
Joined
Jan 20, 2017
Messages
1,017
Likes
1,584
"Upsampling" means different things to different folks.
To clarify, the example shows the effect of SoX's "rate" command, which AFAIK is more or less equivalent to 3 more basic steps/commands:
  • upsample N - insert zero samples between existing samples
  • sinc -Fs_old/2 - low-pass at the half of the original sampling frequency
  • vol N - apply make-up gain
I'm sure you and many others know that already but for those who don't, each step is illustrated here:
View attachment 323636
(originally from this post)

I won't argue if that's upsampling, oversampling or whatever other meaning it can have.

I'll admit I thought that's kind of equivalent to what oversampling DACs are doing as the first step but I'm not DAC constructor, so I won't argue that either.

DonH56 is correct. That is why dithering is used. If properly implemented, dithering spreads the quantization noise over a wider frequency spectrum
The way I understand things so far is that it will spread the noise of the re-quantization you are about to do, not the quantization that was already done.

In any case and FWIW the DACs I tested don't seem to reduce the existing quantization noise:
  • I played 30 seconds of 1 kHz at 8/44k on Tanchjim Space, Dragonfly Red and ADI-2 Pro FS R BE
  • captured them with ADI-2 Pro FS R BE at 32/44k
  • normalized the files to -0.1 dBFS
and here's their frequency magnitude spectrum (including the input file):
8-bit-noise.png

and zoom:
8-bit-noise.zoom.png


And in case someone complains, the same captured at 32/352k but only for Tanchjim Space and Dragonfly Red:
8-bit-noise.x4.png

8-bit-noise.zoom.x4.png

I can't do that for ADI-2 because I can't play and record at different sampling rates at the same time.
 

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
20,955
Likes
38,090
To clarify, the example shows the effect of SoX's "rate" command, which AFAIK is more or less equivalent to 3 more basic steps/commands:
  • upsample N - insert zero samples between existing samples
  • sinc -Fs_old/2 - low-pass at the half of the original sampling frequency
  • vol N - apply make-up gain
I'm sure you and many others know that already but for those who don't, each step is illustrated here:
View attachment 323636
(originally from this post)

I won't argue if that's upsampling, oversampling or whatever other meaning it can have.

I'll admit I thought that's kind of equivalent to what oversampling DACs are doing as the first step but I'm not DAC constructor, so I won't argue that either.


The way I understand things so far is that it will spread the noise of the re-quantization you are about to do, not the quantization that was already done.

In any case and FWIW the DACs I tested don't seem to reduce the existing quantization noise:
  • I played 30 seconds of 1 kHz at 8/44k on Tanchjim Space, Dragonfly Red and ADI-2 Pro FS R BE
  • captured them with ADI-2 Pro FS R BE at 32/44k
  • normalized the files to -0.1 dBFS
and here's their frequency magnitude spectrum (including the input file):
View attachment 368288
and zoom:
View attachment 368289

And in case someone complains, the same captured at 32/352k but only for Tanchjim Space and Dragonfly Red:
View attachment 368290
View attachment 368291
I can't do that for ADI-2 because I can't play and record at different sampling rates at the same time.
Why is your noise floor so high? It should be much lower than that.
 

danadam

Major Contributor
Joined
Jan 20, 2017
Messages
1,017
Likes
1,584
Why is your noise floor so high? It should be much lower than that.
The input is 8-bit file.

I'll add that I feel pretty weird doing that, because for sure I must have misunderstood what others are trying to say (and I'm sorry if I do). But well, whichever way I look at it, that's how I understand their message, that existing quantization noise (8-bit in this case) could somehow be reduced.
 
Last edited:

danadam

Major Contributor
Joined
Jan 20, 2017
Messages
1,017
Likes
1,584
I tried linear interpolation of new samples between original samples:
samples.png

and the spectrum is:
fft.png
 

Count Dacula

Active Member
Joined
May 24, 2023
Messages
128
Likes
68
Correct if I am wrong, but it seems like RIAA correction is a sort of analog "resampling" for vinyl.
 

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
20,955
Likes
38,090
Correct if I am wrong, but it seems like RIAA correction is a sort of analog "resampling" for vinyl.
No, not at all.


The curve reduces bass and increases treble when put onto the disc so that more music can fit on the disc and to get treble frequencies out of the noise floor of an LP. Upon playback the reverse EQ is done to bring the bass back up to level and reduce the noise of vinyl and the boosted treble. It improves the quality of the music vs not doing so. It is nothing like resampling.
 

Chrispy

Master Contributor
Forum Donor
Joined
Feb 7, 2020
Messages
8,031
Likes
6,171
Location
PNW
TL;DR From what I've seen on the subject it creates a possible "difference" to bitch and moan about but in actual practice no more useful than most audiophilia :)
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
I had to dig for something I could use, my old files are either gone (stayed with the company when I left) or use a math program I have not updated (need to port my old Mathcad files into Matlab or Python). I used 12-bit data sampled at 48 kS/s for a baseline, then oversampled to 96 kS/s with the samples just duplicated (e.g. 0,1,2... became 0,0,1,1,2,2...), then finally oversampled and did a linear interpolation of the amplitude. Unfortunately, I started from my "cascaded noise and distortion" program, and did not zero out all the distortion terms (though they are pretty low), so the baseline SNR/SINAD is a little low for an ideal 12-bit converter (THD should be at the numerical noise floor, around -110 to -120 dB for these runs). Upsampling does nothing for THD, natch. I applied a 40-tap, 21 kHz FIR filter to all the runs to reduce out-of-band noise. The input source Vsrc and DAC output voltage Vdac are set to 1 V for convenience; internal DAC values are scaled (normalized) to 1 Vpk full-scale output.

I am not sure why oversampling alone improved the SNR slightly. I suspect an artifact of FFT binning since I did not recenter the frequency when I upsampled so some distortion and noise terms got intermingled in the FFTs before I extracted THD and SNR (got tired of fiddling with the program, not my area of expertise). All I did at first was duplicate the samples so e.g. (0,1,2...) became (0,0,1,1,2,2,...) when oversampled (I sampled the same number twice). The oversampled and interpolated version (e.g. quantized to 0, 0.5, 1.0, 1.5... effectively providing 13-bit resolution) shows about 3 dB improvement, which is what I expected from my prior life. Simple interpolation does not provide a "true" 13 bits so 3 dB is reasonable. The science whizzes used some pretty hairy schemes (sinusoidal or polynomial interpolators and such) to improve things a little more but I don't recall getting much more improvement. Unless you know the signal characteristics very well any sort of interpolation has errors (and in some cases provided worse results). Dither helped a bit more; we used colored dither applied outside the band of interest (that was for radar and satcom stuff, not audio). There is no dither in these runs. The radar systems had anywhere from 120 to 160 dB total dynamic range along the chain (with a whole lot of fancy processing) and we scrapped for every last dB.

1715143579958.png


None of this matters for audio IMO; unless it does something wrong, upsampling in any form is unlikely to have any impact on the sound.
 

Count Dacula

Active Member
Joined
May 24, 2023
Messages
128
Likes
68
No, not at all.


The curve reduces bass and increases treble when put onto the disc so that more music can fit on the disc and to get treble frequencies out of the noise floor of an LP. Upon playback the reverse EQ is done to bring the bass back up to level and reduce the noise of vinyl and the boosted treble. It improves the quality of the music vs not doing so. It is nothing like resampling.


Just like the digital upsampled frequency being more effectively filtered, then normalized at playback, the RIAA does the reverse in "compressing" the levels with a filter, later reconstructed at playback...
 

voodooless

Grand Contributor
Forum Donor
Joined
Jun 16, 2020
Messages
10,524
Likes
18,586
Location
Netherlands
Just like the digital upsampled frequency being more effectively filtered, then normalized at playback, the RIAA does the reverse in "compressing" the levels with a filter, later reconstructed at playback...
Many things use filters. If you make coffee, the water goes through a filter as well, that doesn’t make it a reconstruction filter ;) yes, RIAA “reconstructs” the original waveform, but it’s simply an equalization filter. It’s a completely different concept.
 
Top Bottom