Skip to content

Commit

Permalink
Merge pull request #376 from CPJKU/fix_375
Browse files Browse the repository at this point in the history
fix erroneously applied smoothing for DBN tempo estimation
  • Loading branch information
Sebastian Böck committed Aug 9, 2018
2 parents f163865 + 5a96790 commit 9e06664
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions madmom/features/tempo.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ def __init__(self, method=METHOD, min_bpm=MIN_BPM, max_bpm=MAX_BPM,
histogram_processor = CombFilterTempoHistogramProcessor
elif method == 'dbn':
histogram_processor = DBNTempoHistogramProcessor
# do not smooth the activations for the DBN
self.act_smooth = None
else:
raise ValueError('tempo histogram method unknown.')
# instantiate histogram processor
Expand Down Expand Up @@ -715,9 +717,10 @@ def process_offline(self, activations, **kwargs):
relative strengths (second column).
"""
# smooth the activations
act_smooth = int(round(self.fps * self.act_smooth))
activations = smooth_signal(activations, act_smooth)
# smooth the activations if needed
if self.act_smooth is not None:
act_smooth = int(round(self.fps * self.act_smooth))
activations = smooth_signal(activations, act_smooth)
# generate a histogram of beat intervals
histogram = self.interval_histogram(activations.astype(np.float))
# smooth the histogram
Expand Down

0 comments on commit 9e06664

Please sign in to comment.