QutEcoacoustics / audio-analysis

The audio analysis code (AnalysisPrograms.exe) for the QUT Ecoacoustics Research Group
https://ap.qut.ecoacoustics.info/
Apache License 2.0
52 stars 12 forks source link

Calculate acoustic indices for short duration recordings #546

Closed p-rocha closed 1 year ago

p-rocha commented 1 year ago

Task at hand

I'm new to using AnalysisProgram and I'm looking to calculate a few acoustic indices from short-duration (10s) wav files. By reading the program's documentation, audio2csv seems to be the function I'm looking for. However, this function is meant for long-duration recordings and will attempt to cut my own recordings. Forgive my ignorance, but is there any way to skip cutting the recordings into blocks? Even better if I've missed something and there's actually a function that simply calculates the acoustic indices for any given wav file.

Thanks in advance!

The operating system I'm using is Windows 10

The version of AnalysisPrograms.exe I'm using is 21.7.0.4

atruskie commented 1 year ago

Hi @p-rocha,

The reason we impose a minimum duration is because our noise removal algorithm (for which several off the indices are based on) requires a decently sized sample to operate on.

The indices are also calculated by default for a 60 second resolution... At some point the calculation stops being representative of other minute based indices if the segment is too small and this can lead to subtle but import mistakes in analysis.

Can you explain your use case a little more? Do you really only have 10 second recordings?

p-rocha commented 1 year ago

Hi @atruskie,

Thanks for the swift response. The project I'm working on is meant to compare dB SPL data estimated using various methods (e.g. SPL meter, scikit-maad package) with results from the indices average signal amplitude, signal-to-noise-ratio and background noise, all of which provide data in dB. The restriction of using 10s recordings is because that's the duration of the signal used as control.

This project is primarily exploratory and experimental, but if the results are "accurate", I might model the dB SPL values calculated from longer (30~60s) recordings. In any case, the key issue is being able to calculate acoustic indices straight from short recordings, regardless of their duration, skipping the cutting/subsampling as this would have been "manually" done in previous steps of the analysis.

ps.: This is part of my PhD project being conducted at QUT under the supervision of Susan Fuller and Paul Roe

atruskie commented 1 year ago

As I mentioned already, that would produce indices that are invalid.

One thing you could do is set the IndexCalculationDuration setting to 10 (seconds) and provide the program with minute long segments. You can then extract just the indices result you want for your target 10 seconds.

The reason this works is we're able to take our noise sample from a wider segment and then calculate indices on only a sub-segment.

p-rocha commented 1 year ago

That seems to do the trick! I'll further explore it in the upcoming days. Thanks for your assistance.