Does anyone know where I can find some of the better PCM WAV resamplers
(going from a lower freq. to higher)? I've created a command-line based
resampler that will resample a PCM WAV to twice its frequency... and do it
ALOT better than Soundforge, Cool Edit, etc. I've used it on a 11,025Hz
file recursively (11,025Hz -> 22,050Hz -> 44,100Hz), and the end result was
VERY good. I'm looking for something to compare my software against as far
as quality goes... thanks.
BTW... the only one I've tried so far is at
http://shibatch.sourceforge.net/, and it's not much better that resampling a
11,025Hz to 44,100Hz in Soundforge 7.0.
Respectfully,
Eric D. Brown
|
|
0
|
|
|
|
Reply
|
Eric
|
2/16/2004 10:55:48 AM |
|
Eric D. Brown wrote:
> Does anyone know where I can find some of the better PCM WAV resamplers
> (going from a lower freq. to higher)?
You mean "where can I found sample interpolation software"? The SoX
converter uses the Smith & Wesson Bandwidth-Limited Interpolation algorithm.
The sox source code has this in resample.c:
* Sound Tools rate change effect file.
* Spiffy rate changer using Smith & Wesson Bandwidth-Limited Interpolation.
* The algorithm is described in "Bandlimited Interpolation -
* Introduction and Algorithm" by Julian O. Smith III.
* Available on ccrma-ftp.stanford.edu as
* pub/BandlimitedInterpolation.eps.Z or similar.
*
* The latest stand alone version of this algorithm can be found
* at ftp://ccrma-ftp.stanford.edu/pub/NeXT/
* under the name of resample-version.number.tar.Z
You can make SoX resample like so:
$ sox -r 11025 input.wav -r 44100 output.wav resample -ql
Regards
Stuart
|
|
0
|
|
|
|
Reply
|
Stuart
|
2/16/2004 12:37:07 PM
|
|
On Mon, 16 Feb 2004, Eric D. Brown wrote:
> Does anyone know where I can find some of the better PCM WAV resamplers
> (going from a lower freq. to higher)? I've created a command-line based
> resampler that will resample a PCM WAV to twice its frequency... and do it
> ALOT better than Soundforge, Cool Edit, etc. I've used it on a 11,025Hz
> file recursively (11,025Hz -> 22,050Hz -> 44,100Hz), and the end result was
> VERY good. I'm looking for something to compare my software against as far
> as quality goes... thanks.
IMO "Cool Edit" and "SSRC" resample VERY GOOD.
BTW:
I don't know how you resample by factor 2 but let me tell
you that the lowpass filter for your 2nd stage (22->44)
does not need to be as steep as the first one because the
22 khz signal does not contain frequencies in the region
5.5-11 kHz since you derived it from a 11 khz signal.
You could simplify the lowpass filters for non-1st-stages
to increase speed. A passband of 0-5.5 kHz and a stopband
of 11-22 kHz is sufficient.
> BTW... the only one I've tried so far is at
> http://shibatch.sourceforge.net/, and it's not much better that
> resampling a11,025Hz to 44,100Hz in Soundforge 7.0.
Then you should give "Cool Edit" a try.
(although SSRC is good - at least for 48->44,1 kHz conversion)
Tell me, how you measure how well a resampling app performs.
What exactly do you mean by "mine is better than that" ?
Ghis!
Sebastian
|
|
0
|
|
|
|
Reply
|
Sebastian
|
2/16/2004 1:10:25 PM
|
|
Sebastian Gesemann wrote:
> Tell me, how you measure how well a resampling app performs.
> What exactly do you mean by "mine is better than that" ?
Basically, I'm just using my 'ol ear as the test tool. When you up the freq
from 11Khz to 44Khz, the sound still seems dull. That's because most
software usually just rounds the averages between the existing information
(from the 11Khz). I've come up with a pretty neat little way of restoring
(of course, it's near impossible to get near the original... since there's a
significant amount of lost data from a 44Khz to 11Khz conversion) the
"illusion" (more appropriate, I suppose) of reviving the high frequencies.
Here... I'll post some links to some examples of an audio clip resampled
with my software. I've come up with 2 algorithms that construct data... the
first one keeps the data AS close to the original 11Khz file as possible,
while estimating the lost data (if you pull up a window with Soundforge 7.0,
the data using my first algorithm will "visually" resemble the source). The
second algorithm uses a more "make it sound better... regardless if it's not
similar to its original" approach. Anyhow, listen for yourself... I'd like
any feedback. (BTW... the samples below are 8-bit).
NOTE: I've kept the audio in WAV format, so the download may be long for
individuals on a dial-up connection.
Here is the original 11,025Hz stereo audio file (a clip from the song "Round
Round"):
http://www.frozenx.com/11025.wav
Here it is, resampled to 44,100Hz stereo using SSRC (two-pass):
http://www.frozenx.com/ssrc_44100.wav
And, here it is resampled to 44,100Hz stereo using my second algorithm:
http://www.frozenx.com/opt_44100.wav
Respectfully,
Eric D. Brown
|
|
0
|
|
|
|
Reply
|
Eric
|
2/16/2004 10:00:51 PM
|
|
Also, I should note... since the original was 11,025Hz, the 22,050Hz sounds
ALOT better resampled with my software (compared to 22,050Hz from SSRC). On
the 44,100Hz, I had to "resample" the audio that was already "resampled"
using my method; therefore, it somewhat "amplifies" some of the quantum hiss
that 8-bit audio leaves behind, and any flaws in my algorithm. Again, I
just stumbled upon this yesterday... and was working most of the day to
perfect it as much as I could. I'm going to keep working with it to see if
I can make it better! I REALLY should've posted the 11Khz to 22Khz samples
instead; however, the 44Khz is quite a jump... and I think my software did
pretty good in comparison with SSRC.
So, again... you get the best quality (right now, anyways), from just
running my algorithm once (from 8Khz to 16Khz, 11 to 22, 22 to 44, etc.).
Also, you don't really gain any audible differences when resampling to
higher that 44Khz.
Respectfully,
Eric D. Brown
|
|
0
|
|
|
|
Reply
|
Eric
|
2/16/2004 10:15:18 PM
|
|
In article <10318dalcmsbfa@corp.supernews.com>,
Eric D. Brown <nospam@nowhere.com> wrote:
>Does anyone know where I can find some of the better PCM WAV resamplers
Try this: http://www.vlsi.fi/products/vssrc.htm
-Pasi
--
/Dreams can be as real as events. Or so it seemed to me afterwards./
-- Lestat in "The Tale of the Body Thief"
|
|
0
|
|
|
|
Reply
|
albert
|
2/17/2004 10:35:33 AM
|
|
In article <1032fcfp2kh1502@corp.supernews.com>,
Eric D. Brown <nospam@nowhere.com> wrote:
>Basically, I'm just using my 'ol ear as the test tool. When you up the freq
>from 11Khz to 44Khz, the sound still seems dull. That's because most
>software usually just rounds the averages between the existing information
>(from the 11Khz).
You should study a little sampling theory. "rounds the averages" is
not the proper term and some ad-hoc resampling algorithm just
violates the signal when there exists the right way to do it.
>"illusion" (more appropriate, I suppose) of reviving the high frequencies.
You are not allowed to do that! You are creating frequencies that are
simply not there in the data.
>the data using my first algorithm will "visually" resemble the source). The
>second algorithm uses a more "make it sound better... regardless if it's not
>similar to its original" approach. Anyhow, listen for yourself... I'd like
>any feedback. (BTW... the samples below are 8-bit).
Sorry, but there is horrible aliasing in the opt_44100.wav file.
It is not in any way 'better'.
Read the sample rate conversion tutorial from
http://www.vlsi.fi/other/VS_SRC/SampleRateTutorial.html
to get you on track.
-Pasi
--
"I do love him, but ... He is very far away, Nynaeve. In the Waste,
surrounded by a thousand Maidens of the Spear who jump to do his
bidding. I cannot see him, or speak to him, or touch him."
-- Elayne in The Wheel of Time:"The Fires of Heaven"
|
|
0
|
|
|
|
Reply
|
albert
|
2/17/2004 10:47:28 AM
|
|
Eric D. Brown wrote:
> Does anyone know where I can find some of the better PCM WAV resamplers
> (going from a lower freq. to higher)? I've created a command-line based
> resampler that will resample a PCM WAV to twice its frequency... and do it
> ALOT better than Soundforge, Cool Edit, etc. I've used it on a 11,025Hz
> file recursively (11,025Hz -> 22,050Hz -> 44,100Hz), and the end result was
> VERY good. I'm looking for something to compare my software against as far
> as quality goes... thanks.
>
> BTW... the only one I've tried so far is at
> http://shibatch.sourceforge.net/, and it's not much better that resampling a
> 11,025Hz to 44,100Hz in Soundforge 7.0.
>
> Respectfully,
>
> Eric D. Brown
>
>
Have you tried rateconv?
--
Michel Bardiaux
Peaktime Belgium S.A. Bd. du Souverain, 191 B-1160 Bruxelles
Tel : +32 2 790.29.41
|
|
0
|
|
|
|
Reply
|
Michel
|
2/17/2004 12:30:45 PM
|
|
Ojala Pasi 'Albert wrote:
) You are not allowed to do that! You are creating frequencies that are
) simply not there in the data.
Sure I am... you see, when going from a 11Khz to 44Khz, ANYTHING you add to
the audio is "simply not there in the data". It doesn't matter what method
you use, it can ONLY estimate. How do you know the frequencies weren't
there? There are standard interpolation algorithms that have been used for
this very purpose, as in SoX; however, the converted audio still seems
muffled and dull. Mine may have alot of aliasing in it, but I haven't done
any filtering of the audio.
I'm far from finishing work on what I'm "trying" to do... and it keeps
getting better. Again, I have two algorithms I'm using... I simply gave the
samples of the one I, personally, thought sounded better. After working
with it again, all night, I've relistened to the samples I provided... and I
could've done ALOT better. That particular sample doesn't sound very
well... I admit.
Anyhow, I appreciate your feedback... but even though some feel that I may
be going about it all wrong, I'm still going to give it a shot!
Respectfully,
Eric D. Brown
|
|
0
|
|
|
|
Reply
|
Eric
|
2/17/2004 1:22:25 PM
|
|
Alright, I'm posting yet ANOTHER sample... this time, it's a conversion from
11,025hz to 22,050hz in 16-bit stereo (this way, we won't get much of the
hissing from the 8-bit conversions).
Here is the sample AFTER I tried the VSSRC32.EXE that you recommended, Mr.
Pasi:
http://www.frozenx.com/22050_vssrc32.wav
And, here it is ran through my algorithm:
http://www.frozenx.com/22050_opt.wav
Now, if you had to chose which quality you HAD to listen to all day long (of
those two), which would you pick?
Respectfully,
Eric D. Brown
|
|
0
|
|
|
|
Reply
|
Eric
|
2/17/2004 1:49:55 PM
|
|
On Tue, 17 Feb 2004, Eric D. Brown wrote:
> Ojala Pasi 'Albert wrote:
>
> ) You are not allowed to do that! You are creating frequencies that are
> ) simply not there in the data.
>
> Sure I am... you see, when going from a 11Khz to 44Khz, ANYTHING you add to
Resampling isn't about adding somthing. It's about changing the
sampling rate while keeping as much as possible of the original
spectrum without introducing much aliasing.
> the audio is "simply not there in the data". It doesn't matter what method
> you use, it can ONLY estimate. How do you know the frequencies weren't
This is one point of view.
Please learn something about
- Sampling Theorem
- Zero-Stuffing (what happens here?)
- Undersampling (what happens if you throw every 2nd sample away?)
- Lowpass filter (sinc aka sin(t)/t and stuff)
> there? There are standard interpolation algorithms that have been used for
> this very purpose, as in SoX; however, the converted audio still seems
> muffled and dull. Mine may have alot of aliasing in it, but I haven't done
> any filtering of the audio.
Actually it's supposed to sound dull because proper upsampling
algorithms don't add something to make is sound brighter.
Some years ago, I tried some interpolation shemes for myself and I can
agree that simple cubic-interpolation sounds in most cases better than
doing it the right way. But in some cases it sounds really awfull.
Why does it *sound* better in most cases ?
Because most audio signals contain noise in the upper part which is
mirrord at the original nyquist freqency, poorly lowpassfilterd and
therefore noticable as alias. It actually sounds not bad in case it's
only noise that hasn't been "mirrored" - leading to a brigher
sound image.
Try feeding your algorithm with a sine sweep from 0-nyquist. I think
it'll sound awfull. Feed Cool Edit with a sines weep, upsample by
fyctor 2 and look at the spectrum view - that's how it's supposed to
look/sound when things go right. (nearly no alias)
> Anyhow, I appreciate your feedback... but even though some feel that I may
> be going about it all wrong, I'm still going to give it a shot!
It's not my intention to discourage you in any way.
So, go ahead, enjoy your learning by doing.
Ghis!
Sebastian
--
PGP-Key-ID (long): 572B1778A4CA0707
|
|
0
|
|
|
|
Reply
|
Sebastian
|
2/17/2004 3:18:44 PM
|
|
On Tue, 17 Feb 2004, Sebastian Gesemann wrote:
> Why does it *sound* better in most cases ?
> Because most audio signals contain noise in the upper part which is
> mirrord at the original nyquist freqency, poorly lowpassfilterd and
> therefore noticable as alias. It actually sounds not bad in case it's
> only noise that hasn't been "mirrored" - leading to a brigher
> sound image.
oupsi... i meant "...only noise that HAS been..."
Ghis!
Sebastian
--
PGP-Key-ID (long): 572B1778A4CA0707
|
|
0
|
|
|
|
Reply
|
Sebastian
|
2/17/2004 3:25:38 PM
|
|
Sebastian Gesemann wrote:
) Try feeding your algorithm with a sine sweep from 0-nyquist. I think
) it'll sound awfull. Feed Cool Edit with a sines weep, upsample by
) fyctor 2 and look at the spectrum view - that's how it's supposed to
) look/sound when things go right. (nearly no alias)
Sebastian, I found the sweep at
http://www2.ocn.ne.jp/~mp3lab/exp_lab/vorbis_sweep/vorbis_sweep.html, and am
prepairing to run it through; however, forgive me for asking an ametuer
question (which I definitely am)... but what do I need to do with it? I
don't have Cool Edit... only Sony Soundforge 7.0. Do I need to resample the
sinewave down to 22Khz first, then run it through my interpolation at 44Khz?
Won't using Soundforge to desample the sweep distort it? Hahaha... I'm like
a lost pigeon in the North Pole.
What I've already done (and I'm sure this probably isn't right) was to just
keep the sweep as is, and ran it through my interpolation algorithms with an
output to 88200hz. I then opened these outcome with Soundforge, and
performed a "volume increase" on them so that I could visually see the audio
data with Soundforge.
On my second algorithm (which is what I used for all my samples posted
within the newsgroups), the sweep started normally and eventually grew in db
as it neared the end.
My first algorithm, looked just like the original sweep.wav... it stayed
constant all the way through.
I also downloaded the .ogg samples they had on that URL (above) and opened
them in SF 7.0, and viewed the data also. Towards the end of the sweep... I
saw the distortion (similar to what they described on the site).
So, correct me if I'm wrong... but when I'm working with interpolation, do I
want to keep the output sweep as close to the original sweep as possible?
Thanks...
Respectfully,
Eric D. Brown
|
|
0
|
|
|
|
Reply
|
Eric
|
2/17/2004 5:20:47 PM
|
|
On Tue, 17 Feb 2004, Eric D. Brown wrote:
> Sebastian Gesemann wrote:
>
> ) Try feeding your algorithm with a sine sweep from 0-nyquist. I think
> ) it'll sound awfull. Feed Cool Edit with a sine weep, upsample by
> ) fyctor 2 and look at the spectrum view - that's how it's supposed to
> ) look/sound when things go right. (nearly no alias)
>
> Sebastian, I found the sweep at
> http://www2.ocn.ne.jp/~mp3lab/exp_lab/vorbis_sweep/vorbis_sweep.html,
> and am prepairing to run it through; however, forgive me for asking
> an ametuer question (which I definitely am)... but what do I need to
> do with it? I don't have Cool Edit... only Sony Soundforge 7.0. Do I
> need to resample the sinewave down to 22Khz first, then run it through
> my interpolation at 44Khz?
you don't have to resample this one.
just change the sampling rate to 11kHz.
(and by "just change the sampling rate" i mean: tell Soundforge
to play/save the file at 11kHz - should be possible somehow)
> What I've already done (and I'm sure this probably isn't right) was to just
> keep the sweep as is, and ran it through my interpolation algorithms with an
> output to 88200hz. I then opened these outcome with Soundforge, and
> performed a "volume increase" on them so that I could visually see the audio
> data with Soundforge.
So far so good. But to be able to hear what your algorithm has done,
you have to lower the sampling rate (again *without* resampling - just
slow down playback (ie 22kHz or so) so you can hear the aliasing signal.
> Correct me if I'm wrong... but when I'm working with interpolation, do I
> want to keep the output sweep as close to the original sweep as possible?
Try thinking in the frequency domain for a change and leave the time
domain. If your source signal is a sine at 4 kHz sampled at 11.025 kHz
The resampled (22.05kHz) version should still be a 4 kHz sine with the
same amplitude (and usually the same phase offset, too).
(One of Cool-Edit's great features is the spectral view)
You'll notice a second sine (7,025kHz in this case) using your program.
This is the aliasing part we usually don't want to hear after
upsampling but keeps noticeable if you don't properly lowpass-filter
the signal.
BTW: You're aware of the fact that the newsgroup comp.dsp is a more
convenient place to discuss this subject than comp.compression,
right ?
Ghis!
Sebastian
--
PGP-Key-ID (long): 572B1778A4CA0707
|
|
0
|
|
|
|
Reply
|
Sebastian
|
2/18/2004 4:40:54 PM
|
|
"Eric D. Brown" <nospam@nowhere.com> wrote in message
news:10318dalcmsbfa@corp.supernews.com...
> Does anyone know where I can find some of the better PCM WAV resamplers
> (going from a lower freq. to higher)? I've created a command-line based
> resampler that will resample a PCM WAV to twice its frequency... and do it
> ALOT better than Soundforge, Cool Edit, etc. I've used it on a 11,025Hz
> file recursively (11,025Hz -> 22,050Hz -> 44,100Hz), and the end result was
> VERY good. I'm looking for something to compare my software against as far
> as quality goes... thanks.
>
> BTW... the only one I've tried so far is at
> http://shibatch.sourceforge.net/, and it's not much better that resampling a
> 11,025Hz to 44,100Hz in Soundforge 7.0.
Given the rest of the thread, it's obvious you are confused about what
resampling is. Your tool looks like a primite spectral reconstructor,
not a resampler.
In any case, a standard testfile is
http://sjeng.org/ftp/work/udial.wav
(DO NOT play this back at high volume in a system with tweeters!)
When playing back, you should only hear the dialtones. (If you
hear something else, you either have bat ears or your soundcard
is resampling to 48kHz, and badly so).
After resampling to 48kHz, you should still only hear the
dialtones. A bad resampler will add an 'ambulance' sound.
SSRC, Cool Edit 2 and Sound Forge 6 all pass this test.
--
GCP
|
|
0
|
|
|
|
Reply
|
Gian
|
2/22/2004 6:51:55 PM
|
|
> Here is the sample AFTER I tried the VSSRC32.EXE that you recommended, Mr.
> Pasi:
> http://www.frozenx.com/22050_vssrc32.wav
>
> And, here it is ran through my algorithm:
> http://www.frozenx.com/22050_opt.wav
>
> Now, if you had to chose which quality you HAD to listen to all day long (of
> those two), which would you pick?
Your version makes my head hurt.
It's aliasing all over - a quick look at the spectrum
confirms that.
Take a look at the udial sample - you'll find your
'resampler' adds sounds that aren't there in the
original - and most important, shouldn't be there!
--
GCP
|
|
0
|
|
|
|
Reply
|
Gian
|
2/22/2004 7:03:55 PM
|
|
|
15 Replies
464 Views
(page loaded in 1.9 seconds)
|