IPB

Welcome Guest ( Log In | Register )

Sample rate conversion
MannyCalavera
post Apr 11 2011, 18:50
Post #1





Group: Members
Posts: 8
Joined: 18-July 07
Member No.: 45403



Hello everyone.

I have a question regarding sample rate conversion algorightms.
I don't know how they work, but I guess you guys are more familiar with this biggrin.gif

Let's say I have a 48 kHz wave file that I want to use in something I have to mix
with some 96 kHz material at certain places. This requires the 48 kHz file be resampled
and in the end back to 48.

So in short: does resampling 48 --> 96 --> 48 change the original or can the original
be restored 100% ?

I'm using Wavelab for this.
Go to the top of the page
+Quote Post
 
Start new topic
Replies
Wombat
post Apr 13 2011, 16:05
Post #2





Group: Members
Posts: 1085
Joined: 7-October 01
Member No.: 235



QUOTE (2Bdecided @ Apr 13 2011, 15:21) *
You can easily design it to do as you suggest, but that's not necessarily the way all are designed.


Afaik all resamplers apply another lowpass on upsampling, be it 2x or some strange number from 44.1 to 96kHz. So when this lowpass is applied all relation to a pattern in the source is gone. Otherwise weīll have an aliased, mirror above the sources max frequency. Isnīt it? And if not, what software does that creation of added 0s correctly?
Go to the top of the page
+Quote Post
bandpass
post Apr 13 2011, 20:25
Post #3





Group: Members
Posts: 353
Joined: 3-August 08
From: UK
Member No.: 56644



Given 10 seconds of 440Hz tone and upsampling from 48k to 96k, sox preserves the input samples in the output for all but the first and last 40-or-so samples. Of course, the test becomes more 'difficult' if the bit-depth or the tone frequency is increased.

CODE
sox -b 16 -n 1.wav synth 10
sox -D 1.wav 2.wav rate 96k
sox -c 2 -r 48k 2.wav 3.wav remix 1
cmp -l 1.wav 3.wav | wc -l

Go to the top of the page
+Quote Post
Wombat
post Apr 13 2011, 20:47
Post #4





Group: Members
Posts: 1085
Joined: 7-October 01
Member No.: 235



QUOTE (bandpass @ Apr 13 2011, 20:25) *
Given 10 seconds of 440Hz tone and upsampling from 48k to 96k, sox preserves the input samples in the output for all but the first and last 40-or-so samples. Of course, the test becomes more 'difficult' if the bit-depth or the tone frequency is increased.

CODE
sox -b 16 -n 1.wav synth 10
sox -D 1.wav 2.wav rate 96k
sox -c 2 -r 48k 2.wav 3.wav remix 1
cmp -l 1.wav 3.wav | wc -l


This must be lowpassed already even if i donīt know what -D does. You may have a look what sox does without lowpass.
http://www.hydrogenaudio.org/forums/index....st&p=675545

The resulting 2.wav looks lowpassed at 22-25kHz. Isnīt it?




This post has been edited by Wombat: Apr 13 2011, 21:22
Go to the top of the page
+Quote Post
bandpass
post Apr 13 2011, 21:19
Post #5





Group: Members
Posts: 353
Joined: 3-August 08
From: UK
Member No.: 56644



QUOTE
This must be lowpassed already even if i donīt know what -D does.
-D is to disable dithering (which would otherwise mess up the test). The only filter involved is that of the resampler (in the second line), applied after zero stuffing, a lowpass at just below the original nyquist (i.e. the standard method).

QUOTE
You may have a look what sox does without lowpass.

In fact, that shows a different resampler; with sox the resampling filter is not optional.
Go to the top of the page
+Quote Post

Posts in this topic
- MannyCalavera   Sample rate conversion   Apr 11 2011, 18:50
- - saratoga   QUOTE (MannyCalavera @ Apr 11 2011, 13:50...   Apr 11 2011, 18:58
- - Arnold B. Krueger   QUOTE (MannyCalavera @ Apr 11 2011, 13:50...   Apr 12 2011, 14:29
- - Axon   If you are just mixing, then you ought to be able ...   Apr 12 2011, 20:09
|- - 2Bdecided   QUOTE (Axon @ Apr 12 2011, 20:09) If the ...   Apr 13 2011, 15:21
|- - Axon   QUOTE (2Bdecided @ Apr 13 2011, 09:21) Th...   Apr 13 2011, 22:43
|- - Canar   QUOTE (Axon @ Apr 13 2011, 14:43) I think...   Apr 14 2011, 00:03
|- - Axon   QUOTE (Canar @ Apr 13 2011, 18:03) QUOTE ...   Apr 14 2011, 03:26
- - Wombat   QUOTE (2Bdecided @ Apr 13 2011, 15:21) Yo...   Apr 13 2011, 16:05
|- - bandpass   Given 10 seconds of 440Hz tone and upsampling from...   Apr 13 2011, 20:25
|- - Wombat   QUOTE (bandpass @ Apr 13 2011, 20:25) Giv...   Apr 13 2011, 20:47
|- - bandpass   QUOTE This must be lowpassed already even if i don...   Apr 13 2011, 21:19
- - Wombat   I admit i have no clue about some things you talk ...   Apr 14 2011, 00:44
|- - Canar   QUOTE (Wombat @ Apr 13 2011, 16:44) I adm...   Apr 14 2011, 00:52
||- - Wombat   QUOTE (Canar @ Apr 14 2011, 00:52) Sample...   Apr 14 2011, 00:58
||- - Canar   QUOTE (Wombat @ Apr 13 2011, 16:58) Exact...   Apr 14 2011, 01:03
|- - saratoga   QUOTE (Wombat @ Apr 13 2011, 19:44) I adm...   Apr 14 2011, 01:03
- - Wombat   QUOTE (saratoga @ Apr 14 2011, 01:03) Alt...   Apr 14 2011, 01:11
|- - saratoga   QUOTE (Wombat @ Apr 13 2011, 20:11) QUOTE...   Apr 14 2011, 01:17
|- - bandpass   QUOTE (saratoga @ Apr 14 2011, 01:17) Obv...   Apr 14 2011, 07:30
|- - Axon   QUOTE (bandpass @ Apr 14 2011, 01:30) QUO...   Apr 14 2011, 19:38
|- - bandpass   QUOTE (Axon @ Apr 14 2011, 19:38) Strictl...   Apr 14 2011, 20:24
- - Wombat   QUOTE (bandpass @ Apr 14 2011, 20:24) aft...   Apr 14 2011, 20:46
|- - bandpass   QUOTE (Wombat @ Apr 14 2011, 20:46) I sti...   Apr 14 2011, 22:16
|- - Alexey Lukin   QUOTE (bandpass @ Apr 14 2011, 17:16) Bec...   Apr 14 2011, 22:26
|- - Wombat   QUOTE (bandpass @ Apr 14 2011, 22:16) Usi...   Apr 14 2011, 22:27
|- - bandpass   QUOTE (Alexey Lukin @ Apr 14 2011, 22:26)...   Apr 15 2011, 07:18
- - Alexey Lukin   48 -> 96 kHz conversion may leave signal sample...   Apr 14 2011, 21:35
- - Wombat   QUOTE (Alexey Lukin @ Apr 14 2011, 21:35)...   Apr 14 2011, 21:49
- - Wombat   I am getting slowly mad in here or lowpass myself ...   Apr 14 2011, 22:49
|- - bandpass   Okay, curiousity got the better of me: in the 48k ...   Apr 15 2011, 10:39
- - Wombat   Many thanks bandpass for your efforts. Very intere...   Apr 15 2011, 16:24
- - Alexey Lukin   I've just verified that SoX never preserves th...   Apr 15 2011, 17:10
- - Wombat   QUOTE (Alexey Lukin @ Apr 15 2011, 17:10)...   Apr 15 2011, 18:11
|- - bandpass   All I have told you is what I have observed throug...   Apr 15 2011, 22:17
- - Alexey Lukin   This is only due to the fact that you used the sin...   Apr 16 2011, 06:27
- - bandpass   QUOTE (Alexey Lukin @ Apr 16 2011, 06:27)...   Apr 16 2011, 08:41
- - Alexey Lukin   Agreed.   Apr 16 2011, 08:45


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th November 2014 - 08:44