- Emphasis of spikes at edges
- Trailing bias towards average (appears as smoothing and slanted lines)
Aside from the DC offset, I am not sure how to precisely model these mishaps. I.e. how do I write a capacitor in code. Sure I have done all the R-C-τ calculations when I was in engineering school, but it has been years. I still remember R = 1÷√(2πFC)… But not what it was used for.
Perhaps someone could contribute a good square wave function that models these effects with parameters, like:
Code: Select all
float GetSquareWaveSample( float wavelength /* the signal repeats at these intervals*/, float offset /* offset into the signal; if wavelength=2, then offset 0..2 represents a single and complete wave with the top and the bottom, and 2..4 repeats it */, float spike_emphasis /*Some measure how much the transitions are over-emphasized. */, float smoothness /* A value of 0 produces a perfect squarewave (assuming no spikes), a large value produces a signal that slowly approaches the desired signal level, with the edges starting a bit closer to the middle-level than they should */ );
Now, the question is, at which step(s) does the degradation happen? This is particularly important with the de-emphasis bits: If the signal controlling the effect of the de-emphasis bits is analog rather than digital, the problem of how to decide the de-emphasis attenuation level is back and stronger than ever.
The current model does reflect accurately the color signal as it is in some stage internal to the NES PPU. I am not sure whether the goal of accurate emulation should be to emulate the purest source signal as it is generated or all the myriad of possibilities it can get damaged on various hardware. I tend to lean on the side of the former, but that may be just laziness.