Skip to content

Commit

Permalink
Merge pull request #661 from happycube/efmfilter-test
Browse files Browse the repository at this point in the history
Improved EFM filter parameters
  • Loading branch information
happycube committed Oct 17, 2021
2 parents 46b4f2a + c2dbf40 commit bc58254
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions lddecode/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,17 @@ def computeefmfilter(self):
This improved EFM filter was devised by Adam Sampson (@atsampson)
"""

# Frequency bands
freqs = np.linspace(0.0e6, 2.0e6, num=11)
freqs = np.linspace(0.0e6, 1.9e6, num=11)
freq_per_bin = self.freq_hz / self.blocklen
# Amplitude and phase adjustments for each band.
# These values were adjusted empirically based on a selection of NTSC and PAL samples.
amp = np.array([0.0, 0.2, 0.41, 0.73, 0.98, 1.03, 0.99, 0.81, 0.59, 0.42, 0.0])
amp = np.array([0.0, 0.215, 0.41, 0.73, 0.98, 1.03, 0.99, 0.81, 0.59, 0.42, 0.0])
phase = np.array(
[0.0, -0.95, -1.05, -1.05, -1.2, -1.2, -1.2, -1.2, -1.2, -1.2, -1.2]
[0.0, -0.92, -1.03, -1.11, -1.2, -1.2, -1.2, -1.2, -1.05, -0.95, -0.8]
)
coeffs = None
phase = [p * 1.25 for p in phase]

"""Compute filter coefficients for the given FFTFilter."""
# Anything above the highest frequency is left as zero.
Expand Down
6 changes: 3 additions & 3 deletions lddecode/efm_pll.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def computeefmfilter(freq_hz = 40000000, blocklen = 65536):
freq_per_bin = freq_hz / blocklen
# Amplitude and phase adjustments for each band.
# These values were adjusted empirically based on a selection of NTSC and PAL samples.
amp = np.array([0.0, 0.2, 0.41, 0.73, 0.98, 1.03, 0.99, 0.81, 0.59, 0.42, 0.0])
amp = np.array([0.0, 0.215, 0.41, 0.73, 0.98, 1.03, 0.99, 0.81, 0.59, 0.42, 0.0])
phase = np.array(
[0.0, -0.95, -1.05, -1.05, -1.2, -1.2, -1.2, -1.2, -1.2, -1.2, -1.2]
[0.0, -0.92, -1.03, -1.11, -1.2, -1.2, -1.2, -1.2, -1.05, -0.95, -0.8]
)
coeffs = None
phase = [p * 1.25 for p in phase]

"""Compute filter coefficients for the given FFTFilter."""
# Anything above the highest frequency is left as zero.
Expand Down

0 comments on commit bc58254

Please sign in to comment.