IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
LAME's resampling leaves something to be desired
eamon123
post Oct 15 2012, 20:16
Post #1





Group: Members
Posts: 30
Joined: 14-October 12
Member No.: 103838



http://shibatch.sourceforge.net/ is a good resampler. It beats lame in quality every time. Here is an example:

Yes I retested Baba O'Reilly and it sounded noticibly better with ssrc.

I did

FLAC 88.2 > lame.exe -S --noreplaygain -b 32 --lowpass 10 --resample 24 - %d
VS
FLAC 88.2 > WAV > ssrc.exe --rate 24000 --bits 16 > lame.exe -S --noreplaygain -b 32 --lowpass 10 - %d

in ABX and got 14/16 (0.2% prob of guessing). I was hearing a whole different type of artifact that I have either never heard before or just never listened for before. I was 5/2 up when I started listening to the bass drum and it just sounded fuller, warmer and louder in ssrc. It was then that I noticed that there was a shrill artifact at about 9 kHz at the same time as the drum beat in question. It was obvious in both files, but louder in the LAME version. Up until now the bass drum "masked" it, "masking" is seriously like an aural illusion, that bass drum sounded fine before I heard the shrill in one and then I heard it in the other, I was dumbfounded! After that I just listened for that beep and the louder one was LAME. LAME should really look into their resampler, a lot of people are downsamping high res FLACs these days!

I feel like I did the first time I discovered that I had a blind spot on my retina that I could "discover" at will with carefully engineered designs and some ordinated displacement of said designs. Discovering the nature of my aural blind spots first hand I can only describe myself as feeling enlightened!

Maybe that shrill noise is due to a crappy lpf in LAME?

https://rapidshare.com/files/1612342437/ssrc.vs.lame.zip





ssrc is foss, maybe the LAME devs would like to copy some of it's code?
Go to the top of the page
+Quote Post
eamon123
post Oct 16 2012, 11:49
Post #2





Group: Members
Posts: 30
Joined: 14-October 12
Member No.: 103838



Go to the top of the page
+Quote Post
pdq
post Oct 16 2012, 15:36
Post #3





Group: Members
Posts: 3443
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



Since the differences seem to be localized to frequencies very close to fs/2, and since this is followed by perceptual encoding, isn't it possible that what you are seeing is not necessarily due to differences in the quality of resampling?

IOW, something innocuous like the steepness of the cutoff could allow or not allow frequencies that cause encoding problems to be present, and this causes artifacts in one that are not present or significantly reduced in the other.

What I am saying is that the perceptual encoding step could completely invalidate a comparison of the quality of resampling (though I don't see any other way to test the resampling algorithm in lame).
Go to the top of the page
+Quote Post
eamon123
post Oct 17 2012, 02:39
Post #4





Group: Members
Posts: 30
Joined: 14-October 12
Member No.: 103838



I'm using that as a particularly glaring example that I can show on the screen. If you listen to the two files, you can find extra artifacts in the LAME resampled file throughout. Do your own tests even. To quote someone else on the reason as to why this is the case:

QUOTE
What makes this probably worse than usual is that the kind of noise artefacts produced by bad digital filters can easily mislead lossy psycho-acoustically modelled encoders to allocate spectral buckets to these artefacts rather than "real" content.


QUOTE
something innocuous like the steepness of the cutoff

The only difference is the resampling algorithm so it must be something about the resampling process that is sub-standard.

QUOTE
Not all low pass filters are created equally, especially when the order of a "perfect" filter exceeds a few thousand, as few resamplers will bother with that.

To be sure you're not suffering from resampler implementation bias, you should do manual resampling with SSRC in "high quality" mode using the standalone tool written by SHIBATA Naoki.

Outside of proprietary closed-source resamplers, I'd assume anything less than Shibata's is broken. 44.1->48/32/24 resampling requires a relatively complex filter to do it "perfectly". (One of the reasons why 44.1KHz was chosen even though more "harmonic" values were known or even proposed at the time was precisely to make this kind of resampling "hard" for consumers.) The resampling ratio is a beast, in any event: 160:147 (for 44.1->48). EEs/DSP jocks will immediately understand the high order filter needed to do this job perfectly.


They both have the same cutoff, I specified --lowpass 10 which has a default range of 15%. The input wav from ssrc was cut off well above 11.5 kHz so after the lpf the cutoff in both is exactly the same.

This post has been edited by eamon123: Oct 17 2012, 02:53
Go to the top of the page
+Quote Post
saratoga
post Oct 17 2012, 02:55
Post #5





Group: Members
Posts: 5119
Joined: 2-September 02
Member No.: 3264



Does this still happen if you don't specify a lowpass filter in lame?
Go to the top of the page
+Quote Post
AndyH-ha
post Oct 17 2012, 03:25
Post #6





Group: Members
Posts: 2223
Joined: 31-August 05
Member No.: 24222



I looked at this once upon a time with simple test signals. The reconstructed wav files matched the originals well when there was no LAME resampling. Lame resamled signals showed a quite visible amount of aliasing, of the sort shown at
http://src.infinitewave.ca/
by some of the less able resamplers.
Go to the top of the page
+Quote Post
eamon123
post Oct 17 2012, 10:32
Post #7





Group: Members
Posts: 30
Joined: 14-October 12
Member No.: 103838



QUOTE (AndyH-ha @ Oct 17 2012, 03:25) *
I looked at this once upon a time with simple test signals. The reconstructed wav files matched the originals well when there was no LAME resampling. Lame resamled signals showed a quite visible amount of aliasing, of the sort shown at
http://src.infinitewave.ca/
by some of the less able resamplers.



Here are some tests done with this sweep tone http://www.audiocheck.net/download.php?fil..._-3dBFS_30s.wav at the following settings:

WAV > ssrc_hp.exe --rate 44100 --bits 16 --dither 0 > lame.exe -S --noreplaygain -b 320 - %d
Vs.
WAV > lame.exe -S --noreplaygain -b 320 --resample 44.1 - %d


IDEAL WAVEFORM

SSRC -> LAME WAVEFORM

LAME WAVEFORM

These waveform pictures speak for themselves.



IDEAL SPECTRAL

SSRC -> LAME SPECTRAL

LAME SPECTRAL

Note the scale on the left.

This post has been edited by eamon123: Oct 17 2012, 10:34
Go to the top of the page
+Quote Post
Destroid
post Oct 17 2012, 11:23
Post #8





Group: Members
Posts: 555
Joined: 4-June 02
Member No.: 2220



Spectrogram aside (which is notable), I also preferred down-sampling using FB2K's SSRC prior to encoding low-bitrate MP3's (80kbps stereo and 48kbps mono).

My own ABX is not very conclusive either, so call it paranoia smile.gif . Yet, I think it is possible to locate where LAME's internal re-sampling falls short in certain lower bit-rate areas.

OP: My advice is: instead of directly shoveling the (assumed) WAV directly to LAME at bitrates lower than 96kbps, just continue to use SSRC pre-processing function inside FB2K like you have been doing. I see no harm in that. Is it overkill? Maybe... or not? smile.gif


--------------------
"Something bothering you, Mister Spock?"
Go to the top of the page
+Quote Post

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: 27th November 2014 - 20:38