Packageorg.si.sion.utils
Classpublic class PeakDetector
InheritancePeakDetector Inheritance Object

PeakDetector provides wave power peak profiler with bandpass filter. This analyzer takes finer time resolution, looser frequency resolution and faster calculation than FFT.



Public Properties
 PropertyDefined By
  average : Number
[read-only] avarage wave energy
PeakDetector
  bandWidth : Number
half band width of band pass filter [oct.]
PeakDetector
  differencialOfLogPowerProfile : Vector.<Number>
[read-only] exponential of differencial of log scaled powerProfile, same length with powerProfile
PeakDetector
  frequency : Number
frequency of band pass filter [Hz], set 0 to skip filtering
PeakDetector
  maximum : Number
[read-only] maximum wave energy
PeakDetector
  maxPeaksPerMinute : Number = 192
[static] maximum value of peaksPerMinute, the minimum value is a half of maximum value.
PeakDetector
  peakList : Vector.<Number>
[read-only] analyzed peak list in [ms].
PeakDetector
  peaksPerMinute : Number
[read-only] estimated peak per minutes.
PeakDetector
  peaksPerMinuteEstimationScoreTable : Vector.<Number>
[read-only]
PeakDetector
  peaksPerMinuteProbability : Number
[read-only] probability of estimated peaksPerMinute value.
PeakDetector
  powerProfile : Vector.<Number>
[read-only] analyzed wave energy profile 2100[fps] (the length is 1/21(2100/44100) of analyzing samples).
PeakDetector
  samples : Vector.<Number>
[read-only] samples to analyze, 44.1kHz only
PeakDetector
  samplesChannelCount : int
[read-only] channel count of analyzing samples (1 or 2)
PeakDetector
  signalToNoiseRatio : Number
S/N ratio for peak detection [dB]
PeakDetector
  windowLength : int
window length of simple moving avarage [ms]
PeakDetector
Public Methods
 MethodDefined By
  
PeakDetector(frequency:Number = 0, bandWidth:Number = 0.5, windowLength:Number = 20, signalToNoiseRatio:Number = 20)
constructor
PeakDetector
  
calcPeakIntencity(peakPosition:Number, integrateLength:Number = 10):Number
calcuate peak inetncity
PeakDetector
  
calcPeaksPerMinuteEstimationScoreTable(peakList:Vector.<Number>, scoreTable:Vector.<Number> = null):Vector.<Number>
[static]
PeakDetector
  
mergePeakList(arrayOfPeakList:Array, singlePeakLength:Number = 40):Vector.<Number>
[static] merage peak list
PeakDetector
  
setSamples(samples:Vector.<Number>, channelCount:int = 2, isStreaming:Boolean = false):PeakDetector
set analyzing source samples
PeakDetector
Property Detail
averageproperty
average:Number  [read-only]

avarage wave energy


Implementation
    public function get average():Number
bandWidthproperty 
bandWidth:Number

half band width of band pass filter [oct.]

The default value is 0.5.


Implementation
    public function get bandWidth():Number
    public function set bandWidth(value:Number):void
differencialOfLogPowerProfileproperty 
differencialOfLogPowerProfile:Vector.<Number>  [read-only]

exponential of differencial of log scaled powerProfile, same length with powerProfile


Implementation
    public function get differencialOfLogPowerProfile():Vector.<Number>
frequencyproperty 
frequency:Number

frequency of band pass filter [Hz], set 0 to skip filtering

The default value is 0.


Implementation
    public function get frequency():Number
    public function set frequency(value:Number):void
maximumproperty 
maximum:Number  [read-only]

maximum wave energy


Implementation
    public function get maximum():Number
maxPeaksPerMinuteproperty 
public static var maxPeaksPerMinute:Number = 192

maximum value of peaksPerMinute, the minimum value is a half of maximum value.

The default value is 192.

peakListproperty 
peakList:Vector.<Number>  [read-only]

analyzed peak list in [ms].


Implementation
    public function get peakList():Vector.<Number>
peaksPerMinuteproperty 
peaksPerMinute:Number  [read-only]

estimated peak per minutes. this value is similar but different form bpm(tempo), because the peaks are not only on 4th beats, but also 8th or 16th beats.


Implementation
    public function get peaksPerMinute():Number
peaksPerMinuteEstimationScoreTableproperty 
peaksPerMinuteEstimationScoreTable:Vector.<Number>  [read-only]


Implementation
    public function get peaksPerMinuteEstimationScoreTable():Vector.<Number>
peaksPerMinuteProbabilityproperty 
peaksPerMinuteProbability:Number  [read-only]

probability of estimated peaksPerMinute value. 1 means estimated perfectly and 0 means not good estimation.


Implementation
    public function get peaksPerMinuteProbability():Number
powerProfileproperty 
powerProfile:Vector.<Number>  [read-only]

analyzed wave energy profile 2100[fps] (the length is 1/21(2100/44100) of analyzing samples).


Implementation
    public function get powerProfile():Vector.<Number>
samplesproperty 
samples:Vector.<Number>  [read-only]

samples to analyze, 44.1kHz only


Implementation
    public function get samples():Vector.<Number>
samplesChannelCountproperty 
samplesChannelCount:int  [read-only]

channel count of analyzing samples (1 or 2)


Implementation
    public function get samplesChannelCount():int
signalToNoiseRatioproperty 
signalToNoiseRatio:Number

S/N ratio for peak detection [dB]

The default value is 20.


Implementation
    public function get signalToNoiseRatio():Number
    public function set signalToNoiseRatio(value:Number):void
windowLengthproperty 
windowLength:int

window length of simple moving avarage [ms]

The default value is 20.


Implementation
    public function get windowLength():int
    public function set windowLength(value:int):void
Constructor Detail
PeakDetector()Constructor
public function PeakDetector(frequency:Number = 0, bandWidth:Number = 0.5, windowLength:Number = 20, signalToNoiseRatio:Number = 20)

constructor

Parameters
frequency:Number (default = 0) — frequency of band pass filter [Hz], set 0 to skip filtering
 
bandWidth:Number (default = 0.5) — half band width of band pass filter [oct.]
 
windowLength:Number (default = 20) — window length of simple moving avarage [ms]
 
signalToNoiseRatio:Number (default = 20) — S/N ratio for peak detection [dB]
Method Detail
calcPeakIntencity()method
public function calcPeakIntencity(peakPosition:Number, integrateLength:Number = 10):Number

calcuate peak inetncity

Parameters

peakPosition:Number — peak positoin [ms]
 
integrateLength:Number (default = 10) — integration length [ms]

Returns
Number
calcPeaksPerMinuteEstimationScoreTable()method 
public static function calcPeaksPerMinuteEstimationScoreTable(peakList:Vector.<Number>, scoreTable:Vector.<Number> = null):Vector.<Number>

Parameters

peakList:Vector.<Number> — peal list [ms]
 
scoreTable:Vector.<Number> (default = null) — score table instance to set, null to create new table.

Returns
Vector.<Number> — score table
mergePeakList()method 
public static function mergePeakList(arrayOfPeakList:Array, singlePeakLength:Number = 40):Vector.<Number>

merage peak list

Parameters

arrayOfPeakList:Array — Array of peakList(Vector.<Number> type) to marge
 
singlePeakLength:Number (default = 40) — time distance to merge near peaks as 1 peak

Returns
Vector.<Number> — merged peak list
setSamples()method 
public function setSamples(samples:Vector.<Number>, channelCount:int = 2, isStreaming:Boolean = false):PeakDetector

set analyzing source samples

Parameters

samples:Vector.<Number> — analyzing source
 
channelCount:int (default = 2) — channel count of analyzing source
 
isStreaming:Boolean (default = false) — true to continuous data with previous analyze

Returns
PeakDetector — this instance