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

Define the hsync tolerance in RFDecode class #457

Merged
merged 1 commit into from
Feb 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lddecode/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,11 @@ def __init__(self, inputfreq = 40, system = 'NTSC', blocklen = 32*1024, decode_d

linelen = self.freq_hz/(1000000.0/self.SysParams['line_period'])
self.linelen = int(np.round(linelen))
# How much horizontal sync position can deviate from previous/expected position
#and still be interpreted as a horizontal sync pulse.
# Too high tolerance may result in false positive sync pulses, too low may end up missing them.
# Tapes will need a wider tolerance than laserdiscs due to head switch etc.
self.hsync_tolerance = .4

self.decode_digital_audio = decode_digital_audio
self.decode_analog_audio = decode_analog_audio
Expand Down Expand Up @@ -1656,7 +1661,7 @@ def compute_linelocs(self):
#print(p, lineloc, rlineloc, lineloc_distance)

# only record if it's closer to the (probable) beginning of the line
if lineloc_distance > .4 or (rlineloc in linelocs_dict and lineloc_distance > linelocs_dist[rlineloc]):
if lineloc_distance > self.rf.hsync_tolerance or (rlineloc in linelocs_dict and lineloc_distance > linelocs_dist[rlineloc]):
#print(rlineloc, p, 'reject')
continue

Expand Down