Class OnebinTrackAlgorithm
This class searches a spectrogram for whistles, that is, for tones or spectral peaks that persist in one frequency bin. In practice, the whistles of birds and other natural sources do not occupy a single frequency bin, although this statement is confounded by the choice of recording sample rate and frame size. But typically, a bird whistle spreads itself across three or more frequency bins using typical values for SR etc. In this class, we make an assumption about the spectral profile of a whistle and the user is expected to find the appropriate sample rate, frame size and frame step such that the target whistle is detected using the profile. We define a whistle profile that is 11 bins wide. The actual whistle occupies the centre three bins, ie bins -1, 0 , +1. Bins -2 and +2 are ignored to allow for some flexibility in getting he right combination of sample rate, frame size and frame step. To establish that the centre three bins contain a spectral peak (i.e. are part of a potential whistle), we define top and bottom sidebands, each of width three bins. These are used to establish a baseline intensity which must be less than that of the centre three bins. The bottom sideband = bins -3, -4, -5. The top sideband = bins +3, +4, +5. Defining a whistle this way introduces edge effects at the top and bottom of the spectrogram. In case of the low frequency edge, in order to get as close as possible to the frequency bin zero, we do not incorporate a bottom sidebound into the calculations. Also note that a typical bird whistle is not exactly a pure tone. It typically fluctuates slightly from one frequency bin to an adjacent bin and back. Consequently a final step in this whistle detection algorithm is to merge adjacent whistle tracks. The algorithm is not perfect but it does detect constant tone sounds. Theis algorithm is designed so as not to pick up chirps, i.e. gradually rising and falling tones. However, here again the right choice of SR, frame size and frame step are important.
Inherited Members
Namespace: AudioAnalysisTools.Tracks
Assembly: AudioAnalysisTools.dll
Syntax
public static class OnebinTrackAlgorithm
Methods
| Improve this Doc View SourceGetOnebinTrack(Double[,], Int32, Int32, Double, UnitConverters)
Declaration
public static Track GetOnebinTrack(double[, ] peaks, int startRow, int bin, double threshold, UnitConverters converter)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | peaks | |
Int32 | startRow | |
Int32 | bin | |
Double | threshold | |
Unit |
converter |
Returns
Type | Description |
---|---|
Track |
GetOnebinTracks(SpectrogramStandard, OnebinTrackParameters, Nullable<Double>, TimeSpan, String)
Declaration
public static (List<EventCommon> Events, List<Plot> DecibelPlots) GetOnebinTracks(SpectrogramStandard spectrogram, OnebinTrackParameters parameters, double? decibelThreshold, TimeSpan segmentStartOffset, string profileName)
Parameters
Type | Name | Description |
---|---|---|
Spectrogram |
spectrogram | |
Onebin |
parameters | |
Nullable<Double> | decibelThreshold | |
Time |
segmentStartOffset | |
String | profileName |
Returns
Type | Description |
---|---|
(T1, T2)<List<Event |
GetOnebinTracks(SpectrogramStandard, OnebinTrackParameters, TimeSpan, Double)
This method returns whistle (spectral peak) tracks enclosed as spectral events. It averages dB log values incorrectly but it is faster than doing many log conversions.
Declaration
public static (List<EventCommon> ListOfevents, double[] CombinedIntensityArray) GetOnebinTracks(SpectrogramStandard spectrogram, OnebinTrackParameters parameters, TimeSpan segmentStartOffset, double decibelThreshold)
Parameters
Type | Name | Description |
---|---|---|
Spectrogram |
spectrogram | The spectrogram to be searched. |
Onebin |
parameters | The parameters that determine the search. |
Time |
segmentStartOffset | Enables assignment of a start time (relative to recording) to any valid event. |
Double | decibelThreshold | The threshold for detection of a track. |
Returns
Type | Description |
---|---|
(T1, T2)<List<Event |
A list of acoustic events containing whistle tracks. |
GetOnebinTracks(Double[,], Double, Double, Double, UnitConverters)
This method finds whistle tracks, that is horizontal ridges in one frequency bin.
Declaration
public static List<Track> GetOnebinTracks(double[, ] peaks, double minDuration, double maxDuration, double threshold, UnitConverters converter)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | peaks | Peaks matrix. |
Double | minDuration | Minimum duration of a whistle. |
Double | maxDuration | Maximum duration of a whistle. |
Double | threshold | Minimum amplitude threshold to be valid whistle. |
Unit |
converter | For the time/frequency scales. |