Class NoiseRemoval_Briggs
Inherited Members
Namespace: AudioAnalysisTools.DSP
Assembly: AudioAnalysisTools.dll
Syntax
public static class NoiseRemoval_Briggs
Methods
| Improve this Doc View SourceBriggsNoiseFilterAndGetMask(Double[,], Int32, Double)
Declaration
public static double[, ] BriggsNoiseFilterAndGetMask(double[, ] matrix, int percentileThreshold, double binaryThreshold)
Parameters
Returns
Type | Description |
---|---|
Double[,] |
BriggsNoiseFilterAndGetSonograms(Double[,], Int32, Double, TimeSpan, TimeSpan, TimeSpan, Int32, Int32)
Declaration
public static Image BriggsNoiseFilterAndGetSonograms(double[, ] matrix, int percentileThreshold, double binaryThreshold, TimeSpan recordingDuration, TimeSpan xAxisInterval, TimeSpan stepDuration, int nyquist, int herzInterval)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | matrix | |
Int32 | percentileThreshold | |
Double | binaryThreshold | |
Time |
recordingDuration | |
Time |
xAxisInterval | |
Time |
stepDuration | |
Int32 | nyquist | |
Int32 | herzInterval |
Returns
Type | Description |
---|---|
Six |
CalculateLocalVariance1(Double[], Int32)
This was written for the local contrast normalisation (LCN) of amplitude spectrograms. However the contrast is calculated wrt the local part of frequency bin or column. Plugging up ends of the returned array as done here is a hack but it does not really matter.
Declaration
public static double[] CalculateLocalVariance1(double[] data, int window)
Parameters
Returns
Type | Description |
---|---|
Double[] |
CalculateLocalVariance2(Double[,], Int32, Int32)
THis method is equivalent to the above method - CalculateLocalVariance1(), except that the local variance is derived from a local matrix rather than the local frequency bin.
Declaration
public static double[] CalculateLocalVariance2(double[, ] matrix, int colId, int rowWindow)
Parameters
Returns
Type | Description |
---|---|
Double[] |
DrawSonogram(Double[,], TimeSpan, TimeSpan, TimeSpan, Int32, Int32, String)
Declaration
public static Image<Rgb24> DrawSonogram(double[, ] data, TimeSpan recordingDuration, TimeSpan xInterval, TimeSpan xAxisPixelDuration, int nyquist, int herzInterval, string title)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | data | |
Time |
recordingDuration | |
Time |
xInterval | |
Time |
xAxisPixelDuration | |
Int32 | nyquist | |
Int32 | herzInterval | |
String | title |
Returns
Type | Description |
---|---|
Six |
NoiseReductionByDivision(Double[,], Int32)
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins. WARNING: This method should NOT be used for short recordings (i.e LT approx 10-15 seconds long) Obtains a background noise profile from the passed percentile of lowest energy frames, Then divide cell energy by the profile value. This method was adapted from a paper by Briggs.
Declaration
public static double[, ] NoiseReductionByDivision(double[, ] matrix, int percentileThreshold)
Parameters
Returns
Type | Description |
---|---|
Double[,] |
NoiseReductionByDivisionAndSqrRoot(Double[,], Int32)
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins. WARNING: This method should NOT be used for short recordings (i.e LT approx 10-15 seconds long) because it obtains a background noise profile from the passed percentile of lowest energy frames.
Same method as above except take square root of the cell energy divided by the noise. Taking the square root has the effect of reducing image contrast.
Declaration
public static double[, ] NoiseReductionByDivisionAndSqrRoot(double[, ] matrix, int percentileThreshold)
Parameters
Returns
Type | Description |
---|---|
Double[,] |
NoiseReductionByLcn(Double[,], Int32, Double)
THis method similar to the above BUT: 1: it does not do initial subtraction of lowest percentile noise. 2: it calculates local variance from local matrix andnot local frequency bin. Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins. Currently, the denominator = (contrastLevel + Math.Sqrt(localVariance[y]) A low contrastLevel = 0.1 give more grey image. A high contrastLevel = 1.0 give mostly white high contrast image. I tried various other normalisation equations as can be seen below. NOTE: Taking square-root of top line results in too much background. The algorithm is not overly sensitive to the neighbourhood size.
Declaration
public static double[, ] NoiseReductionByLcn(double[, ] matrix, int neighbourhood, double contrastLevel)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | matrix | |
Int32 | neighbourhood | suitable vaues are odd numbers 9 - 59. |
Double | contrastLevel | Suitable values are 0.1 to 1.0. |
Returns
Type | Description |
---|---|
Double[,] |
NoiseReductionByLcn(Double[,], Int32, Int32, Double)
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins. First obtains background noise profile calculated from lowest 20% of cells for each freq bin independently. Loop over freq bins (columns) - subtract noise and divide by LCN (Local Contrast Normalisation.
The LCN denominator = (contrastLevelConstant + Sqrt(localVariance[y]) Note that sqrt of variance = std dev. A low contrastLevel = 0.1 give more grey image. A high contrastLevel = 1.0 give mostly white high contrast image.
Declaration
public static double[, ] NoiseReductionByLcn(double[, ] matrix, int lowPercent, int neighbourhood, double contrastLevel)
Parameters
Returns
Type | Description |
---|---|
Double[,] |
NoiseReductionByLowestPercentileSubtraction(Double[,], Int32)
Assumes the passed matrix is a spectrogram. i.e. rows=frames, cols=freq bins, and that all values in data matrix are positive. WARNING: This method should NOT be used for short recordings (i.e LT approx 10-15 seconds long) Obtains a background noise profile from the passed percentile of lowest energy frames, Then subtracts the noise profile value from every cell. This method was adapted from a paper by Briggs.
Declaration
public static double[, ] NoiseReductionByLowestPercentileSubtraction(double[, ] matrix, int percentileThreshold)
Parameters
Type | Name | Description |
---|---|---|
Double[,] | matrix | the passed amplitude or energy spectrogram. |
Int32 | percentileThreshold | Must be an integer percent. |
Returns
Type | Description |
---|---|
Double[,] | Spectrogram data matrix with noise subtracted. |