solidcorp, on Tue Feb 21, 2012 10:11 AM, said:
Have you captured both Stella PC output and the 2600 and compared the outputs?
No, I haven't tried to capture Stella's output, but that's a good suggestion for comparison.
Are those scope traces from Stella or from an actual 2600 Audio signal, and if they are from a 2600 how are they demodulated from the composite TV signal (are they coming through a television)?
As mentioned in my reply to Thomas Jentzsch-- actual 2600, connected to VCR by coaxial input, connected to DVD recorder by AV cables. Then I ripped the audio from the DVD to WAV files. I tried to keep the sampling rate as high as possible since there's no sampling rate in the audio/PC world that matches the TIA's audio clock rate of about 31400 Hz, and I wanted to be able to see the 0s and 1s for AUDC0=4 and AUDF0=0, which gives the highest TIA frequency (about 15700 Hz, or half the sample rate since it takes two samples-- 0 and 1-- to make one full cycle of a wave). If I zoom in on that part of the WAV file in WavePad, I can see the peaks and troughs that correspond to the 1s and 0s, but it looks like the samples in the WAV file are about 1.5 times the TIA audio rate-- that is, it looks like the WAV file sample rate is 48000 Hz, which in fact is what WavePad shows when I choose the "convert sample rate" option.
If you look at the audio output circutry of the 2600 (left center of this schematic
) you will see that the audio output from AU0 AU1 is coupled to the modulator through a series 47pf cap (ignoring the effect of the other audio output circuitry). Has anyone on the Stella project tried to account for the analog circuitry in the audio output and video modulator sections of the schematic.
That's one of the things I was trying to suggest in a roundabout way in an earlier post. As far as I know, the TIA sound routines that are used by most (if not all) of the emulators are based on emulating the raw signal that the TIA generates, rather than what actually gets sent to the TV after the TIA's output goes through the modulator. Being no engineer, and having no training in how to read schematics, I haven't been able to make heads or tails of that schematic (and believe me, I've puzzled over it more than once). I *have* been able to figure out most of the TIA schematics, with hints and guidance from others at AtariAge. I've even started making a spreadsheet to "emulate" each step in the TIA schematics, gate by gate. But the schematic you linked to still eludes my poor attempts to comprehend it!
Getting back to the original question of analog versus digital, we may tend to think of the TIA as being digital in nature, but of course the signals flowing through it are really analog. That is, the signal doesn't change from 0 to 1, or from 1 to 0, but rather increases or decreases in voltage until it passes some threshold and is perceived by the gates as being a "0" or a "1." Not that any of this matters from the perspective of emulation, since we're effectively dealing with 0s and 1s (or in the case of the tristate gates, "0" or "1" or "off"). But I *am* curious how the circuitry outside of the TIA affects the resulting audio signal.
In my experience, audio output is typically coupled capacitively so I suspect you'd measure similar non square wave results from both your PC and an actual 2600, but again this is just a suspicion.
Getting back to what I was saying about the signals inside the TIA, I don't know that a true square wave is possible, given that (as I understand things) the signal will always have some kind of rise time and fall time. But I suppose this is quibbling over the "zoom factor," since the clock signal may actually look trapezoidal as depicted in datasheets for the 6502, but if we "zoom out" a bit then the rise and fall times are imperceptible at that "zoom level." Even the timing diagrams in the TIA manual show the pulses as being trapezoidal in some pictures, but then as square pulses in other pictures where the scale is different.
Circles looked great, diamonds were ok, but squares, shapes where one axis was supposed to hold a constant DC value while the other moved showed that same characteristic distortion or decay towards zero.
I didn't really follow what you described about your project-- although it sounds like it was really cool!-- but the part about the constant DC value sounds like what I was trying to say about the difference between a depiction of a raw electrical signal versus an audio signal.
Let's say I send a square wave signal with a frequency of 0.05 Hz, where the raw signal is high for 10 seconds, low for 10 seconds, etc. (20 seconds for each full square wave would be 0.05 Hz, right?) To human ears the effect would be silence, although I wonder if it's really silent-- well, I know it would be a sound, but I admit that sound is something of a mystery to me. (Oh, I know about frequencies, and wave forms, and harmonics, and additive versus subtractive synthesis, etc.-- but what do I *really* know about sound?) If we could *see* the resulting sound, would it look like the square wave that created it, or would it look like what WavePad shows for AUDC0=0-- a series of very brief and rapidly-fading "clicks" or bursts occuring at 10 second intervals?
So I guess what I'm saying/wondering is that maybe there's no way for an *audio* device to hold a constant DC value for very long, given the nature of sound? Going back to my 0.05 Hz example, we don't hear a noise for 10 seconds, followed by silence for 10 seconds, followed by a noise for 10 seconds, etc.-- instead, we don't hear *anything*. And if we could, I'm thinking we'd hear tiny bursts or clicks of noise at 10-second intervals. I'm thinking it's not so much that we can't *hear* the sounds, but that they're too tiny for us to notice, although perhaps some animals might be able to perceive them. So, given that a 0.05 Hz square wave is "silent," should a device that can show sounds (as opposed to electrical signals), or a program like WavePad, show the signal as a square wave? I'm thinking the answer is no. My understanding of WavePad is that the distance of the signal line from the central line is an indication of its decibel level, so I figure the screenshot of AUDC0=0 is exactly right, irrespective of the effects of any caps or filtering.