NES Low-Pass Filter?

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

NES Low-Pass Filter?

Post by erik343 » Thu Dec 27, 2018 3:19 pm

Hi all,

I am going to RGB mod my NES and I have a question before I begin:
Does the original Nintendo NES use a low-pass filter at all?

Because it seems for the RGB modded NES, there is a chip (THS7374) on it to turn the filter on or off.
Also, I am getting slightly blurry pixels around my sprites that looks to be caused by a low-pass filter or anti-aliasing.
I am just curious really!

Thanks.
Erik W.

lidnariq
Posts: 9418
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: NES Low-Pass Filter?

Post by lidnariq » Thu Dec 27, 2018 4:22 pm

The video path in the NES is not filtered inside the NES, but there are very sharp filters imposed by composite decoding and RF demodulation.

The bandwidth of the THS7374 should be high enough (7.3MHz guaranteed minimum) that any blur you can see should be noticeably smaller than an NES pixel (NES pixel clock is 5.4MHz)... it tentatively sounds like the problem you're describing is a defect instead of intentional.

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

Re: NES Low-Pass Filter?

Post by erik343 » Thu Dec 27, 2018 4:29 pm

With composite decoding, are you talking about the two RCA ports on the NES? Or, something else?

lidnariq
Posts: 9418
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: NES Low-Pass Filter?

Post by lidnariq » Thu Dec 27, 2018 4:43 pm

Yeah, the yellow jack on the NES. "Composite" or "CVBS" video has to be separated by your television into color, brightness, and alignment information. It's this stage that imposes bandwidth limits ( = horizontal smeariness) on video.

But the output of the NESRGB kit shouldn't look worse than what you see running the corresponding game in an NES emulator with its "NTSC" filter—if it does then there's something actively wrong.

.... edit: wait, brains, you haven't done the mod yet.

Ok, right. The filter there is for signal processing reasons. Using the filter shouldn't visibly degrade the output and may improve it depending on how your monitor handles video with too-high frequency components. The NESRGB output bandwidth is half (2.7MHz) the pixel rate (5.4MHz); it's more authentic to only pass frequencies of 4.2MHz and below (i.e. horizontal linear interpolation), but including the third harmonic (8.1MHz) will give nice blocky pixels without any problems.

edit: Omitting the filter theoretically could let tiny glitches show up, depending on how the NESRGB handles pixel clock recover and how your monitor handles 240p component video.
Last edited by lidnariq on Thu Dec 27, 2018 4:49 pm, edited 1 time in total.

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

Re: NES Low-Pass Filter?

Post by erik343 » Thu Dec 27, 2018 4:49 pm

Thanks for your help!

I am actually using the Framemeister XRGB-mini.

I did notice that if I use S-Video instead of Composite, the image quality looks better.
Even if I just convert the NES yellow jack right away to S-Video, and plug in a S-Video cable into this and into the Framemesiter, that the image looks better. The picture looks sharper, which is interesting.

lidnariq
Posts: 9418
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: NES Low-Pass Filter?

Post by lidnariq » Thu Dec 27, 2018 4:56 pm

You're using the XRGB Mini to convert from the NES's composite output to S-video? There's a lot of tricks—I might even go as far as to say black magic—in separating the color data from the brightness data, and the XRGB Mini is likely doing something different (and better for old consoles) than your TV is.

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

Re: NES Low-Pass Filter?

Post by erik343 » Thu Dec 27, 2018 5:01 pm

Yes, I hooked up a RCA to S-Video adapter to the NES yellow port. I hooked up a Monster S-Video cable to the XRGB-mini and to the NES RCA/S-Video adapter, and it looks way better!
If you then also convert the S-Video back to Composite with an adapter, and hook that into the Framemeister, it looks worse!
Just interesting.

lidnariq
Posts: 9418
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: NES Low-Pass Filter?

Post by lidnariq » Thu Dec 27, 2018 5:17 pm

Yeah, that's consistent. The TV's composite video input is probably optimized for real imagery, where the contents of each horizontal row are strongly correlated with the lines above and below and also in the past and the future. Furthermore, it probably expects interlaced input, not compositeprogressive. (Assuming you have a modern LCD HDTV and not an old CRT SDTV)

Almost all of the assumptions that are correct for old real images don't hold for old consoles, especially fewer-color ones like the NES.

When you took the composite video from the NES, the XRGB Mini separates out color in one way. This way is not necessarily going to produce identical results to the original when you mix the color signal back onto the brightness signal... so it follows that the TV will do something different then.
Last edited by lidnariq on Thu Dec 27, 2018 6:00 pm, edited 1 time in total.

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

Re: NES Low-Pass Filter?

Post by erik343 » Thu Dec 27, 2018 5:25 pm

Yea, I have a TCL 49S403 4K HDR TV. It is big and all, which rules for video gaming. If you plug the NES into the TV directly, the picture looks really bad. So, I bought the $400 XGRB-mini upscaler, and it looks way better. I plugged the NES into the Framemeister, and hooked an HDMI cable between the upscaler and the TV. It looks 10x better this way.

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

Re: NES Low-Pass Filter?

Post by erik343 » Fri Dec 28, 2018 11:59 am

Another comment I would like to add is that I am going to eventually buy a RGB modded Nintendo NES!

They say that this mod makes the NES look WAY better.
I suspect the reason for this is that there is no demodulation, ie there is only one signal per wire.
The wires are Red, Green, Blue, Horizontal, and Vertical.

Because, when I use S-Video instead of composite, it looks better because the S-Video separates the Chroma and Luminance, so you don't have to demodulate these, and there is one less demodulation step (than composite), so the picture is way sharper.

Thanks for your help!
Erik W.

User avatar
Jeroen
Posts: 982
Joined: Tue Jul 03, 2007 1:49 pm

Re: NES Low-Pass Filter?

Post by Jeroen » Fri Dec 28, 2018 4:00 pm

Right, but the nes doesnt natively output S-video, so you wouldn't actually get any improvements over composite if you used a converter. That being said, composite -> s-video convertors often have something called a "comb filter", something which your tv might lack, which takes out some of the noise.

Your hypothesis on RGB looking much better because the signals are never modulated is correct.

lidnariq
Posts: 9418
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: NES Low-Pass Filter?

Post by lidnariq » Fri Dec 28, 2018 4:26 pm

Jeroen wrote:Right, but the nes doesn't natively output S-video, so you wouldn't actually get any improvements over composite if you used a converter.
That's completely missing the point. You even mention this afterwards:
That being said, composite -> s-video converters often have something called a "comb filter", something which your tv might lack, which takes out some of the noise.
There are more different ways to separate out the brightness from the color signals than you can shake a stick at.

Every NTSC decoder does this differently.

A "comb filter" is nothing more, and nothing less, than assuming that the color on one scanline is roughly the same as the colors on the scanlines above and below. Sometimes this is a safe assumption. Sometimes it is not. For consoles with large areas of the same color (e.g. 2600), or gradual gradients (N64 and better?), it's a safe assumption.

For consoles with limited master palettes and new colors every scanline (SMS, NES, maybe others?), it's almost certainly not a safe assumption.

A "3d" comb filter adds the assumption that, after the TV detects specific motions in the video, that it can assume that the colors in the near future and past are also consistent. This usually adds unacceptable lag for gaming.

The TV is using a different method to separate out color from brightness than the XRGB mini. Hence the perceived better results. There isn't a single optimal NTSC decoder that will give desirable results for all inputs.



One gotcha for using full component video, instead of S-video or composite, is that artists working with the NES's limitations took advantage of its limited color bandwidth. (Only a change in color every two pixels can be encoded: the color portion of anything that changes more often will be blurred)

psycopathicteen
Posts: 2935
Joined: Wed May 19, 2010 6:12 pm

Re: NES Low-Pass Filter?

Post by psycopathicteen » Tue Nov 19, 2019 4:43 pm

This is a major bump but I always find this stuff interesting. If I were making a NTSC decoder optimized for NES and SNES I would use an ADC sampling rate of 21.48 Mhz so that it's divisible by both the NTSC color carrier and the NES dot clock. Comb filter shouldn't allow any 3.58 Mhz vertical B&W lines because the NES shouldn't be able to display that anyway. If using a comb filter, either use a narrow notch filter as well, or enable it only for vertical edges or lines that are NOT at 3.58 Mhz. Also the comb filter will have to have different weights than a normal comb filter does because of the 120 degree phase shift. It would need 3 lines being combed at 1/3 the amplitude instead of the more common {.25, .5, .25}. The plus side to that is that correlation between lines can be done more accurately, because chroma isn't opposite phase every line.

Now comes some noise filtering. Because notch filters can give a lot of ringing artifacts, and make emphasize dot crawl, an adaptive noise filter can be applied. Since it knows the next and previous pixel is exactly 4 samples behind and ahead, it can blend neighboring pixels when there isn't an abrupt color/luma change. The fact that the NES has a limited color palette, makes this blending less noticeable. SNES is a little trickier because it's color palette is larger and so colors are much closer in luma and chroma values.

psycopathicteen
Posts: 2935
Joined: Wed May 19, 2010 6:12 pm

Re: NES Low-Pass Filter?

Post by psycopathicteen » Tue Nov 26, 2019 10:24 pm

I just had an idea for a Y/C separation technique for SNES and NES composite output. Instead of the chroma signal being filtered horizontally and vertically, it gets filtered diagonally too. It works with the NES and SNES because they have a 3 phase rainbow swirls in both vertical and diagonal lines. I'm not sure but I think diagonals going up have rainbow swirls, but diagonals going down have a solid color.

erik343
Posts: 7
Joined: Thu Dec 27, 2018 3:06 pm

Re: NES Low-Pass Filter?

Post by erik343 » Tue Jun 23, 2020 7:50 pm

I just had a random thought!

With the composite video for the NES, how come the picture looked sharp on a CRT back in the 90's? Is it because the TV and the NES both are analog? I learned about Cathode Ray Tubes in college? But, I don't really understand why a NES with a CRT would look better than hooking up to a digital Plasma TV (composite video) directly.

Any thoughts?

Also, what kind of LPF does the NESRGB version 1.4 (specifically) have officially if it does have one? I am asking this because I discovered that the NESRGB14 does not have a THS7374 chip at all, so I am wondering if any filtering is going on at all?, and what about the newer NESRGB versions? I am just curious about how this mod works? I bought a RGB modded NES on ebay, and the video quality was razor sharp! And, I also killed the NES CPU due to static discharge... oops... So, later on I am going to refurbish/modify a NES, SNES, Atari 2600, and N64. I am also going to buy a Sega Genesis later too :)

Post Reply