Class SpectralPeakTracking2018
This class contain the pure algorithm that finds spectral peak tracks from a db spectrogram and settings.
Inheritance
SpectralPeakTracking2018
Assembly: AudioAnalysisTools.dll
public static class SpectralPeakTracking2018
Methods
|
Improve this Doc
View Source
outputs the average energy within a specified band.
Declaration
public static double CalculateAverageEnergy(double[] spectrum, int minInd, int maxInd)
Parameters
Returns
|
Improve this Doc
View Source
draw the spectrogram with red marks indicating the local spectral peaks.
Declaration
public static Image DrawSonogram(BaseSonogram sonogram, double[, ] hits)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image |
|
|
Improve this Doc
View Source
draw the spectrogram with spectral tracks.
Declaration
public static Image DrawTracks(BaseSonogram sonogram, double[, ] hits, List<Track> tracks)
Parameters
Returns
Type |
Description |
SixLabors.ImageSharp.Image |
|
|
Improve this Doc
View Source
find spectral peaks per frame by subtracting the average energy of top and bottom band from the syllable band energy.
then if it is higher than a dB threshold, the index of the peak bin will be returned.
Declaration
public static Tuple<int[][], int[][]> FindLocalSpectralPeaks(double[, ] matrix, int[] peakBinsIndex, int widthMidBand, int topBufferSize, int bottomBufferSize, double threshold)
Parameters
Returns
|
Improve this Doc
View Source
outputs a matrix with arbitrary minimum and maximum frequency bins.
this method exists in PatchSampling class.
Declaration
public static double[, ] GetArbitraryFreqBandMatrix(double[, ] matrix, int minFreqBin, int maxFreqBin)
Parameters
Returns
|
Improve this Doc
View Source
outputs a matrix with arbitrary boundaries to Y (freq) and X (time) axes.
Declaration
public static double[, ] GetArbitraryMatrix(double[, ] matrix, int startY, int endY, int startX, int endX)
Parameters
Returns
|
Improve this Doc
View Source
outputs an array of peak bins indices per frame.
Declaration
public static int[] GetPeakBinsIndex(double[, ] matrix, int minFreqBin, int maxFreqBin)
Parameters
Returns
|
Improve this Doc
View Source
outputs a matrix with the same size of the input matrix.
all values are zero, except the points of interest (i.e., local spectral peaks).
these bins can be filled with amplitude values or 1.
Declaration
public static double[, ] MakeHitMatrix(double[, ] matrix, int[][] pointsOfInterest, int[][] bandIndex)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
|
Int32[][] |
pointsOfInterest |
|
Int32[][] |
bandIndex |
|
Returns
|
Improve this Doc
View Source
Declaration
public static int[] MakeSpectralPeakArray(double[, ] matrix, int[][] targetPeakBinsIndex)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
|
Int32[][] |
targetPeakBinsIndex |
|
Returns
|
Improve this Doc
View Source
Declaration
public static SpectralPeakTracking2018.Output SpectralPeakTracking(double[, ] spectrogram, SpectralPeakTrackingSettings settings, double hertzPerFreqBin, double timePerFrame)
Parameters
Returns
|
Improve this Doc
View Source
if there is any local peak in a frame, this method will middle the peak bin and will count the following peaks in a
pre-defined boundary (startX, endX, startY, endY). If the number of peaks in that boundary is higher than a threshold,
that will be considered as a call.
Declaration
public static List<object[]> SpectralPeakTracking(double[, ] spectrogram, int[] SpectralPeakArray, double timePerFrame, double hertzPerFreqBin)
Parameters
Returns