Class NoiseProfile
contains info re noise profile of an entire spectrogram.
Assembly: AudioAnalysisTools.dll
public class NoiseProfile
Properties
|
Improve this Doc
View Source
Declaration
public double[] MaxDb { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double[] MinDb { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double[] NoiseMean { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double[] NoiseMedian { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double[] NoiseMode { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double[] NoiseSd { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public double[] NoiseThresholds { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
(1) MODAL METHOD
Calculates the modal background noise for each freqeuncy bin.
Return the smoothed modal profile.
Set the default zero value for number of SDs.
Declaration
public static double[] CalculateBackgroundNoise(double[, ] spectrogram)
Parameters
Type |
Name |
Description |
Double[,] |
spectrogram |
Assumes the passed spectrogram is oriented as: rows=frames, cols=freq bins.
|
Returns
|
Improve this Doc
View Source
(1) MEAN SUBTRACTION
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins.
Returns the noise profile over freq bins. i.e. one noise value per freq bin.
Note that NoiseThresholds array is identical to NoiseMedian array.
Declaration
public static NoiseProfile CalculateMeanNoiseProfile(double[, ] matrix)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
the spectrogram with origin top-left.
|
Returns
|
Improve this Doc
View Source
(1) MEDIAN SUBTRACTION
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins.
Returns the noise profile over freq bins. i.e. one noise value per freq bin.
Note that NoiseThresholds array is identical to NoiseMedian array.
Declaration
public static NoiseProfile CalculateMedianNoiseProfile(double[, ] matrix)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
the spectrogram with origin top-left.
|
Returns
|
Improve this Doc
View Source
(1) MODAL METHOD
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins.
Returns the noise profile over freq bins. i.e. one noise value per freq bin.
Declaration
public static NoiseProfile CalculateModalNoiseProfile(double[, ] matrix, double sdCount)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
the spectrogram with origin top-left.
|
Double |
sdCount |
number of standard deviations.
|
Returns
|
Improve this Doc
View Source
(4) FIRST N FRAMES
IMPORTANT: this method assumes that the first N frames (N=frameCount) DO NOT contain signal.
Declaration
public static double[] CalculateModalNoiseUsingStartFrames(double[, ] matrix, int firstNFramesCount)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
the spectrogram rotated with origin is top-left.
|
Int32 |
firstNFramesCount |
the first N rows of the spectrogram.
|
Returns
|
Improve this Doc
View Source
Declaration
public static NoiseProfile CalculatePercentileNoiseProfile(double[, ] matrix, int percentile)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
|
Int32 |
percentile |
|
Returns
|
Improve this Doc
View Source
(3) BIN-WISE LOWEST PERCENTILE CELLS METHOD
Assumes the passed matrix is a spectrogram.
Returns the noise profile over freq bins. i.e. one noise value per freq bin.
IMPORTANT: This is the preferred method to estiamte a noise profile for short recordings i.e LT approx 10-15 seconds long.
Declaration
public static double[] GetNoiseProfile_BinWiseFromLowestPercentileCells(double[, ] matrix, int lowPercentile)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
the spectrogram whose rows=frames, cols=freq bins.
|
Int32 |
lowPercentile |
The percent of lowest energy frames to be included in calculation of the noise profile.
|
Returns
|
Improve this Doc
View Source
(2) LOWEST PERCENTILE FRAMES METHOD
Assumes the passed matrix is a spectrogram and that all values in the data matrix are positive.
Returns the noise profile over freq bins. i.e. one noise value per freq bin.
First calculate the frame averages, sort in ascending order and accumulate the first N% of frames.
WARNING: This method should NOT be used for short recordings i.e LT approx 10-15 seconds long.
Declaration
public static double[] GetNoiseProfile_fromLowestPercentileFrames(double[, ] matrix, int lowPercentile)
Parameters
Type |
Name |
Description |
Double[,] |
matrix |
the spectrogram whose rows=frames, cols=freq bins.
|
Int32 |
lowPercentile |
The percent of lowest energy frames to be included in calculation of the noise profile.
|
Returns
Type |
Description |
Double[] |
Returns a noise profile consisting of averaged values from the selected X% of low energy frames.
|
Extension Methods