Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th November 2007, 23:28   #1  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Resampling to a higher Sampling Rate = Loss Of Quality or...?

Hello, maybe one of you guys can clear up this question. Does resampling from lets say, 44100 to 48000khz = loss of quality, or perhaps it may seem that way since 48000khz can hold higher frequencies than 44100khz?

e.g. (Analysis using spectral display in adobe).
Original (44100khz):
http://img260.imageshack.us/img260/4...inalwavsf6.png

48000Khz:
http://img106.imageshack.us/img106/5...ed48000ki3.png

192000khz:
http://img211.imageshack.us/img211/5...d192000qu9.png
Terranigma is offline   Reply With Quote
Old 9th November 2007, 03:29   #2  |  Link
Coolpplse
Registered User
 
Join Date: Oct 2007
Posts: 34
doing 44.1khz -> 48khz always causes rounding errors, and good filters can eliminate most of those errors but not all

Doing 44.1khz -> 88.2khz doesnt lose quality I believe since theres no rounding errors at that samplerate...
Coolpplse is offline   Reply With Quote
Old 9th November 2007, 18:58   #3  |  Link
unskinnyboy
Registered User
 
unskinnyboy's Avatar
 
Join Date: Feb 2004
Location: NTSC R1
Posts: 2,046
Upsampling to a sampling rate which is a multiple of the signal's sampling rate would allow for a perfect reconstruction of the signal (at least theoretically). That's what Nyquist-Shannon theorem states. But, depending on the hardware/software process used, it can introduce errors if not done properly.

So, 44.1 kHz -> 88.2 kHz would work. 44.1 kHz -> 48 kHz or 192 kHz won't work. OK, they would work, but the interpolation won't be perfect.
__________________
unskinnyboy is offline   Reply With Quote
Old 12th November 2007, 08:11   #4  |  Link
3dsnar
Registered User
 
3dsnar's Avatar
 
Join Date: Dec 2005
Location: Proxima Centauri
Posts: 315
To clarify.
resampling applies an anti-aliasing (lowpass) FIR filter to the input signal during the resampling process.
This causes some errors, including Gibbs effect in the time domain, and some frequency domain distortions (since the frequency characteristics of these filters is inperfect)

Resampling 44,1 -> 48 is possible, because you upsample 160 times and than downsample 147 time. This normally would be very ineficient, however something called polyphase filterbank and polyphase filtering routine is used, which applies both in one shot.

Anyway, this is still pretty computationally complex (44,1 -> 48), hence older resamplers used to use shorter FIR impulse responces for constructing the polyphse matrix, and therefore this particular convertion had alwas (than e.g. 44,1 -> 88,2) been viewed as more problematic and results of lower quality.

Today, a good resampler can make this conversion nearly perfectly (i.e. errors are inaudible, although present).

Cheers,
3d.
__________________
Aud-X MP3 5.1 Format
3dsnar is offline   Reply With Quote
Old 12th November 2007, 17:03   #5  |  Link
Terranigma
*Space Reserved*
 
Terranigma's Avatar
 
Join Date: May 2006
Posts: 953
Thanks for the replies guys. So, lets say that i'd like to have this 44100khz audio as 48000khz without losing any sort of quality. Would copying (instead of resampling) the wave spectrum from 44100khz to a blank 48000khz file be a workaround? I've noticed that the wave spectrum (the frequencies) remained intact when I chosed to do it like this.

Last edited by Terranigma; 12th November 2007 at 17:13.
Terranigma is offline   Reply With Quote
Old 12th November 2007, 21:01   #6  |  Link
Raptus
heretic nuB
 
Join Date: Sep 2003
Posts: 71
Quote:
Originally Posted by unskinnyboy View Post
Upsampling to a sampling rate which is a multiple of the signal's sampling rate would allow for a perfect reconstruction of the signal
...
So, 44.1 kHz -> 88.2 kHz would work. 44.1 kHz -> 48 kHz or 192 kHz won't work. OK, they would work, but the interpolation won't be perfect.
That's a myth. Summing up 3dsnars post with other words:
The quality of the resampling is dictated by the quality of the used FIR filter (frequency response, phase and impulse response). It has nothing to do with sample rate ratio.

Apart from that you have some added requantization noise, but that can be minimized using 24bit or floating point processing with noise shaped dither to 16bit afterwards.
Raptus is offline   Reply With Quote
Old 12th November 2007, 22:23   #7  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
@3dsnar and @Raptus,

do you happen to have a link to free source code which does resampling by using high quality FIR filters?

Thanks!
madshi is offline   Reply With Quote
Old 13th November 2007, 07:18   #8  |  Link
Maccara
Registered User
 
Join Date: Dec 2001
Posts: 145
Quote:
Originally Posted by Terranigma View Post
Would copying (instead of resampling) the wave spectrum from 44100khz to a blank 48000khz file be a workaround?
No. It will need resampling (cooledit/audition does this automatically).
Maccara is offline   Reply With Quote
Old 13th November 2007, 09:14   #9  |  Link
Raptus
heretic nuB
 
Join Date: Sep 2003
Posts: 71
@madshi: Try SSRC: http://shibatch.sourceforge.net/
PPHS would also be interesting for faster speed and arbitrary sample rate conversion, but AFAIK it's not OpenSource.
Raptus is offline   Reply With Quote
Old 13th November 2007, 09:41   #10  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Raptus View Post
@madshi: Try SSRC: http://shibatch.sourceforge.net/
PPHS would also be interesting for faster speed and arbitrary sample rate conversion, but AFAIK it's not OpenSource.
Thank you!

Did some searching and found that r8brain comes with a free to use win32 dll. It's not open source, but my main need is a free and easy way to add high quality resampling to my win32 freeware. So now I have to decide whether to use SSRC or r8brain...
madshi is offline   Reply With Quote
Old 13th November 2007, 10:24   #11  |  Link
Raptus
heretic nuB
 
Join Date: Sep 2003
Posts: 71
Both SSRC and R8brain seem excellent choices, judging by the graphs shown here and here, which show the spectrum of a sinesweep resampled from 96Khz to 44.1 over time, revealing noise and frequency fold-backs caused by improper filtering. Shocking to see so many expensive pro audio software behaving really bad

EDIT: Just saw that the passband/transition of r8brain free isn't ideal, probably also the phase. Can't have everything I suppose...

Last edited by Raptus; 13th November 2007 at 10:34.
Raptus is offline   Reply With Quote
Old 13th November 2007, 10:56   #12  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Raptus View Post
EDIT: Just saw that the passband/transition of r8brain free isn't ideal, probably also the phase. Can't have everything I suppose...
Now if only I knew what this meant practically... Too bad I'm a noob with these kind of graphs.

The main purpose I need the resampling for is for undoing PAL speedup (so basically I need to slow audio down by roughly 4%). Do those graphs help deciding whether r8brain or SSRC would be the better choice (quality wise)? I don't care much about processing time. Only the quality is important.

Thank you!!
madshi is offline   Reply With Quote
Old 13th November 2007, 11:22   #13  |  Link
Raptus
heretic nuB
 
Join Date: Sep 2003
Posts: 71
It means that the frequency response is okay-ish, the roll-off starts a bit early (just above 18Khz), good would be above 20Khz, excellent above 21Khz. Some golden ears *might* ABX a difference.

But that matters only for 44.1Khz. If your are resampling audio at 48Khz or from higher rate to 48Khz this becomes less of an issue because the roll-off is shifted up.

So, answering your question: Yes, _I_ would go with r8brain free in spite of the issue mentioned, because it's other qualities are excellent. I would recommend that the users don't go below 48Khz, though.

Last edited by Raptus; 13th November 2007 at 11:30.
Raptus is offline   Reply With Quote
Old 13th November 2007, 11:41   #14  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Raptus View Post
So, answering your question: Yes, _I_ would go with r8brain free in spite of the issue mentioned, because it's other qualities are excellent. I would recommend that the users don't go below 48Khz, though.
Thanks for your help!

The most often used conversion in my tool will be from 48000 to 46033.92 (25.000 -> 23.976). Would you still go with r8brain in this situation?
madshi is offline   Reply With Quote
Old 13th November 2007, 11:51   #15  |  Link
Raptus
heretic nuB
 
Join Date: Sep 2003
Posts: 71
Quote:
Originally Posted by madshi View Post
The most often used conversion in my tool will be from 48000 to 46033.92 (25.000 -> 23.976).
That's the wrong way
Remember that you would be playing back the 46033Hz signal at 48Khz, so it would be faster, not slower. You should do it the other way, from 48Khz to 50050.05Hz, and then play back that signal at 48Khz, hence slower.

If r8brain supports this sample rates, I would use it.

EDIT: spelling, jeez.

Last edited by Raptus; 13th November 2007 at 11:59.
Raptus is offline   Reply With Quote
Old 13th November 2007, 12:00   #16  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Oooooooopsie... Thanks!
madshi is offline   Reply With Quote
Old 13th November 2007, 12:06   #17  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Might be a bit OT, but since some experts are already listening I'll ask here:

I'm wondering, for undoing PAL speedup. Do I need to calculate with "23.976" or with "24.000 / 1.001"? You know, it's slightly different. In the first case I'd resample from 48000 to "50050,05005005005005...". In the latter case I'd resample from 48000 to exactly 50050.

I guess my real question is: Are DVDs mastered to 23.976 or are they mastered to 24.000 / 1.001?

(P.S: r8brain supports floating point output sample rate, so "50050,05005..." would be possible).
madshi is offline   Reply With Quote
Old 13th November 2007, 12:13   #18  |  Link
Raptus
heretic nuB
 
Join Date: Sep 2003
Posts: 71
The spec states x/1.001, where x = 24, 30 or 60.

Even if some discs don't follow the spec, the difference would be only 0.172 frames after 2 hours of film

Last edited by Raptus; 13th November 2007 at 12:18.
Raptus is offline   Reply With Quote
Old 13th November 2007, 12:29   #19  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Raptus View Post
The spec states x/1.001, where x = 24, 30 or 60.
Thank you.

Quote:
Originally Posted by Raptus View Post
Even if some discs don't follow the spec, the difference would be only 0.172 frames after 2 hours of film
Ok, that would be about 7ms. I guess I can live with that...
madshi is offline   Reply With Quote
Old 13th November 2007, 12:36   #20  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by madshi View Post
The main purpose I need the resampling for is for undoing PAL speedup (so basically I need to slow audio down by roughly 4%).
I don't understand for what you need resamplig to slow/speedup the audio (PAL <> NTSC video framerate). This method don't preserve the pitch. Or is part of a more complex process?
tebasuna51 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:03.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.