R/E/P Community

Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: is digital domain upsampling necessary?  (Read 6529 times)

cantgetnosleep

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
is digital domain upsampling necessary?
« on: December 05, 2004, 05:42:03 AM »

Hello everybody,

I read the "44k vs. 96k - a new discovery" thread, which lead me to read several of the white papers on Dan Lavry's web site.  I really enjoyed the thread, and the papers - sinc's relationship to a perfect brickwall LPF and sample interpolation is truly fascinating - however, I have a question...

Is upsampling/downsampling ever necessary if we are staying within the digital domain?  I understand its benefit during AD/DA conversion, but is it ever beneficial in a purely digital process?

I ask because I have a nagging gut feeling that some (possibly non-linear?) operations would benefit from upsampling/downsampling.  However, according to nyquist's theorm, all audible information is contained within the sampled data, provided that the sampling rate excedes twice the bandwith of human hearing.  Thus, upsampling will not add any information to the already sampled data, and any information added to the data by the digital process, that does not affect the samples at the original sample rate, occurs at inaudible frequencies.  By this logic I would assume that pure digital upsampling/downsampling is unecessary.

The quote below from the mentioned thread addressed this question, however I still do not understand how noise build up and z-plane warping necessitate upsampling.  I also have no idea what a Z-plane and an s-plane are.

"Noise accumulation is a function of the rounding and/or dither modes used during accumulation in the filter, and as I said, any well designed filter will take this into account. Noise buildup is not as big of an issue as Z-plane warping, which causes increasing deviations from analog (s-plane) transfer functions in the upper octave(s).

In many cases, this makes it impossible to reproduce the exact transfer function without upsampling. For example, it's impossible to recreate the exact amplitude and phase characteristics of most high-order (>2) analog filters in digital without upsampling. A perfect example is the Pultec EQ. Any DSP process that claims to be a Pultec but doesn't upsample isn't matching the response correctly."


Any input on this would be greatly appreciated. Smile

Thanks, Andrew
Logged

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: is digital domain upsampling necessary?
« Reply #1 on: December 05, 2004, 02:44:33 PM »

Andrew,

Let's break it down in simple terms:

As you know (I'm assuming) any non-linear process creates distortion.  Simple compression creates harmonic distortion.  Limiting creates harmonic distortion.  Other process create non-harmonic distortion.

Let's look at the simple case of compression.  If you compress a sine wave you turn it more square.  This means that you inherently add frequency content to it, and that harmonic content is harmonic - it is related to, in fact multiples of, the frequency of the compressed signal.  If you compress a 1kHz signal you'll get some 3kHz, some 5kHz, some 7kHz, etc., the greater the compression the more of these you'll get.  Limiting with a low threshold turns the sine wave almost square, so the frequency content is the same as a square wave of the same frequency.

Now let's take a troublesome scenario - let's compress a 5kHz sine wave in the digital realm.  At every sample we analyze whether that particular sample is above the threshold, and if it is then we apply a gain reduction formula to it.  In the end we  have a compressed 5kHz sine wave.  The harmonic frequencies represented by that sine wave are 5kHz, 15kHz, 25kHz, 35kHz, etc. and on up the line.  The problem here is that we have a digital signal that represents digital information above Nyquist, no?  How is that frequency content going to manifest itself when we put this signal through a D/A converter and an anti-imaging filter?  The 5kHz will come out as 5kHz and the 15kHz will pass through as 15kHz, but the rest?  Indeed, it aliases back into the frequency range.

The best way to solve this is to upsample the material to a higher sample rate first - perhaps up to 192kS/s.  Nyquist is now 96kHz.  Any frequency content created up to 96kHz does not alias, and when we downsample we legitimately filter that extra content out with a decimation filter.  In the end, all that remains is 5kHz and 15kHz, and the aliasing byproduct of anything that exceeded 96kHz, which is likely so low in level that it is lost below the noise floor, no?  

This is one of the main arguments to upsample non-linear processes, but it is argued that this is the least important reason.  For a more significant reason think about the device inside the compressor that establishes whether or not a signal exceeds the threshold, and then read the article here about digital distortion:

http://www.cadenzarecording.com/papers

If you have any further questions about how this all ties together let me know.

Nika.

Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

danlavry

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 997
Re: is digital domain upsampling necessary?
« Reply #2 on: December 05, 2004, 04:43:58 PM »

cantgetnosleep wrote on Sun, 05 December 2004 10:42

Hello everybody,

Is upsampling/downsampling ever necessary if we are staying within the digital domain?  I understand its benefit during AD/DA conversion, but is it ever beneficial in a purely digital process?

I ask because I have a nagging gut feeling that some (possibly non-linear?) operations would benefit from upsampling/downsampling....
Any input on this would be greatly appreciated. Smile

Thanks, Andrew


Doing a non linear processing in the analog domain, is coupled with generation of higher frequencies. For example, take a sine wave and square it – you will end up with double the frequency. A sine to the 3rd power yield components at tripe the frequency and so on.

With analog, the additional high frequency can be managed. One can filter the high frequencies. We get to keep the low frequencies with the intended non linearity, while removing the unwanted high frequencies.

With digital, whenever those additional high frequencies exceed Nyquist, they fold back into frequencies below Nyquist (aliasing).

Total prevention of aliasing for ANY non linear operation would require “doing it in analog”. There is a “middle of the road” compromise, pushing that Nyquist “fold back point” further up (with up sampling). The up sampled data has the capability of accommodating signals up to higher frequencies (faster sampling). Why have the extra frequency region? Clearly, not for the benefit of additional audio signals. That extra region is the temporary garbage dump. The up sampling has created room for unwanted energy that gets generated by non linear processing. At the end of the processes, one can down sample to the original rate to get back to the “real world”. The intended non linearity for audio remains, and all the “high frequency garbage” if filtered out.

However, lets face it! Generally speaking, non linearity tends to generate very high frequencies, thus aliasing prevention calls for up sample by VERY large factors. A reasonably good tube emulator takes much more than a X2 or X4 up sampling!  

More often than not, the digital non linear operation ends up as a compromise: letting some “junk” folds as long as it can be tolerated by the ear. A compressor is “not too demanding”, a hard limiter generates huge amount of very high frequencies….

Regards
Dan Lavry
Logged

zmix

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2828
Re: is digital domain upsampling necessary?
« Reply #3 on: December 05, 2004, 10:33:25 PM »


I found a waveshaping plugin that runs on OSX under Audio Units that can help illustrate Dan's claim:

It is called "cyanide 2"

http://bram.smartelectronix.com/

It is a waveshaper, not particularly interesting as it is symmetrical only (NO even harmonics!!)

HOWEVER- it has a 16X oversampling button!

So for experimentation sake, set it for some subtle saturation and listen to a stereo program through it, Then, after listening for 10 or 15 minutes, switch in the 'oversampling' and listen for another 10 or 15 minutes. Now switch the oversampling off.....

cantgetnosleep

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
Re: is digital domain upsampling necessary?
« Reply #4 on: December 06, 2004, 02:54:50 AM »

Thanks for the replys Nika, Dan, and zmix.  I think I understand now.  

Upsampling with linear processes is not necessary, because a linear process does not add new harmonics (linear processes being things like gain change or summing).  However, non-linear processes add lots of high frequency harmonics which will cause aliasing without upsampling.

Just out of curiosity - how many times upsampling do high quality analog simulation plug-ins typically use?

What is a good book on issues such as theses? Nika i'm going to order your book - I like your articles.  Any other suggestions?

Many thanks, Andrew
Logged

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: is digital domain upsampling necessary?
« Reply #5 on: December 06, 2004, 10:29:05 AM »

cantgetnosleep wrote on Mon, 06 December 2004 02:54

Upsampling with linear processes is not necessary, because a linear process does not add new harmonics (linear processes being things like gain change or summing).


Or reverb or (though arguable) EQ.

Quote:

However, non-linear processes add lots of high frequency harmonics which will cause aliasing without upsampling.


Non-linear processes, depending on the amount of their effect, add harmonics, which will cause aliasing if those harmonics are above Nyquist.

Quote:

Just out of curiosity - how many times upsampling do high quality analog simulation plug-ins typically use?


Zero.  This is for a reason that I'm hinting at above - the amount of high frequency content generated in traditional mixing practices is so small that it is debateable how consequential it even is.  Did you look at that other paper, however?  It hints at an area wherein it can be much more consequential.  

Quote:

What is a good book on issues such as theses? Nika i'm going to order your book - I like your articles.  Any other suggestions?


Bob Katz's book "Mastering Audio" is also good.  I have that one prominently displayed on my bookshelf as well.  I think his book is much more practical (how to get a good mix) and mine is much more theoretical - explaining more about "why" and "how" these things affect the audio - akin to my explanation above - and letting the end user establish how they are going to use that information.  

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

cantgetnosleep

  • Newbie
  • *
  • Offline Offline
  • Posts: 8
Re: is digital domain upsampling necessary?
« Reply #6 on: December 07, 2004, 09:58:13 AM »

Nika,

I see what your getting at.  If the compressor doesn't upsample, it will not accurately track the waveform's dynamics, and it will misjudge the peaks just as the digital over meter doesn't accurately track clipping in your article.  This will cause enharmonic distortion, leading to an unpleasant 'digititis' type sound.

I suppose that perhaps this is one reason why people prefer sample rates higher than 44khz.  If you mix at 192khz, then you will probably be less likely to have these types of problems with digital compressors and over meters.  You are in essense working 'upsampled'.

Interesting.

Thanks, Andrew
Logged

Nika Aldrich

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 832
Re: is digital domain upsampling necessary?
« Reply #7 on: December 07, 2004, 10:25:00 AM »

Andrew,

Right!  The important thing here is that the entire algorithm for the compressor need not be upsampled, but the "reader" mechanism needs to be - that being the device that determines whether or not (and by how much) the signal has exceeded the threshold.  It's kind of a sidechain function.  That particular part of the compressor needs to recreate the waveform so as to determine when the signal represented by the waveform exceeds the threshold - even if the samples do not.

This is indeed a potential reason some people like high frequency recording, but we must keep in mind that this would only be manifest if they used these non-linear processes - and significantly enough to generate audible distortion.  

I think you catch the drift of all of it from there.

Nika
Logged
"Digital Audio Explained" now available on sale.

Click above for sample chapter, table of contents, and more.

Bob Olhsson

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3968
Re: is digital domain upsampling necessary?
« Reply #8 on: December 07, 2004, 10:38:30 AM »

I've been hearing about upsampling being a common practice in non-linear digital signal processing for many years. DSP developers understandably aren't about to publish or advertise the hard-earned methods found beneath the hood of their products.
Pages: [1]   Go Up
 

Site Hosted By Ashdown Technologies, Inc.

Page created in 0.097 seconds with 21 queries.