4
$\begingroup$

I have to clean my dataset of recordings concerning an African penguin colony inhabits the South African coast. In particular, since I have recordings with days of strong wind with clipped/noisy sounds, I need to detect and then remove all the files ruined by the wind (like the one attached) to create my final dataset.

Do you have some suggestions about the procedure? I did not find package or suggested procedure to fix this problem, I tried these methods:

  1. to adapt HardRain package for strong wind but it did not work (https://www.sciencedirect.com/science/article/pii/S1470160X19307873)

  2. I tried also to use WindNoiseDetection but it did not work well

  3. now I'm trying to use MonitoR package to detect all the windy event.

However, since this is a big and recurring problem of wild recordings it's strange that there are not automated and functioning packages of detection. Maybe I didn't search in the right way.

$\endgroup$
2
  • $\begingroup$ I do not see any audio attachments. Could you provide a zip archive of 10 clips with wind noise and 10 without (say 5 seconds to 1 minute long each)? Then it would be able to do a quick test of proposed approaches. $\endgroup$
    – Jon Nordby
    Commented Jun 18, 2023 at 21:40
  • 1
    $\begingroup$ Thank you very much, here (drive.google.com/drive/folders/…) there are 10 clips of 50 s with wind noise and 10 clips of 50 s without wind. $\endgroup$
    – fterranova
    Commented Jun 19, 2023 at 8:34

3 Answers 3

3
$\begingroup$

There are several generic audio classifier models that could be used to detect wind noise. For example, the AudioSet ontology includes the class Wind, and also the subclass Wind noise (Microphone). There are several pre-trained models available that do AudioSet classification, with pretty good performance overall and are easy to use. Examples include PANNs and YAMNet.

If the performance of those models are not satisfactory out-of-the-box, it is possible to make a model specifically on your data. This would require to annotate a smaller amount of your data with windy/not. Some minutes of data might be enough, though one would have to make sure to cover all the variation that exists in the dataset.

With such a dataset, one would use the pretrained audio models to extract a vector embedding from the audio, and then train a small/simple classifier on these vectors. For that approach, one can also use vector embedding models such as OpenL3.

$\endgroup$
1
  • $\begingroup$ Thakns Jon, this comment was really useful. I'm now trying the methods that you suggested. Let's see! $\endgroup$
    – fterranova
    Commented Jun 25, 2023 at 15:09
2
$\begingroup$

I propose a much simpler solution for cleaning your dataset. After looking at some of your windy files it is very apparent that there are 2 things that stick out to me compared to the non-windy files.

  • The number of times the audio clips per file.
  • The power/energy in the frequency bins below 550 Hz.

My approach for cleaning your dataset would be to do two things:

  • Count the number of times the audio file clips.
  • Compute the power spectrum for each file and sum up the power in the frequency bins from 1-550 Hz.

You can easily see that files which have a high number of clips/file and at the same time a lot of power in the lower frequency bands are the ones that are most likely containing a lot of wind (see results below).

You could implement a small script running through all of your files, computing the above mentioned values in any programming language such as Python, Matlab, R, ...

Matlab Code

fname = '/path/to/file.wav';

[y,fs] = audioread(fname);

n_clip = length(find(y>0.95));

window_fct = hamming(floor(length(y)/128));
overlap = 0.9;
nfft = 2^16;

[pxx,fx] = pwelch(y,window_fct,floor(overlap*length(window_fct)),nfft,fs);
pxx = 10*log10(pxx);

fx_relevant = find(fx<550);

P_below_550 = sum(pxx(fx_relevant));

Results

File path Audio > 0.95 Power < 550 Hz
"/tmp/biostack/STP03_20230328_1950362_nowind_eds.wav" 2 -62843
"/tmp/biostack/STP03_20230328_1950363_nowind_eds.wav" 0 -61881
"/tmp/biostack/STP03_20230328_1950364_nowind_eds.wav" 0 -61739
"/tmp/biostack/STP03_20230328_195036_nowind_eds.wav" 0 -62573
"/tmp/biostack/STP03_20230329_19300210_nowind_eds.wav" 82 -51638
"/tmp/biostack/STP03_20230329_1930025_nowind_eds.wav" 601 -43343
"/tmp/biostack/STP03_20230329_1930026_nowind_eds.wav" 316 -45589
"/tmp/biostack/STP03_20230329_1930027_nowind_eds.wav" 0 -60587
"/tmp/biostack/STP03_20230329_1930028_nowind_eds.wav" 0 -58075
"/tmp/biostack/STP03_20230329_1930029_nowind_eds.wav" 0 -61481
"/tmp/biostack/STP06_20230225_1930022_windy_noeds.wav" 1147 -35458
"/tmp/biostack/STP06_20230225_1930023_windy_noeds.wav" 1224 -34735
"/tmp/biostack/STP06_20230225_1930024_windy_noeds.wav" 1137 -34696
"/tmp/biostack/STP06_20230225_193002_windy_noeds.wav" 490 -36425
"/tmp/biostack/STP06_20230226_0500024_windy_eds.wav" 7146 -30641
"/tmp/biostack/STP06_20230226_0500025_windy_eds.wav" 4020 -31998
"/tmp/biostack/STP06_20230301_0530026_windy_eds.wav" 488 -36449
"/tmp/biostack/STP06_20230301_0530027_windy_eds.wav" 483 -36905
"/tmp/biostack/STP06_20230301_0530028_windy_eds.wav" 779 -35878
"/tmp/biostack/STP06_20230301_0530029_windy_eds.wav" 200 -38538
"/tmp/biostack/STP06_20230312_053002_windy_noeds.wav" 879 -34816
$\endgroup$
4
  • $\begingroup$ not discussing your approach, but if you say "energy in the lower frequency bands" then please estimate energy and not summing simply dB values. Also suggest to advice on threshold or better how to use your numbers $\endgroup$
    – WMXZ
    Commented Jun 28, 2023 at 12:45
  • $\begingroup$ I am not sure I understand the comment correctly. I am estimating the power in each frequency bin by using a Welchs PSD estimator. Then summing up the bins amplitude is the total power in the frequency band from 1-550Hz. Whether I am summing up dB or the linear amplitudes makes no difference. Its a proxy of how strong each frequency bin is represented in the signal. As for the threshold I would run the analysis on the whole dataset and then generate a histogram. I am pretty sure both categories (wind/no-wind) separate nicely in two distributions. Then from there you can pick a threshold. $\endgroup$
    – fth
    Commented Jun 28, 2023 at 14:03
  • $\begingroup$ You use the term "energy" that is estimated (up to a constant) by sum of power squared. Sure you can uum amplitudes or dB values as metric but they are not proxies for energy. Please note that others can read your text and your example and conclude energy is sum of dB values. $\endgroup$
    – WMXZ
    Commented Jun 28, 2023 at 14:37
  • $\begingroup$ I edited the post to avoid confusion. Hope its fine now. $\endgroup$
    – fth
    Commented Jun 28, 2023 at 16:18
1
$\begingroup$

I would like to thank all the users who helped me with this wind problem. A special thanks to Jon Nordby - your tip about using YAMNet was a game-changer for my data pre-processing. It actually led to the creation of a whole research paper, which you can check out here: https://www.sciencedirect.com/science/article/pii/S0048969724050174?via%3Dihub.

***For anyone looking for a solution to detect wind in recordings, please read the article linked above. Additionally, you can find a tutorial on how to preprocess your data and identify wind in your recordings here: https://github.com/Loreb92/wind-noise-detection/blob/main/README.md . *****

I’m really grateful for all your help. It’s amazing how much we can achieve together, and I think this is the best part of the bioacoustic.stackExchange community!

Thanks again for all your support!

Best, Francesca

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.