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, Oversampling, and DACs, oh my! (Read 20375 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Upsampling, Oversampling, and DACs, oh my!

Reply #25
The upsampling in this case is just zero stuffing+lowpass filter.  So 128x means take one sample of the input signal, then 127 samples that just zero.  Then 1 more sample of input, and so.  Then a DSP filter low passes at just below Nyquist and passes it though to the DAC itself.


I've been thinking that it would more logical to repeat values rather than zero stuffing.


You can, but zeros work better. 

Not only work better, but are a hell of a lot simpler computationally (think of all those zero values that you don't need to multiply by filter factors).

Upsampling, Oversampling, and DACs, oh my!

Reply #26
So I guess my question is, are they any added *TECHNICAL* (not necessarily audible) benefits for software or hardware to upsample a signal today during playback with respect to filtering requirements and/or less overall jitter impact on the signal?
It's possible to use a technically better upsampling filter in software than you'll find in the DAC itself, so of course the answer is yes.


Why is that? Simply computing resources?

Quote
It is not that difficult to get so close a perfect brick wall filter that the result is indistinguishable from a perfect brick wall filter, if that is what you want to do. No DAC is going to bother to do this.


I assume cost (i.e. number of parts)?
It is a simple matter of degree as to how well you want to do the job. You need a filter longer than one second before the "improvements" become immeasurable. No sane person will do this because the difference became inaudible after the filter reached, say, tens of milliseconds.


Quote
Quote
It is pointless since it'll sound the same as something that isn't as close to a brick wall filter. Also, where the different filters are audible (generally a lot lower than 20kHz) something gentler than a brick wall filter is to be preferred (less ringing). This can and has been verified in the real world using lower sample rates where the differences are easily audible.

With brick wall filters especially, the phase is important...
http://www.hydrogenaudio.org/forums/index....showtopic=68524
...though there are only two positive ABX results for it being audible at 20kHz (i.e. when upsampling CD quality audio) in that thread. It's easily audible when the transition band is within the normal range of human hearing (i.e. well below 20kHz) but that's never true when oversampling decent quality audio.


Alright but you are making the claim that oversampling is good no matter what, whether it be in the recon filter which is what every competently designed DAC does or in software (lets say you feeding  NOS DAC). That's how I read your comments.
If everything from the DAC onwards is perfect, it doesn't matter at all what you do (as long as whatever you do is flat within the pass band). The only differences are above 18-20kHz, and you can't hear it. However, pumping ultrasonic crap through amplifiers and especially speakers isn't guaranteed to be benign, so people filter it out. With it filtered out, you can also show the output on a graph which looks like the original signal, rather than the original signal plus lots of ultrasonic crap. People like that. They like pretty graphs that look like they think they should. It makes them feel better.

Cheers,
David.

Upsampling, Oversampling, and DACs, oh my!

Reply #27
If everything from the DAC onwards is perfect, it doesn't matter at all what you do (as long as whatever you do is flat within the pass band). The only differences are above 18-20kHz, and you can't hear it.

Sorry if I’m about to ask some stupid questions… Does your statement here mean it doesn’t matter whether one oversamples or uses a NOS DAC, or is it comparing different methods of oversampling only?

If the former, assuming a moderate Nyquist frequency such as 22.05 kHz, do you mean that even the sinc-associated roll-off of NOS DACs will not slope audibly into frequencies we can hear? I’m considering this with fs/2 being analogous to (but more attenuated than) fc in an LPF (often misnamed the ?3 dB point), and in that sense, I’m not up to speed on how to predict at what point before fc/Nyquist the roll-off will attain audibility, so I would welcome an education.

IOW: Positing a NOS DAC attenuating by ~3.92 dB at fs/2, or a first-order LPF attenuating by ~3 dB at fc, if the critical frequency in question is 22.05 kHz for the NOS DAC or something a bit lower like 20 kHz for the LPF, are any preceding audible frequencies attenuated to a physiologically significant extent, and if so, when does the roll-off become significant?

Upsampling, Oversampling, and DACs, oh my!

Reply #28
(as long as whatever you do is flat within the pass band)
NOS DACs are not flat within the pass band.

It's significant if you can hear it

for sample rate fs, frequency f, the attenuation is
20*log10(sin(x)/x)
where x=pi*f/fs

apologies - you knew this didn't you?

I don't know if you can hear 2dB loss at 16kHz, or 1dB at 12kHz. I can't.

Cheers,
David.

 

Upsampling, Oversampling, and DACs, oh my!

Reply #29
Ha, I really brainfart’d there… Of course it’s trivial to calculate the attenuation at any point below fs/2 out of a NOS DAC: just use the sinc function! To think I specifically mentioned that relationship in reference to frequencies above Nyquist and somehow didn’t extend it to its obvious conclusion for frequencies below that point.

In reality, I’ve mainly been wondering about this with regard to LPFs rather than NOS DACs, but I got waylaid by the mention of the latter here. Perhaps this is just me being bad at re/searching and not having access to relevant textbooks, but I haven’t come across a definitive statement about calculating attenuation at frequencies below fc. However, I have read a few indications that it’s largely dependent upon the particular components of the filter rather than having a concrete formula behind it. But it seems to me that if the slope beyond fc is predictable to high accuracy, the slope before fc should be too.

Anyway, as you said, it’s largely a matter of determining one’s personal sensitivity to changes in amplitude at particular frequencies. I doubt I’m going to notice 3 dB of roll-off in the run-up to 20 kHz or thereabouts! I’m just curious about the maths. There’s a phrase I never thought I’d say!