Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Upsampling audio before D-A conversion (Read 16590 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Upsampling audio before D-A conversion

Hi,

(I'm a total newbie to audio, so please  bear with me)

I output the audio from my laptop through a Roland Cakewalk UA-1G USB Audio Interface with adjustable sampling rate. Right now, I've set it to play at 96kHz, and I upsample my audio (mostly 41kHz 320kbps CBR MP3) to 96kHz using otachan's ASIO output plugin for Winamp (in Top quality mode). But if my source is only 41kHz, does upsampling in the digital stage really have any benefits? Audiophiles claim it does, but it seems to me that if the original signal contains only a certain number of samples, any loss of information content has already occurred, and artificially introducing new samples cannot recover that information. In fact, it seems to me that any upsampling algorithm has the potential to introduce its own artifacts. I've been wondering whether the occasional popping I'm hearing on my M-Audio AV40s is due to this. What's the actual scenario? Thanks.

Molu

Upsampling audio before D-A conversion

Reply #1
The resampling in, say, fb2k, is measurably better than the upsampling / oversampling / reconstruction filtering in even a good digital to analogue converter, never mind in a laptop sound card.

Whether you can hear the difference is another matter.

Cheers,
David.

Upsampling audio before D-A conversion

Reply #2
But if my source is only 41kHz, does upsampling in the digital stage really have any benefits?


No.

At the very most, you would need more information to have better sound. Upsampling creates no new information, it just spreads the old information over more space in the digital domain. In short, it is wasteful. The good news is that we have space in the digital domain to waste without many really bad things happening, usually.

Note that I said "at the very most". What I mean by this is that even if you somehow obtained more information, there's still no guarantee of better sound. Case in point would be the MP3s that you play. Just because they have far less information in them than the  uncompressed files they were (hopefully) made from is still no guarantee of significantly better sound from the larger file.

Quote
Audiophiles claim it does,


Some audiophiles claim the darndest things. But, truth is not up for proof by assertion, proof by (questionable) authority, or a popularity vote.

Quote
but it seems to me that if the original signal contains only a certain number of samples, any loss of information content has already occurred, and artificially introducing new samples cannot recover that information.


Hold that thought! ;-)

Quote
In fact, it seems to me that any upsampling algorithm has the potential to introduce its own artifacts.


Indeed they do.

I see romance in simplifying whereever possible. If upsampling has no audible benefits, then don't do it. If you do it, do it carefully.

Quote
I've been wondering whether the occasional popping I'm hearing on my M-Audio AV40s is due to this. What's the actual scenario? Thanks.


Increasing the amount of data by upsampling puts more stress on your storage and data transfer paths. It can make latent problems into PITAs.  Popping usually represents data loss.  Reducing the amount of data being transferred can ease stress on any weaker components in the system.

Upsampling audio before D-A conversion

Reply #3
I have a similar question, hopefully it's not OT for the original poster. It's also about the usefulness of upsampling but in a bit different scenario.

The card I use for my laptop (Asus Xonar U1) seems to be capable only of 48kHz. It seems that after the audio goes through Windows Vista mixer (or Win 7 in my case) the driver resamples whatever it's fed to whatever option there is in the Xonar dedicated control panel (only 48kHz in this case). I have not way to make sure of this 100% though, but let's assume it does for the sake of argument.

The options I have in the Vista panel for that playback device give me options up to 96kHz I believe. When I'm playing music, what I believe is happening is that sound comes from the player (foobar2000 no DSP active) at 44.1kHz, then the Vista mixer upsamples to whatever it's set (up to 96kHz or whatever) and then the driver resamples whatever it's fed to 48kHz. I'm probably not using the term "driver" here technically correctly, but I don't know what else to call whatever goes after the Windows mixer.

So, is it reasonable to assume that to minimize artifacts one could upsample 44.1 to 96 or 192, so then it can be resampled to 48kHz peacefully?

Upsampling audio before D-A conversion

Reply #4
Just resample it for playpack to your supported samplerate of 48kHz, and windows won't tuch it anymore.

Upsampling audio before D-A conversion

Reply #5
Just resample it for playpack to your supported samplerate of 48kHz, and windows won't tuch it anymore.

My question is actually that for very slight upsampling like 44.1 to 48, it might be better to upsample to a much higher rate (multiples of 48 seem ideal), and then resampling to the smaller one. At least in digital photography, which is a good analogy IMO (been discussed elsewhere), upsampling then downsampling can yield better results. I'm just wondering if that way one could get less artifacts, if artifacts exist in the first place.

Upsampling audio before D-A conversion

Reply #6
I see romance in simplifying whereever possible. If upsampling has no audible benefits, then don't do it.
Given that no DAC on the market today (or in the last decade) actually works at the native sample rate of the content, the audio will be upsampled (=oversampled=resampled) somewhere. The questions are where, how well, and in how many stages.

There's nothing good about the "simple" approach of leaving it to the DAC itself. It might be good enough, but it's certainly not the best that can be done in terms of doing the job properly.

Quote
Increasing the amount of data by upsampling puts more stress on your storage and data transfer paths. It can make latent problems into PITAs.  Popping usually represents data loss.  Reducing the amount of data being transferred can ease stress on any weaker components in the system.
Oh please - this is the 21st century - people use their PCs to play HD video. The data rate of 2-channel 24/96 audio is a non-issue - or if it is a problem, your PC is probably useless for almost anything else "normal" people do with PCs these days.

Cheers,
David.


Upsampling audio before D-A conversion

Reply #7
My question is actually that for very slight upsampling like 44.1 to 48, it might be better to upsample to a much higher rate (multiples of 48 seem ideal), and then resampling to the smaller one. At least in digital photography, which is a good analogy IMO (been discussed elsewhere), upsampling then downsampling can yield better results. I'm just wondering if that way one could get less artifacts, if artifacts exist in the first place.
Whatever useful benefit you gain from doing resampling in two stages can also be achieved by doing it properly in one stage. Audio or photos!

Of course, the tools may not be available to do it properly, so a two stage process may be a quick fix - but that's all it is - there's no magic.

Cheers,
David.


Upsampling audio before D-A conversion

Reply #8
Whatever useful benefit you gain from doing resampling in two stages can also be achieved by doing it properly in one stage. Audio or photos!

Of course, the tools may not be available to do it properly, so a two stage process may be a quick fix - but that's all it is - there's no magic.

I can only speak about digital photography, I'll trust people's comments on audio here. So actually, in certain conditions (like low-enough resolution pictures), upsampling to slightly higher pixel dimensions (the photoshop way of saying "number of pixels") can bring up artifacts like aliasing, especially if the algorithm is not up to snuff. In this case, you can do better to upsample to much higher pixel dimensions (particularly multiples of the final pixel dimensions) and have a smoother picture.

Upsampling audio before D-A conversion

Reply #9
The resampling in, say, fb2k, is measurably better than the upsampling / oversampling / reconstruction filtering in even a good digital to analogue converter, never mind in a laptop sound card.

Whether you can hear the difference is another matter.

Cheers,
David.


I'm not comparing between resampling on the card or on software. The UA-1G USB Interface (not a laptop sound card) does not even claim to provide usable resampling capabilities, it asks for input at the same sample rate as that set on it. So the choice is between setting it to play at 44.1kHz and outputting my audio without any resampling, or setting it to play at 96kHz and resampling on the software. Should I be upsampling at all?

What Arnold says supports my common sense, but andy raises the point that made me think that there may be some sense to upsampling: aliasing. I've heard that D/A conversion stage has the potential to introduce aliasing artifacts. Will being fed with a higher sample rate signal allow the DAC to minimize aliasing artifacts? I realize that this will likely depend on the details of the filters used in the particular DAC, but is there any general trend with the DAC-s normally available on such low/mid range equipment?

Thanks.

Molu

Upsampling audio before D-A conversion

Reply #10
Whatever useful benefit you gain from doing resampling in two stages can also be achieved by doing it properly in one stage. Audio or photos!

Of course, the tools may not be available to do it properly, so a two stage process may be a quick fix - but that's all it is - there's no magic.

I can only speak about digital photography, I'll trust people's comments on audio here. So actually, in certain conditions (like low-enough resolution pictures), upsampling to slightly higher pixel dimensions (the photoshop way of saying "number of pixels") can bring up artifacts like aliasing, especially if the algorithm is not up to snuff. In this case, you can do better to upsample to much higher pixel dimensions (particularly multiples of the final pixel dimensions) and have a smoother picture.


As 2Bdecided said in the post you quoted, you can work around a broken resampler by upsampling, but that doesn't make it a good idea.  The best thing to do is to simply use a good resampler in the first place.

Upsampling audio before D-A conversion

Reply #11
Quote from: 2Bdecided link=msg=0 date=
Quote from: Arnold B. Krueger link=msg=0 date=

I see romance in simplifying whereever possible. If upsampling has no audible benefits, then don't do it.


Given that no DAC on the market today (or in the last decade) actually works at the native sample rate of the content, the audio will be upsampled (=oversampled=resampled) somewhere. The questions are where, how well, and in how many stages.


Oversampling in converters has a purpose, and it is very effective at accomplishing that purpose. Therefore it makes no sense to simplify it out of existence. Since we have no simpler alternative that works as well, it is not reasonable to simplify it out of existence. I don't see any purpose in belaboring that, and that isn't what the OP was talking about.

Quote
There's nothing good about the "simple" approach of leaving it to the DAC itself. It might be good enough, but it's certainly not the best that can be done in terms of doing the job properly.


Nothing good?

Is that true?

What sounds better than doing the oversampling in the DAC?

I'm under the impression that we have no problems making sonically transparent converters with on-chip oversampling all by itself. Sonically transparent is as good as it needs to be, right? With TOS8 before us, can you prove otherwise?

Quote
Quote

Increasing the amount of data by upsampling puts more stress on your storage and data transfer paths. It can make latent problems into PITAs.  Popping usually represents data loss.  Reducing the amount of data being transferred can ease stress on any weaker components in the system.

Oh please - this is the 21st century - people use their PCs to play HD video.


Item one is that HD video has a purpose which is a readily discernable better picture. 24/192 for audio has no audible purpose. Any audible benefits that it might have are very difficult or impossible to discern.

Playing HD video  which peaks out at about 12 megabytes per second, is not a slam dunk. We had to invent Blu Ray discs to store and play it, and up until lately onboard video interfaces couldn't do it. Our standard flash drives with top out at 6 megabtye per second, so they can't do full HD in real time.

Processing HD the most efficient way for playback in real time uses over 50% of the fastest processors around. Running a HD video playback pretty well ties up a standard PC with respect to other multitasking. But, all of this struggle has a purpose - a readily discernable better picture.

24 channels of 24/192 audio exceeds the data rate of HD video. I've been known to record 32 channels concurrently. I'm sure sooner or later someone is going to want to play 24 channels or more back as discrete multichannel. And again, 24/192 has audible benefits that are difficult or impossible to reliably perceive. Why go through all the hassle for nothing?

Quote
The data rate of 2-channel 24/96 audio is a non-issue - or if it is a problem, your PC is probably useless for almost anything else "normal" people do with PCs these days.


Who is talking about just 2 channels, and who is talking about just 24/96? If you're going to advise people to do something uselessly exhorbitant  like run at 24/96, why stop there?

Upsampling audio before D-A conversion

Reply #12


I never once said it would sound better. I said it was measurably better. resampling / oversampling will happen - and you can do it better in fb2k than your sound card's DAC.


I think you've spent so many decades arguing against expensive "improvements" that have no measurable benefit, that you're now automatically running the same kind of arguments against a free improvement which provide an easily measurable benefit.


You made some strange argument that somehow PCs wouldn't cope properly with 2-channel 24/96 - I mentioned HD video as a far more computationally burdensome task that modern PCs can perform to show how silly your argument was, and then you mention 24 channels of 24/96.

For goodness sake - the guy is upsampling CDs - since when did they have 24 channels?

Cheers,
David.

Upsampling audio before D-A conversion

Reply #13
The resampling in, say, fb2k, is measurably better than the upsampling / oversampling / reconstruction filtering in even a good digital to analogue converter, never mind in a laptop sound card.

Whether you can hear the difference is another matter.


I'm not comparing between resampling on the card or on software.
Ah, but that's exactly what you're doing.

Quote
The UA-1G USB Interface (not a laptop sound card) does not even claim to provide usable resampling capabilities, it asks for input at the same sample rate as that set on it. So the choice is between setting it to play at 44.1kHz and outputting my audio without any resampling, or setting it to play at 96kHz and resampling on the software. Should I be upsampling at all?

What Arnold says supports my common sense, but andy raises the point that made me think that there may be some sense to upsampling: aliasing. I've heard that D/A conversion stage has the potential to introduce aliasing artifacts. Will being fed with a higher sample rate signal allow the DAC to minimize aliasing artifacts? I realize that this will likely depend on the details of the filters used in the particular DAC, but is there any general trend with the DAC-s normally available on such low/mid range equipment?
The DAC will already be oversampling, using "OK" filters - you can do the job in fb2k using exceptional filters.

The DAC will still do some oversampling, but its own filters will now be acting at the top end of the oversampled audio (i.e. around 48kHz), rather than at the top end of the original audio (i.e. around 22kHz), so any possible side effects are moved even further from the audio band.


It's trivial to produce test signals where the difference is audible on most equipment if you play it loudly. This has almost no relevance to listening to real music - unless the filtering in the DAC is truly bad.

Cheers,
David.

Upsampling audio before D-A conversion

Reply #14
If I supply the DAC the same sample rate at which it is set to convert, why would it upsample at all? I already told you, my DAC does not claim to provide resampling capabilities, and asks for the same sample rate at which it is set. To me the choice seems between whether to resample at all, rather than where to resample.

Upsampling audio before D-A conversion

Reply #15
All modern DACs oversample.

Upsampling audio before D-A conversion

Reply #16
I never once said it would sound better. I said it was measurably better. resampling / oversampling will happen - and you can do it better in fb2k than your sound card's DAC.


So what? Seems like you've got another solution looking for a problem.

Quote
I think you've spent so many decades arguing against expensive "improvements" that have no measurable benefit, that you're now automatically running the same kind of arguments against a free improvement which provide an easily measurable benefit.


First off, my main argument all along has been against alleged improvements that did indeed have measurable benefits, but still moved us no closer to sonic realism. One of my favorite arguments, which I've used here many times, is that just about everything measures differently, because our ability to measure has become so sophisticated. For example, it is often possible to measure the difference among wire based on its latent microphonic properties.

Quote
You made some strange argument that somehow PCs wouldn't cope properly with 2-channel 24/96


No.

What I did say is that some PCs are on the edge, and the difference between the CPU and memory load of 24/96 versus 16/44 could push them over the edge.

I've definately seen this happen, and not just in the distant past. PCs are a zero sum game.

Your ideas about resource utilization remind me of Southern California. Compared to Michigan where I live, Sounthern Californians seem to make heavy use of water for things we'd never do in Michigan, even though *we* live in the midst of the largest collection of fresh water in the world. Then they come crying to us for Federal tax money for new dams and canals when they run out of water.

Quote
- I mentioned HD video as a far more computationally burdensome task that modern PCs can perform to show how silly your argument was, and then you mention 24 channels of 24/96.


I also pointed out that in fact the ability to handle the HD video is  still far from being as universal as you seem to think. Sue me for doing a certain amount of work with HD video, I know what it takes.

Quote
For goodness sake - the guy is upsampling CDs - since when did they have 24 channels?


The point is that once you've given a job enough resources so that it is being done right, and by right I mean sonically transparent, you move on and slay other demons. Just because the resources to do a measurably better job are available is no reason to make a long term commitment of them to something that has vanishing practical benefits.

Upsampling audio before D-A conversion

Reply #17
If I supply the DAC the same sample rate at which it is set to convert, why would it upsample at all?


Modern converters, both ADCs and DACs use upsampling to faciilitate their use of digital filters.  Low pass filtering is critical to their operation. By upsampling, sharp cutoff digital filters do the bulk of that filtering, which they can do cheaply and easily. A simple, gentle analog filter backstops the digital filtering to manage the artifacts that the digital filtering doesn't handle.  Typically, this kind of oversampling is on the order of 8x or so.

This all happens inside the converter chip, which automagically tracks the settings you provide with your software. For example a converter with an external sample rate of 44 KHz, might be running at over 320 KHz internally. Switch it up to 96 Khz, and the internal process resets itself to operate at over 800 Khz.

This begs the question of whether or not it would be better to do the upsampling outside the chip in software in order to simplify the chip and/or do a better job of upsampling. The pressing need for better upsampling is not there because the chip's upsampling is generally more than good enough to fool the ear. The chip is already dirt cheap and does lots of other stuff, so there's very little economic justification for simplifying it.

If the oversampling is done in software, then something like 8 times more data would be involved. Instead of the workload for handling 2 channels, it would explode into more like 16 channels. If you dedicate a modern PC to this sort of workload, probably no problem. However, if you want to multitask, the results of adding the vastly inflated workload will be unpredictable because PC's generally don't do an ideal job of scheduling their work.

Upsampling audio before D-A conversion

Reply #18
you're doing it again...!

The upsampling in fb2k would be ~2x in this case. Not 8. So, not quite such a "problem".

I agree about multitasking though. Mind you, if you're running something else, you're not listening to the music properly anyway!


Quote
The point is that once you've given a job enough resources so that it is being done right, and by right I mean sonically transparent, you move on and slay other demons.
Are there any other demons that can be slain so cheaply and trivially?

e.g. You could do room and speaker correction from within fb2k - the processing is again free (or at least already paid for), but you'd need to buy a decent quality microphone to gather the data.

Cheers,
David.

Upsampling audio before D-A conversion

Reply #19
All modern DACs oversample.


side question -- do they still do it at 128x/1-bit these days?  CDPs used to trumpet that in their marketing.

Upsampling audio before D-A conversion

Reply #20
All modern DACs oversample.


side question -- do they still do it at 128x/1-bit these days?  CDPs used to trumpet that in their marketing.


The operative technology is called sigma-delta and is overviewed here:

http://www.intersil.com/data/an/an9504.pdf

Figure 1 there is titled "FIRST ORDER SIGMA DELTA ADC BLOCK DIAGRAM" . What makes it "first order" is the use of a single 1 bit DAC and integrator, which I believe relates to the label "1 bit" in your query.

Modern high performance converters are generally called 4th or 5th order, which means that there are mlutiple internal DACs and integrators in nested loops. There may be as many as  4 or 5 of them. See figure 5 and related text for further explanation of this.

Upsampling audio before D-A conversion

Reply #21
Well, as for PC upsampling, I do it all the time with my music.  I have to given the setup on this particular system.

I listen to MP3 music on a 7 year old desktop computer system that has an AMD Athlon XP 1800+ CPU, 1 GB RAM, and a SB Live! PCI sound card.


An older thread on HA had someone post a link to a short WAV file that was 44KHz, 16-bit.  Standard for CD audio.  He said that if your sound path properly handled 44 KHz audio, then the WAV file should sound like an ambulance siren.  If it did not, then it would sound totally different, like a buzzing noise or alien spaceship.

Guess what, I played that file on my system, and it indeed sounded like an alien spaceship.  It seems the pre-Audigy line of Creative sound cards automatically resampled all audio to one of three rates: 12 KHz, 24 KHz, or 48 KHz, whichever was closest.  It did this if the audio wasn't already in one of these three rates.  So, all 44 KHz audio (meaning CD audio too) was resampled to 48KHz onboard the Creative card.

The problem is that the onboard resampler on these Creative cards is pure garbage.  Because of the onboard processing limits, they resampled using low precision values.

So, what I did was play the WAV file using a software app like Foobar2000, WinAmp, or my current one, XMPlay, and have the software app resample the audio realtime to 48KHz before it sends it to the Creative sound card.

By doing this, the resampler on the Creative card is bypassed, because it now sees an audio stream that is 48KHz, matching one of the three rates.

Because it's done in software, the level of precision for the resampling is much, much, higher than it would be if the Creative card did it.

Thus, that WAV file that sounded like an alien spaceship on my system before, now sounds like an ambulance siren, as it should.

The CPU usage on my system, only increased from 5% to 8%.  So, a 3% CPU performance hit to resample to 48KHz.

Whenever I play older games on this system, I try to set them to output 48KHz audio, but some give only 22KHz or 44KHz as audio rate options, meaning the audio will be resampled to either 24KHz or 48KHz by the Creative card and it's awful onboard resampler.

EDIT:

I've heard that more recent Creative sound cards still resample, but use a much better onboard resampler, with much higher precision, so it's no longer an issue.

Upsampling audio before D-A conversion

Reply #22
Well, as for PC upsampling, I do it all the time with my music.


Thats not whats being discussed.  You're just bypassing a poor driver resampler with a better application level resampler, but either way still resampling.  People in this thread are talking about oversampling verses not resampling.

Upsampling audio before D-A conversion

Reply #23
Well... what about using a Non-Oversampling DAC?! There are still some designs and chips out there. Like the TDA1543 [PDF-Link]...
So if you bypass the Windows Kernel Mixer (WASAPI, ASIO, whatever) and just want to listen to CDs - you would have no resampling in any way, wouldn't you.

I never owned or listened to a NOS-DAC, I'm just curious if this would be the most "true" / "simplistic" / "unaltered" way?!
Opinions...

And my second question: Are there any reliable sources that software upsampling (e.g. through DSPs @foo2k) is better, than todays DAC's oversampling?!

Best regards,
bearmann

Upsampling audio before D-A conversion

Reply #24
Sonically transparent is as good as it needs to be, right? With TOS8 before us, can you prove otherwise?
It's not all about perception. As an audio professional I feel obliged to record, process and reproduce audio with the highest fidelity. For that I prefer equipment with less distortion and less loss, as long as that doesn't compromise other elements. Even if there is no (immediate) audible advantage. This is definitely the case with ADC's and everything earlier in the recording chain.
I agree that when a DAC is only used for listening (and not for re-capturing its output), audible transparency is probably all you need.