Someone explain this resampling thing to me...
May 27, 2005 at 5:08 AM Post #16 of 30

erickoh

New Head-Fier
Joined
Jun 18, 2003
Posts
27
Likes
0
DACs can have different performance levels depending on the input stream's sampling rate. Something to do with harmonics i think
biggrin.gif


Albatross, if you cannot hear any difference then I don't think it's worth your trouble to specially encode your music in another format/sampling rate. A better solution might be to upgrade to a better soundcard.
 
May 27, 2005 at 6:32 PM Post #17 of 30

wali

1000+ Head-Fier
Joined
Nov 22, 2003
Posts
1,100
Likes
13
It is quite simple to explain actually... play a video clip in your windows media player - then zoom to 200% or higher... the same principal applies to audio – instead of zooming you resample.

So the question is whether you like to watch a clip in its default resolution or zoom it.
 
May 28, 2005 at 6:44 AM Post #18 of 30

taiguy

New Head-Fier
Joined
May 28, 2005
Posts
2
Likes
0
OK - I'm a bit confused as to the purpose of resampling. I was given a link here by a buddy that's trying to tell me upsampling his music makes it sound better. I can't seem to think of any possible reason why that would be true. He has a Creative e-mu 0404 and uses Patchmix to handle the audio setup.

As I learned it, you can reproduce (digitally) a perfect copy of a waveform by sampling at a rate greater than critical frequency (twice the bandwidth of your signal)[1]. Audio runs from 20hz - 20khz so the minimum sample rate used for complete reproduction is 40khz[2], and CD's are set at 44.1khz to provide for a little bit of fudge room, since you have to apply a low pass filter to achieve your original signal. You obtain an infinite number of duplicate waveforms (harmonics) in integer multiples.

Using this rudimentary, but no less valid information I can't see why upsampling everything to 96kHz is beneficial. You don't need to sample that high to begin with, and then taking a signal that's already 44.1kHz or 48kHz and then converting it it to 96kHz sounds silly to me, as you're not gaining anything (content wise).

From reading some of the other posts, it seems that Creative has some problems decoding non 48kHz sound on it's own, and so some people use software to match the sample rate before passing the signal into the card for playback.

But isn't it silly to think upsampling everything to 96kHz will make it sound better?
confused.gif


[1] Nyquist-Shannon Sampling Theorem OR Whittaker-Nyquist-Kotelnikov-Shannon sampling theorem
[2] Nyquist Frequency (2w)
 
May 28, 2005 at 6:59 AM Post #19 of 30

Eric1285

100+ Head-Fier
Joined
Feb 25, 2005
Posts
158
Likes
0
I didn't say it necessarily sounds better...but it certainly wouldn't sound worse.
 
May 28, 2005 at 12:05 PM Post #20 of 30

sgrossklass

Headphoneus Supremus
Joined
Dec 3, 2004
Posts
2,803
Likes
19
The best explanation of why upsampling "works" I've come across so far dealt with the influence of the filtering. When D/Aing at a higher fs you can use a less steep filter, thus improving time smearing. The only part left with a big question mark is the filtering applied during upsampling.
Another effect worth mentioning is that resampling to to-integer multiples may generate odd harmonics, and particularly the 3rd harmonic makes things sound nicer subjectively. A while back I resampled a file in Audacity from 44.1 to 48 kHz and found that it sounded better than the original...
 
May 28, 2005 at 5:45 PM Post #21 of 30

taiguy

New Head-Fier
Joined
May 28, 2005
Posts
2
Likes
0
Quote:

Originally Posted by sgrossklass
Another effect worth mentioning is that resampling to to-integer multiples may generate odd harmonics, and particularly the 3rd harmonic makes things sound nicer subjectively. A while back I resampled a file in Audacity from 44.1 to 48 kHz and found that it sounded better than the original...


How would you sample to-integer multiples? Do you mean sampling to integer multiples of the original sampling frequency? Then neither 48kHz nor 96kHz would work. And what do you mean the 3rd harmonic makes things sound nicer subjectively? and why? (by 3rd harmonic I'm assuming you mean the 4th fundamental) Wouldn't any harmonics get cut off by the low pass filter anyway?

I'm still a bit confused...
 
May 28, 2005 at 5:59 PM Post #22 of 30

Born2bwire

25+ Member ;-)
Joined
Nov 11, 2001
Posts
3,700
Likes
12
Quote:

Originally Posted by taiguy
How would you sample to-integer multiples? Do you mean sampling to integer multiples of the original sampling frequency? Then neither 48kHz nor 96kHz would work. And what do you mean the 3rd harmonic makes things sound nicer subjectively? and why? (by 3rd harmonic I'm assuming you mean the 4th fundamental) Wouldn't any harmonics get cut off by the low pass filter anyway?

I'm still a bit confused...



Sampling by integer multiples means, in this case, to upsample by 2x, 3x, 4x, etc. It means that we are resampling to an integer multiple of the original sampling rate. Integer upsampling does not affect the quality of the signal, since all we have to do is zero-padding (we insert samples of zero amplitude inbetween the original samples to increase the samples/second (sampling rate)). As weird as the new waveform will look, the frequency domain equivalent is identical. Integer upsampling for CDs have sampling rates of 88.2 Khz, 132.3 Khz, etc. The problem arises when we do non-integer upsampling, like to 48Khz. Now the problem is that we must interpolate the resampled waveform from the old one. So the way that one does the interpolation will affect the quality of the resampled wave. Some people feel that the resampling algorithms that the Creative soundcards use are inferior to the software resampling algorithms provided by plugins for Foobar and other players, hence all this brouhaha.

As sgrossklass stated, the other argument for upsampling is that you can create a better DAC for the same money, resources, and real estate because it can use simpler filters to retain the same accuracy as the DAC for the original sampling rate. This is not so much the reason why people want to resample for the Creative cards, as stated above, but is the idea behind upsampling in CD players and external DACs. Also, some Creative cards and other soundcards have separate DACs for 96KHz and another set for 48KHz. If you upsample to 96KHz in a Creative card like the Audigy 2, then you would be taking advantage of both a better resampling algorithm and, most likely, higher quality DACs (This has been hotly debated but the last I heard, it was possible to do 96KHz pass-through on the Audigy 2 but you need to jump through some hoops to keep the card from trying to process the sound, because then it will have to downsample to 48KHz and defeat the whole purpose of the scheme.). I explained all this before in my previous post.
 
May 28, 2005 at 7:39 PM Post #23 of 30

sgrossklass

Headphoneus Supremus
Joined
Dec 3, 2004
Posts
2,803
Likes
19
Quote:

Originally Posted by taiguy
How would you sample to-integer multiples? Do you mean sampling to integer multiples of the original sampling frequency?


Sorry for any confusion arising from that typo, I intended to write "resampling to *non*-integer multiples".
Harmonics vs. fundamental: I looked up the terminology to be sure, and it seems there is only one fundamental and harmonics have frequencies that are multiples of that. I don't think anyone ever talks about a "first harmonic"... *search* yup, it's another name for the fundamental, as I thought ... so the 3rd harmonic is the one with three times the frequency of the fundamental. Why content with added 3rd order harmonic distortion sounds better, don't ask me. Weird psychoacoustic stuff I guess.
 
May 28, 2005 at 7:44 PM Post #24 of 30

Glassman

Headphoneus Supremus
Joined
Mar 22, 2003
Posts
1,830
Likes
11
well that is not correct really.. first off, by resampling we usually mean non-integer ratio change in samplerate, oversampling is integer ratio samplerate change.. oversampling is of course easier, just insert null samples, but then of course you have to apply low pass filter to attenuate mirrored spectrum after half the original samplerate frequency, otherwise you end up with a lot of mess in supersonic region.. and how is resampling accomplished? exactly the same way, you just need to oversample by a large ratio and then do the backward process, decimation, of course you have to low pass filter the product just as with plain oversampling.. this is the most common way how are synchroneous samplerate changes accomplished.. in special cases there are of course different ways how to do it, like spline interpolation by Wadia and such, but that's another story..

decimation ... integer ratio decrease of samplerate
interpolation ... integer ratio increase of samplerate
oversampling ... the same as interpolation
resampling ... non-integer ratio change of samplerate, usually accomplished by combination of interpolation and decimation
upsampling ... nonsense term introduced by marketing departments of some audio companies, usually means asynchronous resampling to 192kHz or so
 
May 28, 2005 at 8:00 PM Post #25 of 30

sgrossklass

Headphoneus Supremus
Joined
Dec 3, 2004
Posts
2,803
Likes
19
Quote:

Originally Posted by Born2bwire
Integer upsampling does not affect the quality of the signal, since all we have to do is zero-padding (we insert samples of zero amplitude inbetween the original samples to increase the samples/second (sampling rate)).


Hmm. U sure that this'll work? I know that zero padding can be used to increase the accuracy of FFTs (but simply means attaching zero samples behind the block of audio data taken), but I have my doubts here. After all, you're effectively multiplying the signal with a periodic rect function in the time domain, which means folding it with a bunch of sinc functions in the frequency domain. OK, a periodic rect with a frequency of fs/2 (fs = freq after resampling), that should have harmonics at fs, 3fs/2, etc. ... After the anti-aliasing lowpass (let's assume it's ideal for now), you'd have the lower half of the spectrum around fs/2 left, which does not really look like the original.
I'd simply do some kind of (nth order/sinc) interpolation to fill up the missing samples. That alone does not consume as much computing time as when resampling to some non-integer multiple of the original fs, but takes more power than just inserting zero samples (which should be done without much effort at all), which would correlate with my observations using software resamplers.
 
May 28, 2005 at 11:39 PM Post #26 of 30

Born2bwire

25+ Member ;-)
Joined
Nov 11, 2001
Posts
3,700
Likes
12
All my notes and work on DSP are back home so I can't give a technical explanation. Plus I usually do not visualize in the time-domain but strictly frequency when I think of these problems. For upsampling, you do not need to pass through a filter because you're increasing the bandwidth, so aliasing does not arise here. Zero padding in this instance means to insert (n-1) zero samples inbetween the original samples to upsample n times. In the frequency domain, this technique only serves to increase the bandwidth of the signal but it does not affect the original signal's frequency information. I'll see if I can talk to some of my friends about the problem to hear their thoughts but this is how I remember implementing upsampling in digital signal processing.
 
May 29, 2005 at 2:43 AM Post #27 of 30

Born2bwire

25+ Member ;-)
Joined
Nov 11, 2001
Posts
3,700
Likes
12
Talked to a buddy of mine, he doesn't remember (wasn't holding out much hope on that). I am positive about the zero padding although you may be right about passing it through a filter, I just can't think of a reason why. Man, this is why I don't sell any of my textbooks or notes because as soon as you don't have a resource, you end up needing it. Maybe someone else here has done digital signal processing and could fill in the details, I just can't remember it all, been too long. I'm due for a refresher though, I'm taking a grad DSP course when I go back to the Uni in the fall.
 
May 29, 2005 at 6:07 AM Post #28 of 30

Glassman

Headphoneus Supremus
Joined
Mar 22, 2003
Posts
1,830
Likes
11
the mirroring occurs when interpolating as well as when decimating, the only difference is that when you decimate, it is mirrored back to the new passband, while when you interpolate, it folds around the original fs/2..

Code:

Code:
[left]original: ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨\ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ after decimation: ¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨ + /¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨ original: ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨\ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ after interpolation: ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨\/¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨[/left]

in both cases you have to apply low pass filtering in order to get rid of the mirroring effects, in case of decimation it's the first step and the corner frequency is fs/2 of the new samplerate, in case of interpolation it's the last step and the corner is at fs/2 of the original samplerate..
 
May 29, 2005 at 2:33 PM Post #29 of 30

Albatross05

100+ Head-Fier
Joined
Apr 26, 2005
Posts
152
Likes
0
Quote:

Originally Posted by sgrossklass
Sorry for any confusion arising from that typo, I intended to write "resampling to *non*-integer multiples".
Harmonics vs. fundamental: I looked up the terminology to be sure, and it seems there is only one fundamental and harmonics have frequencies that are multiples of that. I don't think anyone ever talks about a "first harmonic"... *search* yup, it's another name for the fundamental, as I thought ... so the 3rd harmonic is the one with three times the frequency of the fundamental. Why content with added 3rd order harmonic distortion sounds better, don't ask me. Weird psychoacoustic stuff I guess.



Someone (by all means) correct me if I'm wrong but isn't a big part of the problem the fact that the software hasn't really kept up with the hardware. IOW, if the music wasn't low resolution in the first place, you wouldn't have to upsample it in order to play it on the hardware that's quite common (and has been for several years, it seems). The software companies (namely, the recording industry) seems to be dragging their feet on high resolution audio (for reasons I should think are obvious).

One other poster compared it to resampling video and I'll go ahead and use the example of a digital photo. If you've got a high resolution monitor and a digital photo the size of a postage stamp, what are you going to do? Well, if you want to see it at all, you can either get really close to the screen and squint or you can resize/resample it and hope for the best. If the hardware's there, why hasn't high resolution audio been going full steam ahead? Sure, it's out there (in quite limited quantities). It just ticks me off that it seems like pure greed is impeding the advancement of technology. I don't wanna start any debates or anything but what I said seems to be true to me. And again, feel absolutely free to correct me if I'm way off base. I'm a newbie and technology isn't my strong suit.
 
Oct 28, 2005 at 1:30 PM Post #30 of 30

theSAiNT

New Head-Fier
Joined
Oct 28, 2005
Posts
4
Likes
0
Thanks for all the useful insights. This was a very informative thread.

I am interested in converting my MD collection to mp3s with as little loss of quality as possible. I was hoping to connect the md deck with digital out to my soundcard which could then record and convert the input. Unfortunately, I have just bought an Audigy 2 which upsamples inputs by default. Would I be right in thinking it would upsample the digital signal? Would I be right in thinking this would degrade the quality? Should I buy a new soundcard?

Thanks again for your help guys.
 

Users who are viewing this thread

Top