Questions regarding bit resolution, waveforms, etc.

General discussion about tracking, help and support.
Posts: 37
Joined: Sat Jan 30, 2016 10:43 pm

Questions regarding bit resolution, waveforms, etc.

Postby meegosh » Fri Apr 01, 2016 12:21 am

I've been reviewing the FT wiki and some other sites in an attempt to try better make my brain good. Below is a healthy spread of some dunce questions. Any help is appreciated.

Bit resolution refers to the number of levels available in one cycle of a waveform, correct? So something with 2-Bit resolution can have only 4 possible levels in a given cycle (i.e., 00, 01, 10, and 11)? Does the lack of a signal require a bit value?

What are the actual bit depths of the individual waves of the 2A03 and VRC6 chips?

Is the resolution when creating .dmc samples different than the resolution of the DPCM wave?

Are the positive and negative peaks of a square wave totally flat in which case bit resolution doesn't really matter, or is there slight variation happening within the peaks in which case resolution does matter?


User avatar
Posts: 79
Joined: Tue May 12, 2015 12:10 pm
Location: Hungary

Re: Questions regarding bit resolution, waveforms, etc.

Postby za909 » Fri Apr 01, 2016 4:10 pm

The pulse channels and the noise have 4-bit volume, but the waveform itself is really just 1-bit because it's alternating between two states (0, current volume). The triangle is 4-bit because it's using its own 4-bit range constantly to create the wave going 0 - 15 and then 15 - 0. This is also why it doesn't have volume control. The DMC is different. The DAC signal is 7-bit, which can be accesed via the $4011 register directly (this is what the Zxx effect does) or it can be modified by the DPCM playback unit. Each bit either adds or subtracts 2 from the current level, not 1 but 2. This means that the effective range the DPCM samples can use is only 6-bit, not 7-bit.

The two pulse channels are combined into a 5-bit output, and the rest of the channels are output in a way I have no in-depth knowledge about, but the amplitude is heavily affected by the current level of the 7-bit DAC, which can be exploited to control the volume of the triangle (and as a byproduct, the noise at the same time).

The VRC6 mixes its three channels into a 6-bit output, where the pulse are 4-bit each, and the sawtooth is 5-bit. The sawtooth is internally actually 8-bit but only the high 5 bits of its accumulator are ever output. The saw is made of 14 steps, where your choice of volume is added to the saw accumulator every two steps, and then the low 3 bits are discarded at the output stage, so for example a volume of 4 would go like this:
Decimal: 0 0 4 4 8 8 12 12 16 16 20 20
Hex: $00 $00 $04 $04 $08 $08 $0C $0C $10 $10 $14 $14
Actual 5-bit output with the low 3 bits discarded: $00 $00 $00 $00 $01 $01 $01 $01 $02 $02 $02 $02
If you set the saw to volume 1, nothing is going to come out, and if you set it to 2, you get a quiet pulse wave with a 35% pulse width if I remember correctly.

Ideally the pulse waves should be flat, but there's always some voltage leaking so they start returning to 0 with a logarithmic curve: Image
I'm not sure if the bottom part curves, because the real system has unsigned output where everything is zero, except for the times when it's the current volume, so I don't know if there is anything that could leak.
Resolution matters when you want to record the waves accurately, with all the leakage.

User avatar
Posts: 475
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR

Re: Questions regarding bit resolution, waveforms, etc.

Postby HertzDevil » Fri Apr 01, 2016 5:08 pm

The curves are mostly due to your software or hardware performing a high pass, so both the positive and negative parts should bend equally.
refactoring 0cc-famitracker

Posts: 37
Joined: Sat Jan 30, 2016 10:43 pm

Re: Questions regarding bit resolution, waveforms, etc.

Postby meegosh » Sat Apr 02, 2016 1:42 pm

Snap. Thanks for the info za909 and HertzDevil. Definitely have more questions but I'll let things simmer for a while to see if I can figure them out.