Class BeatDetection

java.lang.Object
wellen.analysis.BeatDetection

public class BeatDetection extends Object

Estimates the locations of percussive onsets using a simple method described in "Drum Source Separation using Percussive Feature Detection and Spectral Modulation" by Dan Barry, Derry Fitzgerald, Eugene Coyle and Bob Lawlor, ISSC 2005.

Implementation based on a VAMP plugin example by Chris Cannam at Queen Mary, London:

  Centre for Digital Music, Queen Mary, University of London.
  Copyright 2006 Chris Cannam.
  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (the "Software"), to deal in the Software without
  restriction, including without limitation the rights to use, copy,
  modify, merge, publish, distribute, sublicense, and/or sell copies
  of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
  ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  Except as contained in this notice, the names of the Centre for
  Digital Music; Queen Mary, University of London; and Chris Cannam
  shall not be used in advertising or otherwise to promote the sale,
  use or other dealings in this Software without prior written
  authorization.
 
  • Field Details

  • Constructor Details

    • BeatDetection

      public BeatDetection()
    • BeatDetection

      public BeatDetection(float sampleRate, int bufferSize)
      Create a new percussion onset detector. With a default sensitivity and threshold.
      Parameters:
      sampleRate - The sample rate in Hz (used to calculate timestamps)
      bufferSize - The size of the buffer in samples.
    • BeatDetection

      public BeatDetection(float sample_rate, int buffer_size, double sensitivity, double threshold)
      Create a new percussion onset detector.
      Parameters:
      sample_rate - The sample rate in Hz (used to calculate timestamps)
      buffer_size - The size of the buffer in samples.
      sensitivity - Sensitivity of the peak detector applied to broadband detection function (%). In [0-100].
      threshold - Energy rise within a frequency bin necessary to count toward broadband total (dB). In [0-20].
  • Method Details

    • get_time_stamp

      public float get_time_stamp()
    • get_sensitivity

      public double get_sensitivity()
    • set_sensitivity

      public void set_sensitivity(double pfSensitivity)
      sensitivity of peak detector applied to broadband detection function
      Parameters:
      pfSensitivity - in percentage [0-100]
    • get_threshold

      public double get_threshold()
    • set_threshold

      public void set_threshold(double pfThreshold)
      energy rise within a frequency bin necessary to count toward broadband total
      Parameters:
      pfThreshold - in dB [0-20]
    • process

      public float[] process(float[] signal_buffer)