Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve, and always enable, NTSC IQ filters #774

Merged
merged 4 commits into from
Aug 20, 2022

Conversation

atsampson
Copy link
Collaborator

This is the result of some experimentation following the discussion in #513...

Comb::filterIQ now uses FIR filters generated by sps.remez, based on the ones the PAL decoder uses in 1D mode. They're a bit more expensive to compute but they're phase-linear and have less ripple and a sharper cutoff. This looks much better, to the point where I think enabling the filter now slightly improves quality in non-phase-compensating mode (and it was already always on in phase-compensating mode), so we can safely remove the options to disable it.

Narrowband Q mode as currently implemented makes a negligable difference to the output, and Poynton says that narrowband encoding "has not been practiced since about 1970" (plus it ought to use a different I filter too), so remove that as well.

Fixes #513.

Some comparisons - note the chroma delay on the blocks at the bottom, and the slight aliasing on the block to the left of "SW2".

No IQ filter (old default):

snellwilcox-output

With the original equiband IQ filter (old default in phase-compensating mode):

snellwilcox-iqwide-output

With the new equiband IQ filter (new default):

snellwilcox-output

Note to self: update the ld-analyse and ld-chroma-decoder docs when merged.

@atsampson atsampson added enhancement ld-decode-tools An issue only affecting the ld-decode-tools labels Aug 20, 2022
Describe the two modes as "equiband" and "narrowband", to match standard
terminology: these are the terms used in Carnt and Townsend (1961) and
Poynton (2003), so they seem pretty well-established.
These are now FIR filters generated by sps.remez, based on the ones the
PAL decoder uses in 1D mode. They're a bit more expensive to compute
but they're phase-linear and have less ripple and a sharper cutoff. This
looks much better, to the point where I think enabling the filter now
slightly improves quality in non-phase-compensating mode.

The original Comb::filterIQ only fed alternate samples from I and Q into
the filters, so they were designed for 2fSC -- but Comb::filterIQfull,
used in phase-compensating mode, was using them at 4fSC, so it wouldn't
have been getting the intended response. Comb::filterIQ now feeds all
samples through the filter, so it runs at 4fSC and can be used in both
modes.
Since it's always on in phase-compensating mode anyway, and it provides
a small improvement in non-phase-compensating mode, we may as well
remove the option to disable it entirely.

Narrowband mode as currently implemented makes a negligable difference
to the output, and Poynton says that narrowband encoding "has not been
practiced since about 1970", so remove that as well. (Poynton also notes
that in theory a narrowband decoder should use a different shape for the
I filter as well.)
@happycube happycube merged commit 0623f41 into happycube:master Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ld-decode-tools An issue only affecting the ld-decode-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Comb::filterIQ's filter
2 participants