Help with resampling

Started by Harbinger, August 15, 2009, 00:20:38

Previous topic - Next topic

Harbinger

What is resampling? When do we need it? When shouldn't we use it? How does it work and when is it applied?

This information will need to go into the OHM but i've never bothered with it, so i don't know what to make of it.

uncloned

I believe resampling is:

consider a mono wave form at 44.1 kHz one second in length

it is a set of sequential numbers

if you want to recreate that sample with 22kHz quality one method is to skip every other data point. When you do that you have "resampled" that data to create an approximation of a lower quality sample.

I think one can get fancy with moving averages etc.

I could be wrong - its my understanding.

Sam_Zen

Resampling down to a lower resolution means skipping sample points one way or the other.
Resampling up is another thing.
Duplicating a sample point to fill the gap, or calculating something in between.
0.618033988

Harbinger

I think i've used the wrong term. In the Instrument page and the Player Options page, you can choose Linear phase, XXMS, Polyphase, etc. I saw the post that someone wrote up on it, but i didn't understand how all this works and why we would use it.

g

Those are basically the algorithms used for resampling. I usually stick with the default Polyphase (at least that's my default) unless I get some clicks (can happen when volume fading bass samples) in which case I try some XMMS. If I want 8-bit sound I use no resampling. Spline and Linear are afaik not really useful, I see them as legacy.

While on the subject, shouldn't the default setting be saved with the songs? I mean if we want songs to sound *exactly* the same on different computers...

Saga Musix

g, I will refuse to add another silly OpenMPT-only feature to IT, XM and whatever files, but it might be possible for MPTM to add. However, that's IMHO what the instrument settings are for, because normally you would also choose the best resampling option for your CPU (which is, to be honest, a bit superficial these days).

Oh, and Harbinger, please don't demand exact definitions of each resampling mode, because it's a shitload of maths which you could easily look up on wikipedia and that nobody is really interested in. :P ;)
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

LPChip

For information that is actually relevant to be put in the manual, set it like this:

Resampling is used to calculate how that sample is being heard at other frequencies. Without resampling, it can sound bad when you have high quality samples. For that reason, the default is best in about all situations.

You might want to go for none or linear when you work with chiptunes, because they usually sound better without, as they require that sharp sound, and the designer might've aimed for that sound, especially if the sounds are low quality.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

QuoteWithout resampling, it can sound bad when you have high quality samples.
WHAT? High quality samples do not need resampling. Low quality samples need resampling if they should not sound fuzzy. The thing about high quality is that it is already resampled. :P

EDIT: ModPlug's wording is very bad here, it should be "interpolation" like with all other programs. Low quality samples obviously "miss" information, so this information has to be restored. And that's done by doing interpolation between 2 or more points of the sample. High quality samples obviously don't lack information, so they can usally be used without resampling.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

LPChip

Quote from: "Jojo"
QuoteWithout resampling, it can sound bad when you have high quality samples.
WHAT? High quality samples do not need resampling. Low quality samples need resampling if they should not sound fuzzy. The thing about high quality is that it is already resampled. :P

If high quality samples don't need resampling, then why do we still have such option? True, for backwards compatibility... I guess we need to shed a bit of light on this issue. I always thought you needed the resampling or it wouldn't sound good.
"Heh, maybe I should've joined the compo only because it would've meant I wouldn't have had to worry about a damn EQ or compressor for a change. " - Atlantis
"yes.. I think in this case it was wishful thinking: MPT is makng my life hard so it must be wrong" - Rewbs

Saga Musix

Read the edited part of my previous post, I hope it explains everything.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

g

Quote from: "Jojo"g, I will refuse to add another silly OpenMPT-only feature to IT, XM and whatever files, but it might be possible for MPTM to add.
Generally when I speak of OpenMPT-specific features I mean MPTM. Another option would be that rather having "default" as a setting at all, the default setting (from the player settings" would be selected by default. E.g. in my case, if I select "default" on the instrument tab it would revert directly to polyphase (because that's my default setting).

Harbinger

Quote from: "Jojo"Oh, and Harbinger, please don't demand exact definitions of each resampling mode, because it's a shitload of maths which you could easily look up on wikipedia and that nobody is really interested in. :P ;)

First of all i'm not demanding anything.

Second of all, i'm not looking for exact definitions, just practical ones.

Thirdly, how am i supposed to know that wikipedia is going to have answers for specific functions of any given application?!

Fourthly, who are YOU to decide who's interested. I AM!

Fifthly, how does the syntax and wording of your question match your little emoticons? Are they supposed to alleviate your negative statements?

Sixthly, leave the profanity for your bathroom. We're civilized here.

Seventhly, before you post, check to make sure that what your about to put into the forum is helpful or at least positive. Otherwise, just delete it out of your mind and take out your moodiness on someone else.

Eighthly, oh, you don't like being told what to do. Neither do I!

Ninthly, out of all people that could have helped with determining how we should best use this resampling/interpolation, it would be you. But i'll do without the knowledge in your brain if i can avoid the crappy attitude. If you offer positive help and knowledge, you have our undying respect. If you're not interested in our respect, begin braying like you did here. :x

Quote from: "Jojo"
ModPlug's wording is very bad here, it should be "interpolation" like with all other programs. Low quality samples obviously "miss" information, so this information has to be restored. And that's done by doing interpolation between 2 or more points of the sample. High quality samples obviously don't lack information, so they can usally be used without resampling.

Now that's what i need! Thank you! Why interject all that negativity -- you had the information all along. :wink:
I trust in the next build you'll trade the "resampling" term for "interpolation"; i agree -- that's a better more descriptive term.

Saga Musix

Quote
Thirdly, how am i supposed to know that wikipedia is going to have answers for specific functions of any given application?!
See, it's not like Olivier invented some terms that are specific to ModPlug.
http://en.wikipedia.org/wiki/Linear_interpolation
http://en.wikipedia.org/wiki/Spline_interpolation#Cubic_spline_interpolation
http://en.wikipedia.org/wiki/Polyphase_matrix (not sure if this is the right one as there's another article which could be the right one :P)
http://en.wikipedia.org/wiki/XMMS

Now that was easy, wasn't it?

QuoteFourthly, who are YOU to decide who's interested. I AM!
I never told you not to be interested in Interpolation algorithms. I just decided NOT to look up complex mathematical terms in the ModPlug sourceocode for you to show you how cubic spline interpolation works.

Quote
Fifthly, how does the syntax and wording of your question match your little emoticons? Are they supposed to alleviate your negative statements?
A "tongue" smiley is a warning for something called IRONY and "READ BETWEEN THE LINES", things that people nowadays seem to be not able to do anymore.

QuoteSixthly, leave the profanity for your bathroom. We're civilized here.
Sorry for prejudices, but I have indeed found out that many Americans seem to have a problem with this. I, for once, don't. And I don't care if other people have problems with words like "shitload".

QuoteSeventhly, before you post, check to make sure that what your about to put into the forum is helpful or at least positive. Otherwise, just delete it out of your mind and take out your moodiness on someone else.
Oh thanks, it's not like I've never posted in a forum and don't know how to post. :P (<--- WARNING! IRONY DETECTED!)

QuoteEighthly, oh, you don't like being told what to do. Neither do I!
I didn't tell you anything. I told you that you CAN look up interpolation algorithms on wikipedia, but you obviously did not get the message.

Quote
I trust in the next build you'll trade the "resampling" term for "interpolation"; i agree -- that's a better more descriptive term.
Well, I dunno if it should be changed for historic reasons, but then again, I just renamed a shitlo...errr, quite a bunch of variables in the sourcecode which had pretty bad names due to historic reasons!
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

LB

I don't know about you, but when people cuss, it gives me a bad impression on them. /out
Don't feed the bunnies. They will bring thier friends next time.

~MMF2 Developer user~
[color=green]LB-Stuff[/color] - My Website

Harbinger

I apologize for my "touchiness" (thanks uncloned! :x  :P ) but with Obama trying to wrestle away our liberties, and people classifying us as "mobsters", "nazis", and "racists" simply because we are petitioning our government and protesting their takeover of our personal lives, i'm a bit edgy these days. (Not to mention my life is about to be turned upside down soon.)

I still say people should choose their words more carefully. ::)

And Jojo, i rely heavily on your word. Either answer the question or don't, it's certainly your right to not help. But don't tease or mock for trying to find out everything; i told you from the beginning i wanted to know more than i needed to, so i could do this manual right. :wink:

Are we cool? 8)