What's the reason for the missing PPU cycle on even frames?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What's the reason for the missing PPU cycle on even fram

Post by lidnariq »

Everything I'd read stated that demodulators most often demodulated too much into Q, not failed to demodulate content in I.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

If you are demodulating Q at 1.5 MHz for an RF signal, you are in fact demodulating too much Q, according to the numbers I quoted. ;)

As I said, the difference is mostly relevant for RF signals, which is all the original 1953 NTSC standard mentions. For baseband composite signals, you can do everything at 1.5 Mhz according to SMPTE 170M (as I have done in my test pictures) as you stated, and everything should be fine.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What's the reason for the missing PPU cycle on even fram

Post by lidnariq »

Right, that was my point.

My understanding was that there was a brief time in the dawn of NTSC where true separately bandlimited YIQ decoding was the only thing done, but it was one of the first things to be removed in the name of cost reduction. By the 1980s, my understanding is that more-or-less everyone had just switched to equal-bandwith YUV decoding instead.

And that at no point had they done YUV or YIQ demodulation with only 600kHz for the entire chrominance signal altogether.

Mind, if we can find a sufficiently old TV showing such abominable chrominance bandwidth, I will go find a hat to eat.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

Let me simulate a few images demonstrating the various decoding bandwidths...
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

RF video, overall 4.2 MHz bandwidth, equiband YUV decoding at 0.6 MHz.
RF-YUV0.6MHz.png
RF video, overall 4.2 MHz bandwidth, equiband YUV decoding at 1.5 MHz.
RF-YUV1.5MHz.png
RF video, overall 4.2 MHz bandwidth, 1953 NTSC YIQ decoding with I at 1.5 MHz and Q at 0.6 MHz. This one looks really weird in the yellow-green bushes, because the unequal bandwidths result in funky transitory colors that don't appear with equal bandwidths, even when they're low.
RF-YIQ.png
Baseband composite video, unrestricted overall bandwidth, equiband YUV decoding at 1.5 MHz:
Composite-YUV1.5MHz.png
Baseband composite video, unrestricted overall bandwidth, equiband YUV decoding at 3.5 MHz:
Composite-YUV3.58MHz.png
The last one is never used, because as you can see, the high chroma bandwidth basically steals all the luma detail, and so is pointless.
Last edited by NewRisingSun on Tue Feb 20, 2018 6:23 am, edited 1 time in total.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What's the reason for the missing PPU cycle on even fram

Post by lidnariq »

Stealthy Mario!

I have to say, the way that the coin disappears in the status line, the way the title box blurs off the sides, and the extent to which it's hard to see Mario in front of a green bush make me skeptical that 600kHz bandwidth was ever used for I.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

Did you know that in the 1950s, network transmissions to local TV stations were limited by Bell System's L1 coaxial cable to 2.7 MHz bandwidth for the entire video signal? "By heterodyning the subcarrier and its adjacent side-bands to a lower frequency, within the cable passband, before transmission, and heterodyning them back to the standard values after transnmission, and by cutting off the luminance signal at a frequency low enough to avoid interference with the subcarrier and its side-bands while the signal is on the cable", the picture must have looked like stew in the sun. I don't know enough about the details of that process, otherwise I'd simulate it as well...
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What's the reason for the missing PPU cycle on even fram

Post by lidnariq »

Wikipedia says that color NTSC was only adopted in 1953; I wouldn't be surprised that even if the remodulation to transmit it over an L1 line could support chrominance, that almost no-one saw it.

Wikipedia seems to have an article about L1? Looks like it's "just" baseband?
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: What's the reason for the missing PPU cycle on even fram

Post by psycopathicteen »

How many pixels wide are the .6Mhz and 1.5Mhz filters?

I don't know if any composite system ever used this, but I've been experimenting with filters and I discovered if you scale the image to 512x448, make a non-bandlimited chroma signal, then lowpass filter it with a {.333, .333, .333} filter, then sharpen it with a {-.25, 0, 1.5, 0, -.25} filter, then subtract the image from the original chroma signal, it comes out surprisingly clear.

I don't think there is any way they could've made a 320x224 Sega Genesis game on composite or RF look clear without a frame delay comb filter.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What's the reason for the missing PPU cycle on even fram

Post by tepples »

0.6 MHz is close to 1/6 subcarrier, or 9 pixels per period.

1.5 MHz is close to 5/12 subcarrier, or 3.6 pixels per period.

But are the "0.6 MHz" pictures above actually using 0.6 MHz bandwidth (3.3-3.9 MHz), or 0.6 MHz deviation from the subcarrier's nominal frequency (3.0-4.2 MHz)? The difference matters when using Nyquist's theorem to translate bandwidth of a QAM carrier to usable pixels.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

tepples wrote:0.6 MHz deviation from the subcarrier's nominal frequency (3.0-4.2 MHz)?
This. The 0.6 MHz limitation comes from limiting the signal at 4.2 MHz, or 3.6+0.6 MHz. Which is why I actually don't understand how a TV, even if it tried to, could get 1.5 MHz chroma bandwidth from an RF-modulated NES signal, because the upper sideband will be partially lost. Unless the NES' RF modulator does not actually limit the signal to 4.2 MHz, that is...

Basically, I use a product detector for demodulation: multiply the composite signal with two carriers (inverted burst and inverted burst plus 90 degrees), gaussian filter the multiplied signal to the assumed chroma bandwidths, then subtract the filtered chroma signals from the composite signal to get luma. Working at four times subcarrier (14.32 MHz), I use a gaussian width of 4.78 for 1.5 MHz (14.32/4.75/2) and a width of 12 for 0.6 MHz (14.32/0.6/2). You tell me if that's wrong. For the overall bandwidth, I am filtering the recovered luma signal either not at all for unrestricted baseband, or with a gaussian width of 1.70 for 4.2 MHz (14.32/4.2/2). I should be doing this at the very beginning, since the 4.2 MHz cap is done by the RF modulator. But if I do that, I remove not only fine chroma detail, but a lot of chroma amplitude as well, so this may hint at an error in my method.
Last edited by NewRisingSun on Tue Feb 20, 2018 1:51 am, edited 2 times in total.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What's the reason for the missing PPU cycle on even fram

Post by lidnariq »

psycopathicteen wrote:{.333, .333, .333} filter, then sharpen it with a {-.25, 0, 1.5, 0, -.25} filter
Because those are both FIR filters, you can just convolve the two together:

[-1/12 -1/12 5/12 1/2 5/12 -1/12 -1/12]

Performance of this one is ... kinda dubious.

The original boxcar filter puts two poles at the origin, and two zeroes at ±(Sample rate÷3) Hz. (In other words, exactly at the chroma modulation frequency)

Adding the extra sharpening filter puts a bunch of zeroes on the real axis (and more poles at the origin), causing a bit of gain just below the zero, probably there to compensate for the too-slow rolloff of the original one-zero notch filter.
# using octave<br />% [mag,w]=bodemag(filt(conv([1/3 1/3 1/3],[-1/4 0 3/2 0 -1/4]),[1],11/3/39375000))<br />% loglog(w/2/pi,mag)
# using octave
% [mag,w]=bodemag(filt(conv([1/3 1/3 1/3],[-1/4 0 3/2 0 -1/4]),[1],11/3/39375000))
% loglog(w/2/pi,mag)
nn565nn-log.png (3.49 KiB) Viewed 3572 times
Constraining yourself to linear filtering makes this harder than it has to be: the actual TV isn't working purely on baseband luminance and modulated chrominance components. By working on demodulated chrominance, you get a "non-LTI" system that supports sharper filtering for cheaper.


NewRisingSun wrote:Which is why I actually don't understand how a TV, even if it tried to, could get 1.5 MHz chroma bandwidth from an RF-modulated NES signal, because the upper sideband will be partially lost.
The upper sideband is partly lost. But the lower sideband is still present.

NTSC itself is modulated using "vestigial" sideband, and it's not clear to me why the lower sideband is still broadcast. (But they kept it for ATSC, so there must(edit: typo) be a good engineering reason. Makes it easier to synchronize to the carrier, I suppose?)
Unless the NES' RF modulator does not actually limit the signal to 4.2 MHz, that is...
That's also true. (You can see this by looking on adjacent TV channels when the RF switch is on. Lots will have a dirty copy of the NES's video output from all the harmonics it's generating).

I think the demodulator in the TV does limit what's decoded, even those the modulator isn't.

I should remember to plug the RF output of my SNES into my oscilloscope and get a spectrum plot. It's no spectrum analyzer, but I bet even with crappy resolution I'll see a few interesting things.

(Or maybe someone else has a newer nicer 'scope and wants to beat me to it)

You tell me if that's wrong.
Gaussians aren't "realistic" because they're noncausal, but I'm not certain what kind of actual filters were used.
Last edited by lidnariq on Tue Feb 20, 2018 10:47 am, edited 1 time in total.
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

I used a Gaussian filter because it was explicitly recommended in Section 7.3 of SMPTE-170M.
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What's the reason for the missing PPU cycle on even fram

Post by lidnariq »

Then who am I to argue?
NewRisingSun
Posts: 1510
Joined: Thu May 19, 2005 11:30 am

Re: What's the reason for the missing PPU cycle on even fram

Post by NewRisingSun »

I still need a different filter to simulate the 4.2 MHz channel bandwidth cap (the one that the NES' RF modulator does not enforce). My normal Gaussian filter method won't work, because it's too gradual, taking almost all of the subcarrier with it, hence the desaturation. I would need basically a flat response from 0 to 4.2 MHz, then a narrow transition band from 4.2 to 4.5 MHz, with basically infinite attenuation at 4.5 MHz, all for a sampling frequency of 14.32 MHz.
Post Reply