It is currently Mon Dec 10, 2018 2:56 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Tue Feb 20, 2018 12:01 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7804
Location: Seattle
The set of constraints you've lined up is going to be difficult. I think you're either going to need a quite long sinc FIR filter, a very high order IIR filter, or accepting some passband & stop-band ripple. Even a 10th order discrete-time butterworth lowpass (-3dB at 4.2MHz) only gets down to -12dB at 4.5MHz. Sharper filters (chebyshev, elliptic) help a little, but there's going to be a lot of group delay during the transition band.


Top
 Profile  
 
PostPosted: Tue Feb 20, 2018 12:04 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20851
Location: NE Indiana, USA (NTSC)
What filter is in an actual TV's IF section to separate the AM video from the FM audio?


Top
 Profile  
 
PostPosted: Wed Feb 21, 2018 9:27 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
It looks like you stumped everybody. I wish there was an easy way of calculating butterworth and chebychev filters in the digital domain.


Top
 Profile  
 
PostPosted: Wed Feb 21, 2018 9:41 am 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 709
I have literature on both RF transmitters and television receivers from the mid-1950s, when color NTSC was introduced. I don't think that's pertinent though, because it's too old.

As for filters, most materials on that subject, on-line or in print, expect way too many things to be known by the reader, are gratuitously formalistic, at the same time offensively imprecise in terminology and prose, and generally are not suited for people who just want to skim trying to find what they need. Of course, I say that about pretty much any mathematical subject, so who am I to complain.


Top
 Profile  
 
PostPosted: Wed Feb 21, 2018 11:53 am 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7804
Location: Seattle
Unfortunately, the vast majority of the service manuals and schematics I can find are either from the very early days of TV, where everything was valve-based and monochrome, or from after the VLSI revolution and all the TVs do all the interesting signal processing stuff inside a monolithic encapsulated silicon die.

Doing my best to read the valve-based schematic for the Predicta 10L4x chassis, I think it just completely ignores the modulated audio signal altogether and relies on the temporal and spatial bandwidth to hide any crosstalk.


Top
 Profile  
 
PostPosted: Wed Feb 21, 2018 9:08 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
I think the easiest way would be to make a quantized version of the frequency gain spectrum you want, and then do a discreet cosine transform.


Top
 Profile  
 
PostPosted: Wed Feb 21, 2018 10:36 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7804
Location: Seattle
In English, discrete (easily distinguished; separate in time or space) and discreet (inconspicuous) mean different things. Even though they come from the same root.

Anyway, you've basically just described generic FIR filter design. The DCT isn't particularly good for analysis either (instead of for storage, where it is).


Top
 Profile  
 
PostPosted: Thu Feb 22, 2018 2:35 am 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 667
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
tepples wrote:
What filter is in an actual TV's IF section to separate the AM video from the FM audio?

Vast majority of the designs I have seen use surface acoustic wave filters tuned to particular IF frequencies used.

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Thu Feb 22, 2018 5:31 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
lidnariq wrote:
Anyway, you've basically just described generic FIR filter design. The DCT isn't particularly good for analysis either (instead of for storage, where it is).


I think the DCT would work because, for symetrical FIR filters the sine wave part of the fourier transform can be ignored, and also every frequency higher than the niquist frequency would be ignored.


Top
 Profile  
 
PostPosted: Thu Feb 22, 2018 9:26 am 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 427
Location: FL
lidnariq wrote:
In English, discrete (easily distinguished; separate in time or space) and discreet (inconspicuous) mean different things. Even though they come from the same root.

Image


Top
 Profile  
 
PostPosted: Thu Feb 22, 2018 11:34 am 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7804
Location: Seattle
psycopathicteen wrote:
I think the DCT would work because,
The DCT causes spectral smearing, relative to the Fourier transform. As such, it's inappropriate for analysis or filtering.

It's implemented in terms of the Fourier transform, by taking the original input and duplicating it once to produce a symmetric input for analysis. When you take a copy of the original input, reverse it, and append that to the original, that changes the spectral content.

The phase information that was present in the FFT still has to be stored somewhere, and it changes the magnitudes of the specific bins of the result of the DCT.

Quote:
for symmetrical FIR filters the sine wave part of the Fourier transform can be ignored
A symmetric (specifically "even") FIR filter does have a purely real Fourier transform, and that does mean that the real and imaginary components of the filter input remain in the same parts after multiplication, but the imaginary part is still affected by the filtering.

Quote:
and also every frequency higher than the nyquist frequency would be ignored.
That's true regardless. Fourier transform of a purely-real input is necessarily symmetric¹, so everything above half the window width is going to be a duplicate of the bottom half. There is nothing actually "above" the Nyquist frequency there, just incorrectly plotting the result as the result of k∈[0,length) instead of k∈(-length÷2,+length÷2]

¹pedantic note: the fourier transform of a real input has an even (mirror symmetry) real component and an odd (180° symmetry) imaginary component.


Top
 Profile  
 
PostPosted: Thu Mar 01, 2018 6:43 am 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 727
psycopathicteen wrote:
What's the reason for the missing PPU cycle on even frames?
Was it to improve composite picture quality?

Mathematically, they seem to have aimed at making each (two) frames an exact multiple of the NTSC 3.579545MHz color clock cycles (this seems to have been common practice on older pre-PSX systems like C64, NES, SNES).
I am not aware of a good reason for doing that, but they have probably believed that it would improve the picture quality, although I guess it's actually making things worse. And even if there would be some reason for the short scanline: The https://shmups.system11.org/viewtopic.php?f=6&t=61285 says that the short scanline is located right before the first visible scanline - which is really bad (to avoid jittering, it should be located after last visible line, so the TV has enough time could resync itself to hsync's).

psycopathicteen wrote:
If it was, they should've had a missing half cycle every frame instead, so that artifacts cancled out entirely.

No! That would highlight the artifacts (the artifacts would be always drawn at the same static locations in all frames, which would make the artifacts more visible). Probably Nintendo actually wanted to do right that - and (fortunately) considered it too difficult to implement "half cycles".

Here are some maths from everynes.htm on the color clock:

Code:
Clock Speeds
  Type               NTSC               PAL                 Dendy
  Master Clock (X1)  21.47727MHz        26.6017125MHz       Like PAL
  Color Clock        3.579545MHz=X1/6   4.43361875MHz=X1/6  Like PAL
  Dot Clock          5.3693175MHz=X1/4  5.3203425MHz=X1/5   Like PAL
  CPU Clock          1.7897725MHz=X1/12 1.66260703MHz=X1/16 1.773448MHz=X1/15
  Frame Rate         60.09914261Hz      50.00697891Hz       Like PAL

Modulator vs PPU Timings
  Type                       NTSC            PAL             Dendy
  Dots per Color Clk         1.5 (6/4)       1.2 (6/5)       1.2 (6/5)
  Color Clks per Scanline    227.3333        284.1666
  Color Clks per One Frame   59561.33        88660.0
  Color Clks per Other Frame 59560.66        88660.0
  Color Clks per Two Frames  119122.0        177320.0

For PAL/NES they've successfully achieved perfect uglyness with exactly 88660.0 color clocks per frame.
For NTSC/NES it's 119122.0 color clocks per TWO frames, which appears better than PAL, without the shortscanline it would be 3x59561.33 = 178684.0 clocks per THREE frames, which might look even better (with slight flimmering, but nearly invisible artifacts, ie. picture quality about as good as on PSX consoles).

As far as I know, one could disable the short scanline effect by disabling BG and OBJ (somewhere during vblank, and enable them when the first scanline gets drawn). I don't have a NTSC/NES console myself... but it might be interesting to patch some commercial/homebrew game to see if it looks better/worse with/without short scanlines (might be a bit difficult since NES doesn't have too much support for scanline IRQs, and stuff like Sprite0 Hit likewise won't work when having BG and OBJ disabled).


Top
 Profile  
 
PostPosted: Thu Mar 01, 2018 8:32 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4108
I hear that Zelda 2 and Dragon Warrior 2 are heavily affected by the artifacts, so I'd think those would be two games to especially compare on hardware.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Thu Mar 01, 2018 10:42 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11010
Location: Rio de Janeiro - Brazil
nocash wrote:
As far as I know, one could disable the short scanline effect by disabling BG and OBJ (somewhere during vblank, and enable them when the first scanline gets drawn).

IIRC, Battletoads is a game that keep rendering disabled at the beginning of the frame, so that's one commercial game you can check out without any modifications (although there will be nothing to compare to).

Quote:
I don't have a NTSC/NES console myself... but it might be interesting to patch some commercial/homebrew game to see if it looks better/worse with/without short scanlines (might be a bit difficult since NES doesn't have too much support for scanline IRQs, and stuff like Sprite0 Hit likewise won't work when having BG and OBJ disabled).

If you can consistently cause a sprite 0 hit or a sprite overflow *anywhere* on the screen, you can detect the end of vblank by waiting for the flag to be cleared, which happens at the beginning of the pre-render scanline. Then you just wait a little to enable rendering after the frame starts rendering.


Top
 Profile  
 
PostPosted: Thu Mar 01, 2018 1:09 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
Quote:
No! That would highlight the artifacts (the artifacts would be always drawn at the same static locations in all frames, which would make the artifacts more visible). Probably Nintendo actually wanted to do right that - and (fortunately) considered it too difficult to implement "half cycles".


Actually, you're right. In order for there to be 180 degrees phases cancelation, it would need an extra 1/4 cycle each frame.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot], zeroone and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group