Interpolated and Lowpass Sound

The official forum for ZSNES documentation. Discuss future changes, mistakes, etc...
You can also join us on IRC at irc.freenode.net in #zsnes-docs.

Moderators: ZSNES Mods, ZSNES Doc Team

Post Reply
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Interpolated and Lowpass Sound

Post by xamenus »

Well, I haven't received any replies about this, and I haven't found some good definite info on Google or SnesCentral, so I'll ask here:

Does anyone have some good descriptions for the 3 types of sound interpolation (gaussian, cubic spline, 8 point) and the 3 lowpass filters (simple, dynamic, hi quality)? Thanks. :)
Last edited by xamenus on Sat Sep 30, 2006 1:11 am, edited 1 time in total.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

Well, quoting from SNESAmp:
Interpolation is a process applied to samples after they are decompressed to make a sound wave sound less harsh and more natural. A good example of interpolation is how it's used in the video of ZSNES. When the graphics of the SNES are displayed on your computer screen they look blocky, pixelated. By applying interpolation the graphics are smoothed out.

In SNESAmp there are three forms of interpolation: linear, cubic, and gaussian.

Linear is the simplest form of interpolation, but it rarely produces an accurate reproduction.

Cubic is based on the Hermite cubic polynomial. It's probably the best sounding of the three.

Gaussian is based on the Gaussian curve, and is the method used by the SNES. Some people don't like this form of interpolation because it makes low sampled sounds sound soft and undetailed.

You can look at http://www.alpha-ii.com/Info/AudioInt.html if you'd like to see some examples of what interpolation does to a soundwave.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Thanks, that's helpful. :)

That leaves 8-point interpolation and lowpass filtering...
Agozer
16-bit Corpse | Nyoron~
Posts: 3534
Joined: Sun Aug 01, 2004 7:14 pm
Location: Nokia Land

Post by Agozer »

IceFox wrote:Thanks, that's helpful. :)

That leaves 8-point interpolation and lowpass filtering...
Maybe you should check if Wikipedia has something on those subjects...
whicker: franpa is grammatically correct, and he still gets ripped on?
sweener2001: Grammatically correct this one time? sure. every other time? no. does that give him a right? not really.
Image
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Agozer wrote:
IceFox wrote:Thanks, that's helpful. :)

That leaves 8-point interpolation and lowpass filtering...
Maybe you should check if Wikipedia has something on those subjects...
Thanks, but I haven''t had any luck yet...
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

http://www.sonicspot.com/guide/synthesis.html - low pass filtering

It also has a nice description of what ADSR is (as it is currently emulated in ZSNES)

http://en.wikipedia.org/wiki/Interpolation - the mathematical definition

8 point interpolation I guess, would be getting 8 points and "smoothing" out the curve (I don't know exactly when this occurs, but I guess it's a basic definition of it)
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Well, I can't think of how it should be worded. Here's the section from the docs:
# Sound Interpolation - This feature smoothes out the wave forms of lower frequency sounds. You have at most 3 types to choose from:

* Gaussian - This method of interpolation, based on the gaussian curve, is used by the real SNES.
* Cubic Spline -
* 8-point Interpolation - Windows and Linux ports only.
# Low Pass Filter - This produces better bass in certain sound effects. However, the side effect is that the sound will overall be more muffled. You have at most 3 types to choose from:

* Simple -
* Dynamic -
* Hi Quality - Windows and Linux ports only.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

http://members.aol.com/g8orbyte/ozsounds.htm - This seems to be a good site to at least listen to the difference.

http://sycraft.org/content/audio/Sycraf ... readme.txt - some music that explains a little between dynamic and "hot" (I guess it is the equiv to high quality)

I'll try to give a basic explaination, from what I've read..

Gaussian - Based on the Gaussian curve, it smooths the transition of the sound effects.
Cubic Spline - This is also based on the Gaussian curve, but it improves on it by using better approximation. It prevents certain issues in the original curve.
8-point Interpolation - I guess it just gets 8 points (adaptive algorithm?) and tries to smooth it out.

Simple - Allows lower frequencies to pass through (like drums and the like). Certain higher ranges are not heard though.
Dynamic - Allows greater range of frequencies to pass through , the music will seem more detailed depending on the loudness or softness of the audio.
High Quality - Better than Simple... should be better for crappy speakers (maybe it should be tested thoroughly).
whicker
Trooper
Posts: 479
Joined: Sat Nov 27, 2004 4:33 am

Post by whicker »

Cubic spline is not the same as Gaussian smoothing. Gaussian smoothing is based on the "bell-shaped" curve (or half of it anyway), and afaik cubic spline uses a cubic equation (hence the name) to find the next sample point. Both look at 4 sample points for their interpolation equations.


Looking at the source, both gaussian and cubic spline use tables of discrete values, but I can't find 8-point. I would love to know the story on 8-point: Did somebody specifically go out and try to tune a better filter?

Gaussian duplicates what the APU uses internally, and the other two are "ear-candy". No interpolation selected (really linear) is for speed reasons only.

The low-pass filtering happens AFTER the core audio emulation, and attempts to duplicate a physical low-pass-filter op-amp circuit after the DAC. Different degrees of computational difficulty are selectable.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

OK, here's what I have now:

Code: Select all

# Sound Interpolation - This feature smoothes out the wave forms of lower frequency sounds. You have at most 3 types to choose from:

    * Gaussian - Based on the gaussian curve, it smooths the transition of the sound effects. This method of interpolation is used by a real SNES.
    * Cubic Spline - This method is calculated by a cubic equation rather than being based on a curve like the gaussian method. It uses better approximation than the gaussian method.
    * 8-point Interpolation - Windows and Linux ports only.

Code: Select all

# Low Pass Filter - This produces better bass in certain sound effects. However, the side effect is that the sound will overall be more muffled. You have at most 3 types to choose from:

    * Simple - Allows lower frequencies to pass through (like drums and the like). Certain higher ranges are not heard though.
    * Dynamic - Allows greater range of frequencies to pass through; the music will seem more detailed depending on the loudness or softness of the audio.
    * Hi Quality - Windows and Linux ports only. It's better than the simple filter, but is recommended for lower-end sound cards.
So is dynamic better than hi quality?

What is the order of these features from worst sounding to best sounding?
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

So is dynamic better than hi quality?
I don't know.. it depends what your tastes are in audio... Dynamic seems better for hi quality hardware (sound card+speakers) and if you have a good ear to listen to detail..

Hi Quality seems better for low quality speakers with a decent sound card (it's like pairing cheap $10 speakers with a SB Audigy 2, this mode would be useful here)

Of course, in the end, you should mention that the low pass filter option will probably be beneficial if you had a subwoofer.
What is the order of these features from worst sounding to best sounding?
The Sound Interpolation settings in the order you have listed are worst to best.

The Low Pass filter settings in the order you have listed are like this:

Simple (worst), Dynamic/Hi Quality (best, of your own preference)
-_pentium5.1_-
Lurker
Posts: 110
Joined: Sat Sep 04, 2004 7:55 pm
Location: USA

Post by -_pentium5.1_- »

IIRC the dynamic low-pass filter is currently broken and sometimes produces a buzzing type of distortion, so it should not be used.
This signature intentionally contains no text other than this sentence.
anomie
Lurker
Posts: 151
Joined: Tue Dec 07, 2004 1:40 am

Post by anomie »

Deathlike2 wrote:http://www.sonicspot.com/guide/synthesis.html - low pass filtering

It also has a nice description of what ADSR is (as it is currently emulated in ZSNES)
I don't know how it's implemented in ZSNES, but i didn't see anything in there that looked too much like the SNES's ADSR.

OT: In the SNES: The volume envelope value ranges from 0-2047. A (Attack) is linear as shown, and IIRC the 0->max time can vary from 62.5 us to 4.096 seconds. D (Decay) is a power curve though, at each iteration approximately E=E*255/256 (with an iteration at rates of 500Hz-32000Hz). S (Sustain) can be flat as shown, or can be a power curve as for D (iteration rates 15.625Hz-32000Hz), and the sustain level can be selected from max/8 to max in eighths. R (Release) occurs whenever the channel is keyed off (regardless of whether ADSR is being used or not), and is linear as shown (max->0 in about 0.008 seconds).

The SNES can also set the volume envelope level directly (0-2032 by 16s), or specify an adjustment method directly (linear increase/decrease (by 32 per iteration), exponential decrease (like Sustain/Decay), or bent line increase (by 32 until 3/4*max, then by 8)) with iterations at 15.625Hz-32000Hz.
Jipcy
Veteran
Posts: 768
Joined: Thu Feb 03, 2005 8:18 pm
Contact:

Post by Jipcy »

I would love if a current developer could give definitive descriptions to all six of these options, as they are applied in ZSNES. Otherwise, I suppose what's in the docs now will suffice.
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
Post Reply