Namespace AnalysisPrograms
Classes
AcousticIndices
AcousticIndices.AcousticIndicesConfig
Aed
Acoustic Event Detection.
Aed.AedConfiguration
Aed.Arguments
The arguments.
AnalysesAvailable
Audio2InputForConvCnn
Use the following paths for the command line for the 'audio2sonogram' task. audio2InputForConvCNN "Path to CSV file" @"C:\Work\GitHub\audio-analysis\AudioAnalysis\AnalysisConfigFiles\Mangalam.Sonogram.yml" "Output directory" true.
Audio2InputForConvCnn.Arguments
Audio2InputForConvCnn.AudioToSonogramResult
In line class used to return results from the static method Audio2InputForConvCNN.GenerateFourSpectrogramImages().
Audio2InputForConvCnn.CsvDataRecord
In line class used to store a single record read from a line of the csv file.
Audio2InputForConvCnn.SpeciesCounts
AudioCutter
Cuts a file into smaller segments.
AudioCutter.Arguments
AudioFileCheck
AudioFileCheck.Arguments
BuildMetadata
Automatically generated metadata for the build that generated this code.
ChannelIntegrityAnalyzer
CheckEnvironment
CheckEnvironment.Arguments
ConcatenateIndexFiles
First argument on command line to call this action is "concatenateIndexFiles"
NOTE: This code was last tested on 2016 October 10. Both tests passed.
ConcatenateIndexFiles.Arguments
Create4Sonograms
TODO: THIS CLASS NOW OBSOLETE. CAN REMOVE. REPLACED BY SPECTROGRAM GENERATOR CLASS. Call this class by using the activity (first command line argument) "Create4Sonograms".
Create4Sonograms.Arguments
Crow
DifferenceSpectrogram
DifferenceSpectrogram.Arguments
DrawEasyImage
First argument on command line to call this action is "drawEasyImage".
DrawEasyImage.Arguments
DrawLongDurationSpectrograms
First argument on command line to call this action is "ColourSpectrogram" Activity Codes for other tasks to do with spectrograms and audio files:
audio2csv - Calls AnalyseLongRecording.Execute(): Outputs acoustic indices and LD false-colour spectrograms. audio2sonogram - Calls AnalysisPrograms.Audio2Sonogram.Main(): Produces a sonogram from an audio file - EITHER custom OR via SOX.Generates multiple spectrogram images and oscilllations info indicescsv2image - Calls DrawSummaryIndexTracks.Main(): Input csv file of summary indices. Outputs a tracks image. colourspectrogram - Calls DrawLongDurationSpectrograms.Execute(): Produces LD spectrograms from matrices of indices. zoomingspectrograms - Calls DrawZoomingSpectrograms.Execute(): Produces LD spectrograms on different time scales. differencespectrogram - Calls DifferenceSpectrogram.Execute(): Produces Long duration difference spectrograms
audiofilecheck - Writes information about audio files to a csv file. snr - Calls SnrAnalysis.Execute(): Calculates signal to noise ratio. audiocutter - Cuts audio into segments of desired length and format createfoursonograms.
DrawLongDurationSpectrograms.Arguments
DrawSummaryIndexTracks
- Produces a tracks image of column values in a csv file - one track per csv column. Signed off: Michael Towsey 27th July 2012.
DrawSummaryIndexTracks.Arguments
DummyAnalysis
The purpose of this analyser is to make inter-program parallelisation easier to develop.
DummyAnalysis.Arguments
EPR
This program runs an alternative version of Event Pattern Recognition (EPR) It can be used to detect Ground Parrots. It was developed by Michael Towsey in order to address difficulties in the original EPR algorithm - see more below. COMMAND LINE ARGUMENTS: string recordingPath = args[0]; //the recording to be scanned string iniPath = args[1]; //the initialisation file containing parameters for AED and EPR string targetName = args[2]; //prefix of name of the created output files
The program currently produces only ONE output file: an image of the recording to be scanned with an energy track and two score tracks.
- Energy track - Measure of the total energy in the user defined frequency band, one value per frame.
- Score Track 1 - Oscillation score - Requires user defined parameters to detect the repeated chirp of a Ground Parrot. Is a way to cut down the search space. Only deploy template at places where high Oscillation score.
- Score Track 2 - Template score - dB centre-surround difference of each template rectangle. Currently the dB Score is averaged over the 15 AEs in the groundparrot template.
THE EXISTING ALGORITHM:
- Convert the signal to dB spectrogram
- AED: i) noise removal ii) convert to binary using dB threshold. iii) Use spidering algorithm to marquee acoustic events. iv) Split over-size events where possible v) Remove under-size events.
- EPR: i) Align first AE of template to first 'valid' AE in spectrogram. A valid AE is one whose lower left vertex lies in the user-defined freq band. Currently align lower left vertex for groundparrot recogniser. ii) For each AE in template find closest AE in spectrogram. (Least euclidian distance) iii) For each AE in template, calculate percent overlap to closest AE in spectrogram. iv) Apply threshold to adjust the FP-FN trade-off.
PROBLEM WITH EXISTING ALGORITHM: AED: i) Major problem is that the AEs found by AED depend greatly on the user-supplied dB threshold. If threshold too low, the components of the ground parrot call get incorporated into a single larger AE. ii) The spidering algorithm (copied by Brad from MatLab into F#) is computationally expensive. EPR: i) EPR is hard coded for groundparrots. In particular the configuration of AEs in the template is hard-coded. ii) EPR is hard coded to align the template using the lower-left vertex of the first AE. This is suitable for the rising cadence of a groundparrot call - but not if descending.
POSSIBLE SOLUTIONS TO EPR AND AED AED: i) Need an approach whose result does not depend critically on the user-supplied dB threshold. SOLUTION: Try multiple thresholds starting high and dropping in 2dB steps - pick largest score. ii) Use oscillation detection (OD) to find locations where good change of ground parrot. This only works if the chirps are repeated at fixed interval. EPR: i) Instead of aligning lower-left of AEs align the centroid. ii) Only consider AEs whose centroid lies in the frequency band. iii) Only consider AEs whose area is 'similar' to first AE of template. iv) Only find overlaps for AEs 2-15 if first overlap exceeds the threshold.
############################################################################################################### TWO NEW EPR ALGORITHMS BELOW: IDEA 1: Note: NOT all the above ideas have been implemented. Just a few. The below does NOT implement AED and does not attempt noise removal to avoid the dB thresholding problem. The below uses a different EPR metric
- Convert the signal to dB spectrogram
- Detect energy oscillations in the user defined frequency band. i) Calulate the dB power in freq band of each frame.
- DCT: i) Use Discrete Cosine Transform to detect oscillations in band energy. ii) Only apply template where the DCT score exceeds a threshold (normalised). Align start of template to high dB frame.
- TEMPLATE SCORE i) Calculate dB score for first AE in template. dB score = max_dB - surround_dB where max_dB = max dB value for all pixels in first template AE. ii) Do not proceed if dB score below threshold else calculate dB score for remaining template AEs. iii) Calculate average dB score over all 15 AEs in template.
COMMENT ON NEW ALGORITHM
- It is very fast.
- Works well where call shows up as energy oscillation.
- Is not as accurate because the dB score has less discrimination than original EPR. BUT COULD COMBINE THE TWO APPROACHES.
############################################################################################################### IDEA 2: ANOTHER EPR ALGORITHM
Convert the signal to dB spectrogram
Detect energy oscillations in the user defined frequency band. i) Calulate the dB power in freq band of each frame.
DCT: OPTIONAL ONLY PROCEED IF HAVE HIGH dB SCORE and HIGH DCT SCORE
NOISE COMPENSAION Subtract modal noise but DO NOT truncate -dB values to zero.
AT POINTS THAT EXCEED dB and DCT thresholds i) loop through dB thresholds from 10dB down to 3dB in steps of 1-2dB. ii) determine valid AEs in freq band and within certain time range of current position. A valid AE has two attributes: a) entirely within freq band and time width; b) >= 70% overlap with first template AE iii) Accumulate a list of valid starting point AEs iv) Apply template to each valid start point. a) extract AEs at dB threshold apporpriate to the valid AE a) align centroid of valid AE with centroid of first template AE c) calculate the overlap score
EPR.Arguments
FileRenamer
FileRenamer.Arguments
GroundParrotRecogniser
The ground parrot recognizer.
GroundParrotRecogniser.Arguments
Human1
KoalaMale
NOTES: (1) The main part of a male koala call consists of a series of inhlations and exhalations; The inhalations are longer and sound like snoring. The exhalations are shorter and the sound is similar to belching. For more on the koala bellow see http://theconversation.com/grunt-work-unique-vocal-folds-give-koalas-their-low-pitched-voice-20800 The article interviews Dr. Ben Charlton who came to work with us in 2012.
(2) This class detects male koala calls by detecting the characteristic oscillations of their snoring or inhalations. These snoring oscillations = approx 20-50 per second. They are not constant but tend to increase in rate through the inhalation.
(3) In order to detect 50 oscillations/sec, we need at the very least 100 frames/sec and preferably a frame rate = 150/sec so that a period = 50/s sits near the middle of the array of DCT coefficients.
(4) Frame rate is affected by three parameters: 1) SAMPLING RATE; 2) FRAME LENGTH; 3) FRAME OVERLAP. If the SR ~= 170640, the FRAME LENGTH should = 256 or 512. The best way to adjust frame rate is to adjust frame overlap. I finally decided on the option of automatically calculating the frame overlap to suit the maximum oscillation to be detected. This calculation is done by the method OscillationDetector.CalculateRequiredFrameOverlap();
(5) One should not set the DCT length to be too long because (1) the DCT is expensive to calculate. and (2) the koala oscillation is not constant but the DCT assumes stationarity. 0.3s is good for koala. 0.5s - 1.0s is OK for canetoad.
(6) To reduce the probability of false-positives, the Koala Recognizer filters out oscillation events that are not accompanied by neighbouring oscillation events within 4 seconds. This filtering is done in the method KoalaMale.FilterMaleKoalaEvents().
The action code for this analysis (to enter on the command line) is "KoalaMale".
KoalaMale.KoalaMaleResults
LSKiwi3
LSKiwi3.Arguments
LSKiwiHelper
LSKiwiROC
SEPARATE PROCESSING TASK FOR KIWI OUTPUT little spotted kiwi calls from Andrew @ Victoria university. Signed off: Michael Towsey 27th July 2012.
LSKiwiROC.Arguments
MahnooshSandpit
MahnooshSandpit.Arguments
MainEntry
Main Entry for Analysis Programs.
OscillationRecogniser
OscillationRecogniser.Arguments
OscillationsGeneric
ACTIVITY NAME = oscillationsGeneric does a general search for oscillation in an audio file.
OscillationsGeneric.Arguments
PlanesTrainsAndAutomobiles
PreprocessorForConvDnn
This analyzer preprocesses short audio segments a few seconds to maximum 1 minute long for processing by a convolutional Deep NN. It does not accumulate data or other indices over a long recording.
PreprocessorForSurfAnalysis
This analyzer preprocesses short audio segments a few seconds to maximum 1 minute long for processing by a convolutional Deep NN. It does not accumulate data or other indices over a long recording.
RheobatrachusSilus
Sandpit
Activity Code for this class:= sandpit
Activity Codes for other tasks to do with spectrograms and audio files: audio2csv - Calls AnalyseLongRecording.Execute(): Outputs acoustic indices and LD false-colour spectrograms. audio2sonogram - Calls AnalysisPrograms.Audio2Sonogram.Main(): Produces a sonogram from an audio file - EITHER custom OR via SOX.Generates multiple spectrogram images and oscilllations info indicescsv2image - Calls DrawSummaryIndexTracks.Main(): Input csv file of summary indices. Outputs a tracks image. colourspectrogram - Calls DrawLongDurationSpectrograms.Execute(): Produces LD spectrograms from matrices of indices. drawzoomingspectrograms - Calls DrawZoomingSpectrograms.Execute(): Produces LD spectrograms on different time scales. differencespectrogram - Calls DifferenceSpectrogram.Execute(): Produces Long duration difference spectrograms
audiofilecheck - Writes information about audio files to a csv file. snr - Calls SnrAnalysis.Execute(): Calculates signal to noise ratio. audiocutter - Cuts audio into segments of desired length and format createfoursonograms.
Sandpit.Arguments
Segment
Segment.Arguments
SnrAnalysis
SnrAnalysis.Arguments
SpeciesAccumulationCurve
SpeciesAccumulationCurve.Arguments
SpeciesAccumulationStats
SPT
SPT.Arguments
SurfAnalysis
SurfAnalysis.Arguments
SurfAnalysis.AudioToSonogramResult
In line class used to return results from the static method GenerateFourSpectrogramImages().
SurfAnalysis.CsvDataRecord
In line class used to store a single record read from a line of the csv file.