Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Sound Bias Register - Help please!   Message List  
Reply | Forward Message #8666 of 15019 |
RE: [gbadev] Re: Sound Bias Register - 9bit samples????

You are of course throwing resolution away if you use the 7-bit or 6-bit
modes. The low bit(s) are just gone. In 9-bit mode the extra bit is just
"invented" by the system so it's still just 8-bit sound.

The balance between sample rate and sample depth is most elegantly exposed
using PWM. Roughly speaking, you can double your sample rate and half your
dynamic range [= drop 1 bit from the sample depth] and the sound quality is
equivalent [i.e. identical, assuming proper analog output stages]. PWM is
essentially 1 bit at very high speed, and it *emulates* 8 bits and 65kHz, or
9 bits at 32kHz, etc. There is no reason to choose one over the other in
principle because the DATA RATE is the same, and it's data rate that counts.
However, the analog shaping circuitry at the output stage makes a BIG
difference here. Not knowing what the output stage is exactly, the only
valid advice is to try the different modes and choose the one that sounds
best.

I don't understand where FM comes in. GBA uses Pulse Width Modulation, not
Frequency Modulation. FM uses sine waves; PWM does not.

Another hint from DSP theory: if you calculate the sounds internally at
higher than 8-bit resolution, then you should add a certain amount of noise
[dithering] before you cast the sample to 8 bits. The dithering should be a
random amount between -0.5 and +0.5. The difference is marginal at 16 bits,
but at 8 bits it is audibly noticeable. In experiments, it has been found
that people can hear a sine wave that is only 1/2 LSB large AS A SINE WAVE
when 1/2 LSB of noise is added. Without the noise added, all you hear is a
SQUARE wave. That's a big difference at low amplitudes. Think of how a
greyscale image would look with and without dithering - your ear works the
same.

HTH,

Ed xxx

-----Original Message-----
From: John Q. Pretentious [mailto:johnisaheadcase@...]
Sent: Saturday, December 01, 2001 12:19 AM
To: gbadev@yahoogroups.com
Subject: Re: [gbadev] Re: Sound Bias Register - 9bit samples????


> I read:
> > You're not throwing resolution away.
>
> if I understand it right of courswe you are

You're exchanging sample depth for sample rate. Whenever your samples are
half the resolution, their timing is twice the resolution.

You are *not* throwing resolution away. You've always got a 32khz sample at
64khz, and three multipliers (always *2) to spread around as you see fit.

> > You're just applying the time differently. I think it's rather elegant,
> > but unfortunately, I don't know enough about sound to know why you'd
> > want one over the other
>
> bitdepth = resolution = headroom (kind of)

Uh, no. Sample depth is the accuracy to which a tone is recorded. This is
the step distance between tones.

> the idea is that the more bits you use to store a single sample
> (which is basically just the volume or the voltage on the wire)
> the finer grained your resolution in the digital representaion
> will be.
> the so called time domain representation holds no frequency information
> about a sound, just levels(=amplitudes)
> sample rate OTOH defines the speed at which the conversion of said samples
> D->A or vice versa takes place.

At the most technical level, this is correct, but it belies a fundamental
misunderstanding of the characteristics of FM sound.

Rate most certainly *is* a factor in audio sample resolution. It's one of
four, of which the gameboy supports three: sample depth, sample rate,
channel count, and channel placement (the AGB supports the first three).

People argue which of sample depth or sample rate is more significant. In
my opinion, they're roughly equivalent - if *either* goes too low, things
begin to suck.

The practical effects of sample depth are the accuracy in tonality that we
percieve as "off-key" when it gets bad. In order to get a handle on this,
grab your favorite Primus CD (or a female jazz vocalist who moves through a
note slowly somewhere, or a saxophone). Rip it in MP3 at CD rate - 44.1/16.
Record it again at 44.1/8. You'll notice that your singer seems to miss her
note every so often.

In order to understand sample rate, consider how "grainy" a song sounds on
old but good condition audio tapes. Things with extremely fast timing -
especially drum beats in German techno from the 80s - will really show up
low bitrate samples. You'll get the impression that the tape just couldn't
keep up.

> As you might know the highest possible frequency that can be accurately
> represented in a discrete way is srate/2 (the Nyquist freq.)

It's curious that you know what the nyquist frequency is, that you know that
it involves sample rate, that it limits sample resolution, and that you
still don't think that sample rate is involved in audio resolution.

For those of you who don't know what the Nyquist frequency is, it's the
sample rate cut in half - the rate at which our ears will hear aliasing.
Low-bandwidth pass at the nyquist frequency and your audio will be clean,
clean, clean.

A good explanation of how the Nyquist frequency works is buried in this page
that explains Fast Fourier Transforms:
http://www.daqarta.com/0t0cfft2.htm

> so if you need high frequencies but don't care about the headroom (the
> number of distict levels) go for higher srates, if you can get by with
> frequencies below you can opt for the higher resolution.

Well, this is the part that I meant when I said I didn't know enough about
sound. It's not that I don't understand how an FM sample works - that's
pretrty easy. I just don't know when rate is desirable, and when sample
depth is desirable. I'm supposing that depth is the default, and that rate
is desirable when depth is a non-issue - say, in sampled speech, where the
tonal range is miniscule, or what have you.

- Fattrini, Alto Tenor Contralto Basso of the 5th nebula of Zorticulon X

_________________________________________________________ Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


list rules: http://www.gbadev.org/rules.txt
unsubscribe: gbadev-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/







Sun Dec 2, 2001 4:42 am

eddie@...
Send Email Send Email

Forward
Message #8666 of 15019 |
Expand Messages Author Sort by Date

I've looked throught the *entire* (!) posts on sound stuff and didn't found anything on the sound bias register! What's it's purpose and bit layout? Is it for...
uze666@...
uze666
Offline Send Email
Nov 18, 2001
9:51 pm

The sound bias register is fed by two vals, only one of which you should be concerned with: AAxxxxBBBBBBBBBB A=Amplitude resolution in bits, whereas: 00 = 9bit...
Emanuel Schleussinger
ratbert.geo
Offline Send Email
Nov 19, 2001
10:20 am

... How anything else than 8bit is supposed to work anyway??? Considering the FIFO has 128bits (16 bytes), 128/9 gives 14.22222 9bit-"bytes"!?! Or...is it...
uze666@...
uze666
Offline Send Email
Nov 19, 2001
4:53 pm

Um. It's because at 8-bit the sampling frequency is 64khz, but at 9bit it's 32khz; similarly, at 7-bit it's 128khz, and at 6-bit it's 256khz. Well, it's...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Nov 30, 2001
9:07 am

... if I understand it right of courswe you are ... bitdepth = resolution = headroom (kind of) the idea is that the more bits you use to store a single sample ...
CK
x@...
Send Email
Nov 30, 2001
3:29 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Dec 1, 2001
12:25 am

You are of course throwing resolution away if you use the 7-bit or 6-bit modes. The low bit(s) are just gone. In 9-bit mode the extra bit is just "invented"...
Eddie Edwards
eddie@...
Send Email
Dec 1, 2001
11:24 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Dec 2, 2001
12:48 pm

Sorry, this post I'm replying to is old ... and long ... John Q. Pretentious wrote: ... completely ... Are you saying that the data is sent into the FIFO...
Eddie Edwards
eddie@...
Send Email
Jan 2, 2002
8:18 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Jan 11, 2002
9:16 am

Horribly off-topic. Sorry. Just in case anyone else is following the thread ... ... the ... Well, that's a relief! I was only 99% certain myself, and quite...
Eddie Edwards
eddie@...
Send Email
Jan 11, 2002
4:56 pm

... yep, some are trying...very hard! :) ... Trough experimentation, I could tell the difference either. Wether i use directsound or sound channels, using the...
uze666
Offline Send Email
Jan 11, 2002
6:41 pm

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Jan 13, 2002
1:27 am

... May I correct two common misconceptions? First off, "Gaussian" does not apply to the frequency distribution but instead to the distribution of time-domain...
Damian Yerrick
yerricde
Offline Send Email
Jan 14, 2002
9:33 am

... I think this is the wrong book. I'm trying to find out what the book I mean is called. Please nobody buy it; this one is a bit more advanced [research ...
Eddie Edwards
eddie@...
Send Email
Jan 15, 2002
10:52 pm

... right. ... Erm. I'm going to jump in at this late stage and say that I'm not 100% sure that's right. However, it's more likely that I've misinterpreted...
Andrew Rollings
andrew_rollings
Offline Send Email
Jan 16, 2002
9:21 am

... Apparently not. I did FFTs of some linear noise and some Gaussian noise and the results were inconclusive, so instead I synthesized some white noise by ...
Eddie Edwards
eddie@...
Send Email
Jan 18, 2002
8:05 am

... _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com...
John Q. Pretentious
johnisaheadcase
Online Now Send Email
Jan 22, 2002
6:14 pm

... How anything else than 8bit is supposed to work anyway??? Considering the FIFO has 128bits (16 bytes), 128/9 gives 14.22222 9bit-"bytes"!?! Or...is it...
uze666@...
uze666
Offline Send Email
Nov 19, 2001
4:55 pm

... dunno about the purpose all i know is that you shouldn't change bits 9-0 as they are controlled by the CPU you CAN change bit 15-14 (2 most highest bits) ...
Berg van den, B (Bast...
B.Berg01@...
Send Email
Nov 19, 2001
10:21 am

The register lives at &88 and looks like this: RRxxxxBB BBBBBBBB RR = amplitude resolution: 00 9bit at 32768 Hz 01 8bit at 65536 Hz 10 7bit at 131072 Hz 11...
Eddie Edwards
eddie@...
Send Email
Nov 20, 2001
11:28 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help