• 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?

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
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.
The catch is you can't shape the noise without making it. That is, you can't take a 24-bit audio file and turn it into a 24-bit file with the noise rearranged with noise shaping. You could turn it into a 16-bit file with noise shaping, but it will be noisier than the 24-bit original.

That is, noise shaping is done by processing the error, redistributing it spectrally. But if you're given a 24-bit file and the goal is to make a 24-bit file, you don't know what the error is for each sample—it's all just signal at that point. But if you're goal is to make a 16-bit file (or even a 23-bit file), the error for each sample is the difference between the 24-bit and the target quantization. You can shape that.

Upsampling cannot add more to the music, but can reduce the noise, if you keep the signal bandwidth the same when you upsample. That increases the SNR (signal to noise ratio).
Similar thing. Upsampling doesn't spread the noise, because the new samples have similar error to the original samples—because each sample has the same average error (± half lsb). Twice as many bits, the same error bounds, spread over twice the bandwidth—you're back to the same place. If you do something else, like quantize to a lower bit level, that noise would be spread out. But if you quantize to a lower bit level, you can do error shaping and there's not much point in upsampling.


Anyway, I mainly wanted to say that none of this matters at 24-bit. Whatever you recorded has far more noise. It does matter for 16-bit, where quantization noise can be the largest error component.

I want to say this because I'm certain a few people will read these things and conclude that they need to listen to higher sample rates for a better noise level. Just listen to 24-bit and there is nothing further to discuss. :)

NB—I'm not saying everyone needs to listen to 24-bit. I'm saying if you're concerned about things like dither and noise shaping and noise spread over a larger bandwidth, then going 24-bit is only 50% more data than 16-bit and completely eliminates having to fret about the math—you're guaranteed to be better than the electronics and your ears. Quite a bargain
 

solderdude

Grand Contributor
Joined
Jul 21, 2018
Messages
16,162
Likes
36,906
Location
The Neitherlands
It may be important to realize that the noise introduced by mic pre-amps, instruments etc. is usually higher than that of dither (even 16 bit dither).
Of course all digital recordings, test signals, and properly gated recordings might have a low enough noise floor in silent parts.

The only advantage upsampling could have is that one can have a sharper/better reconstruction/anti-imaging than the one that is supplied in most DACs when using 44.1kHz files.
Especially when using DACs that only have slow filters the technical performance (ripple, drop-off in the audible band, frequency extension) will improve when such a DAC receives a 2x or 4x higher sample rate. All those DACs will measurable perform better and have their crappy/incorrect own filter (at 44.1kHz) effectively replaced by a near-ideal reconstruction filter at 44.1kHz because the DACs own filter is now operating on 2x or 4x higher upper frequency moving the roll-off the DAC to a higher frequency.

The noise floor of a 24-bit file/DAC may be beneficial when using digital volume control and the analog amps following it fully open (at max. volume).
 

Julf

Major Contributor
Forum Donor
Joined
Mar 1, 2016
Messages
3,061
Likes
4,088
Location
Amsterdam, The Netherlands
Anyway, I mainly wanted to say that none of this matters at 24-bit. Whatever you recorded has far more noise. It does matter for 16-bit, where quantization noise can be the largest error component.
I would love to see examples of commercial recordings where that is the case - pretty much all the ones I have looked at have had a noise floor well above quantization noise levels.
 

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
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...
Linear interpolation is a really poor lowpass filter. It rolls off as the sinc function, it drops slowly to around -4 dB at Nyquist. (What we'd like, in general, is flat and a quick drop near Nyquist and -90 dB and more attenuation from there.) So, linear interpolation is only suitable for heavily oversampled signals. For instance, if you lowpass audio at 20k, and sample it at 192k, linear interpolation is pretty good, because the signal band is very low in the half-Fs band, and sitting under the high part of the central lobe of the sinc shape, before it has gained momentum on the down slope. Never completely flat, but in dB close enough for rock n roll.
 

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
I would love to see examples of commercial recordings where that is the case - pretty much all the ones I have looked at have had a noise floor well above quantization noise levels.
Please re-read what I wrote, I think you interpreted it backwards. I'll say it again:

At 24-bit, any recorded source material has far more noise than the 24-bit quantization contribution.

At 16-bit, the quantization noise can be the dominate noise.
 

danadam

Major Contributor
Joined
Jan 20, 2017
Messages
1,017
Likes
1,584
I would love to see examples of commercial recordings where that is the case - pretty much all the ones I have looked at have had a noise floor well above quantization noise levels.
Maybe this (just be careful with volume levels :)):
 

Julf

Major Contributor
Forum Donor
Joined
Mar 1, 2016
Messages
3,061
Likes
4,088
Location
Amsterdam, The Netherlands
Please re-read what I wrote, I think you interpreted it backwards. I'll say it again:

At 24-bit, any recorded source material has far more noise than the 24-bit quantization contribution.

At 16-bit, the quantization noise can be the dominate noise.
My mistake, I should have written "a noise floor well above 16-bit quantization noise levels."
 

Julf

Major Contributor
Forum Donor
Joined
Mar 1, 2016
Messages
3,061
Likes
4,088
Location
Amsterdam, The Netherlands
Maybe this (just be careful with volume levels :)):
Ah, yes. BiS has some really excellent recordings. Oh I miss the contributions from @j_j .
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
Linear interpolation is a really poor lowpass filter. It rolls off as the sinc function, it drops slowly to around -4 dB at Nyquist. (What we'd like, in general, is flat and a quick drop near Nyquist and -90 dB and more attenuation from there.) So, linear interpolation is only suitable for heavily oversampled signals. For instance, if you lowpass audio at 20k, and sample it at 192k, linear interpolation is pretty good, because the signal band is very low in the half-Fs band, and sitting under the high part of the central lobe of the sinc shape, before it has gained momentum on the down slope. Never completely flat, but in dB close enough for rock n roll.
Yes, I am well aware of that, and referenced it in my post. It was just a simple thing to do as an example. Any sort of actual reduction depends heavily on your (the) ability to predict the signal from lower-resolution samples. And none of this more esoteric discussion matters much in the audio world (or most others, for that matter).

As an aside (I know you know this): I do distinguish upsampling, which converts from a lower sampling rate to a higher rate, from oversampling that samples the signal at a rate well above that required for the desired signal bandwidth. Yin and yang.
 
Last edited:

Count Dacula

Active Member
Joined
May 24, 2023
Messages
126
Likes
65
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.
That's what I am saying. Even though they are two completely different approaches and domains, the data process flows in a similar manner. Of course people here understand the differences. My examples are both AC electronic schemes that accomplish a similar task, quite distinct from the physical "filtering" through a porous media of coffee solids. Perhaps "filtering" is too general of a term.

Comparing and contrasting D and A is something that's done here, right? I think mine is a good analogy.
 

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
20,954
Likes
38,087
That's what I am saying. Even though they are two completely different approaches and domains, the data process flows in a similar manner. Of course people here understand the differences. My examples are both AC electronic schemes that accomplish a similar task, quite distinct from the physical "filtering" through a porous media of coffee solids. Perhaps "filtering" is too general of a term.

Comparing and contrasting D and A is something that's done here, right? I think mine is a good analogy.
No it is not analogous at all. So trying to force fit the idea would at best confuse thinking about either one.
 

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
Yes, I am well aware of that, and referenced it in my post. It was just a simple thing to do as an example. Any sort of actual reduction depends heavily on your (the) ability to predict the signal from lower-resolution samples. And none of this more esoteric discussion matters much in the audio world (or most others, for that matter).

As an aside (I know you know this): I do distinguish upsampling, which converts from a lower sampling rate to a higher rate, from oversampling that samples the signal at a rate well above that required for the desired signal bandwidth. Yin and yang.
OK, not to be picky, but to explain why I responded, your post I quoted said,

"At least that's the way it worked in our radar system; maybe audio is different..."

So I was explaining the specific audio details. ;)
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
OK, not to be picky, but to explain why I responded, your post I quoted said,

"At least that's the way it worked in our radar system; maybe audio is different..."

So I was explaining the specific audio details. ;)
OK, sometimes my dry humor does not translate well. IME/IMO the biggest difference (other than frequency) is that radar systems utilize pulse trains, which can be buried in noise, whilst audio usually has much "busier" signals more akin to spread-spectrum communication signals than to radar.
 

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
OK, sometimes my dry humor does not translate well. IME/IMO the biggest difference (other than frequency) is that radar systems utilize pulse trains, which can be buried in noise, whilst audio usually has much "busier" signals more akin to spread-spectrum communication signals than to radar.
See, that's what I like to hear. I've had exchanges with guys who know digital audio, but who haven't worked with "real signals", and despite being good DSP people, they absolutely bristle at the thought that anything resembling an impulse is involved. Because they learned "impulses do not exist". (Like, ideal impulses don't exist in the real work, so to them impulses do not exist in the real work, therefore digital audio has nothing to do with impulses.) Really annoying.
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
See, that's what I like to hear. I've had exchanges with guys who know digital audio, but who haven't worked with "real signals", and despite being good DSP people, they absolutely bristle at the thought that anything resembling an impulse is involved. Because they learned "impulses do not exist". (Like, ideal impulses don't exist in the real work, so to them impulses do not exist in the real work, therefore digital audio has nothing to do with impulses.) Really annoying.
Ideal impulses do not, but lots of applications generate things that are pretty durn close for practical purposes. The signal off a hard disc drive (spinner) is not pretty, but looks impulse'ish after a few stages of amplification and EQ. Signals off memory (xRAM), SONAR/LIDAR/ultrasound, etc. Gad, it feels like I've worked on everything at some point in my career...
 

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
Ideal impulses do not, but lots of applications generate things that are pretty durn close for practical purposes. The signal off a hard disc drive (spinner) is not pretty, but looks impulse'ish after a few stages of amplification and EQ. Signals off memory (xRAM), SONAR/LIDAR/ultrasound, etc. Gad, it feels like I've worked on everything at some point in my career...
Yes. I'll give a little more concrete example, related to digital audio. I think that understanding that each sample represents an ideal impulse, mathematically, clears up a lot of questions about digital audio processing. It makes understanding sample rate conversion trivial for example (to most who understand how SRC works, it's a cookbook recipe, they don't actually understand why. So they are often not sure of what happens when optimizing filtering for multi-rate conversions, etc.).

But I've found that if I point that out to someone, particularly if they're more of a software engineer type than electrical engineer, they'll immediately say impulses don't exist in the real world, and shut down the discussion.

Yet, what's the problem with ideal impulses? Oh yeah, it's infinite harmonics (and energy). But, if we we wanted to replicate it in the real world, what's the drawback of having a band limit on the impulses? Um, the "images" of the signal band won't go to infinity. Yeah, the images that we have to filter out with the so called "reconstruction filter".

In other words, there is no practical downside to the fact ideal impulses don't exist. Impulses that we can make easily work just fine. We could do high-quality analog sampling, it just doesn't make sense because digital storage and digital computations are a lot cheaper and more reliable than their analog counterparts. And it doesn't take away from the fact that we only stored a stream singular instances—samples—in digital memory therefore they are ideal at that point, we idealized them by tossing away all but those moments in time.

Well, that was a sidebar, wasn't it. ;)

PS—Nyquist's work involved figuring out the rate of pulses could be resolved over a communication channel of given bandwidth. The answer was, of course, that the bandwidth had to be greater than twice the pulse rate.
 
Last edited:

Peterinvan

Senior Member
Joined
Dec 10, 2021
Messages
311
Likes
243
Location
Canada
I had to ask ChatGPT:

what is the purpose of an anti-aliasing filter in music reproduction?


"An anti-aliasing filter is crucial in music reproduction to prevent aliasing artifacts. When converting analog audio signals into digital format (as in CDs or digital audio files), the process involves sampling the analog signal at discrete intervals. If the analog signal contains frequencies higher than half the sampling rate (the Nyquist frequency), these frequencies can alias or fold back into the audible range, causing distortion and unwanted artifacts.
The purpose of the anti-aliasing filter is to remove or attenuate frequencies above the Nyquist frequency before the sampling process occurs. By doing so, it ensures that only the desired audio frequencies are captured accurately during the sampling process, preserving the fidelity and quality of the reproduced sound. Without an anti-aliasing filter, aliasing artifacts such as aliasing distortion and noise can degrade the audio quality and fidelity of the reproduction

"Most people cannot hear frequencies significantly above the Nyquist frequency. However, the presence of frequencies above the Nyquist frequency can still affect the audio signal due to aliasing artifacts.
Even though these high frequencies might not be directly audible, they can cause distortion and other undesirable effects when folded back into the audible range during the sampling process. These artifacts can manifest as unwanted noise, changes in timbre, and other forms of distortion that can degrade the overall audio quality.
Therefore, while the average person may not perceive frequencies above the Nyquist frequency directly, the presence of anti-aliasing filters is still essential to ensure high-quality audio reproduction by preventing aliasing artifacts from impacting the sound
."
 

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,949
Likes
16,818
Location
Monument, CO
I had to ask ChatGPT:

what is the purpose of an anti-aliasing filter in music reproduction?


"An anti-aliasing filter is crucial in music reproduction to prevent aliasing artifacts. When converting analog audio signals into digital format (as in CDs or digital audio files), the process involves sampling the analog signal at discrete intervals. If the analog signal contains frequencies higher than half the sampling rate (the Nyquist frequency), these frequencies can alias or fold back into the audible range, causing distortion and unwanted artifacts.
The purpose of the anti-aliasing filter is to remove or attenuate frequencies above the Nyquist frequency before the sampling process occurs. By doing so, it ensures that only the desired audio frequencies are captured accurately during the sampling process, preserving the fidelity and quality of the reproduced sound. Without an anti-aliasing filter, aliasing artifacts such as aliasing distortion and noise can degrade the audio quality and fidelity of the reproduction

"Most people cannot hear frequencies significantly above the Nyquist frequency. However, the presence of frequencies above the Nyquist frequency can still affect the audio signal due to aliasing artifacts.
Even though these high frequencies might not be directly audible, they can cause distortion and other undesirable effects when folded back into the audible range during the sampling process. These artifacts can manifest as unwanted noise, changes in timbre, and other forms of distortion that can degrade the overall audio quality.
Therefore, while the average person may not perceive frequencies above the Nyquist frequency directly, the presence of anti-aliasing filters is still essential to ensure high-quality audio reproduction by preventing aliasing artifacts from impacting the sound
."
Seems reasonable. The anti-aliasing filter is before the ADC that converts the music to digital. Aliased signals fold from higher frequencies back into the base (audio) band and cannot be (practically) removed once they get in there. After a DAC is an (anti-)imaging filter that prevents images above the audio band from being applied to your amp and speakers.

There are several articles in ASR's technical section covering these, including several articles found in the list of articles listed in my signature below.

HTH - Don
 

earlevel

Addicted to Fun and Learning
Joined
Nov 18, 2020
Messages
569
Likes
793
I had to ask ChatGPT:

what is the purpose of an anti-aliasing filter in music reproduction?


"An anti-aliasing filter is crucial in music reproduction to prevent aliasing artifacts. When converting analog audio signals into digital format (as in CDs or digital audio files), the process involves sampling the analog signal at discrete intervals. If the analog signal contains frequencies higher than half the sampling rate (the Nyquist frequency), these frequencies can alias or fold back into the audible range, causing distortion and unwanted artifacts.
The purpose of the anti-aliasing filter is to remove or attenuate frequencies above the Nyquist frequency before the sampling process occurs. By doing so, it ensures that only the desired audio frequencies are captured accurately during the sampling process, preserving the fidelity and quality of the reproduced sound. Without an anti-aliasing filter, aliasing artifacts such as aliasing distortion and noise can degrade the audio quality and fidelity of the reproduction

"Most people cannot hear frequencies significantly above the Nyquist frequency. However, the presence of frequencies above the Nyquist frequency can still affect the audio signal due to aliasing artifacts.
Even though these high frequencies might not be directly audible, they can cause distortion and other undesirable effects when folded back into the audible range during the sampling process. These artifacts can manifest as unwanted noise, changes in timbre, and other forms of distortion that can degrade the overall audio quality.
Therefore, while the average person may not perceive frequencies above the Nyquist frequency directly, the presence of anti-aliasing filters is still essential to ensure high-quality audio reproduction by preventing aliasing artifacts from impacting the sound
."
Be careful with these kind of questions. ChatGPT only know what other people have said. You could search for an article on the topic and find two. Maybe both sound reasonable, maybe one guy seems to understand it better. Either way, if you don't already know, you'll just have to assume that one or both are right.

ChatGPT pretty much gives you and composite of what people have said, and information available. For relatively simple things, it's as good of a source as any, the outliers have been weeded out.

As you get more specific, fewer of the total patches of information will be perfectly correct, because it will come from sources that almost understand the issues. And fewer of the patches of information will be from the few people who truly understand the subject.

You'll see this most easily if you pick a topic that you know better than 99.9999% of people. Then you'll see that ChatGPT is just spitting out what the average semi-expert level understands. (That may seem like an unrealistic number of nines, but consider picking a subject where one in a thousand people could really say anything about it at all. Then consider out of those people, being one in a thousand that had a deep understanding. There you are, one in a million, on a planet with 8 billion.)

It will get better, to the point where it will seem it's the top expert in most things. So we'll get comfortable in listening to it over anyone. To the point where if the one person who really knows the truth about something critical, we won't listen to them because of how unlikely that the AI is wrong, compare to the likelihood of the person being wrong. And if he's persistent, maybe we'll have to lock him up in the loony bin. :p

FWIW, the ChatGPT description is not wrong. Though it's the typical vague flowery description an arbitrary person might give. Seems pretty wordy compared to the actual point it makes. Reminds me of ChatGPT answering my friend's query, "An orchestra of 100 musicians can play a symphony in one hour. How long would it take an orchestra of 200 musicians?" It used three exquisitely worded paragraphs to say 30 minutes. :facepalm:
 
Top Bottom