Detecting occurences of a sound
Forum rules
This forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Detecting occurences of a sound
I've got a 2 hour nature recording, and at random intervals all through it I can hear a soft thump, which might be a distant gun shot. I'd like to find them all so I can use the longest uninterrupted section. I can only hear them if I listen carefully with headphones with no background noise, so they're easy to miss, and I'm wondering if there's an automatic way to detect them.
I was able to make them more obvious by running a low pass filter at about 200Hz, but it still very tedious to listen to. I can see them better on a spectrogram once I've done this, but it gives me lots of false positives because it's hard to see their length and abruptness.
There's a one minute downloadable sample here: http://soundcloud.com/petershute/dawn-c ... enys-track. I've marked the positions of the thumps.
I'd also appreciate any opinions about what the noises might be.
I was able to make them more obvious by running a low pass filter at about 200Hz, but it still very tedious to listen to. I can see them better on a spectrogram once I've done this, but it gives me lots of false positives because it's hard to see their length and abruptness.
There's a one minute downloadable sample here: http://soundcloud.com/petershute/dawn-c ... enys-track. I've marked the positions of the thumps.
I'd also appreciate any opinions about what the noises might be.
-
kozikowski
- Forum Staff
- Posts: 69374
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Detecting occurences of a sound
It does sound like gunshots.
Apply a low pass filter of 120Hz at 24dB per octave. Select that one sharp spike in the middle and delete it.
Effect > Amplify > OK.
That should give you the display in the picture. All those spikes are booms.
Koz
Apply a low pass filter of 120Hz at 24dB per octave. Select that one sharp spike in the middle and delete it.
Effect > Amplify > OK.
That should give you the display in the picture. All those spikes are booms.
Koz
- Attachments
-
- Picture 1.png (35.65 KiB) Viewed 933 times
-
kozikowski
- Forum Staff
- Posts: 69374
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Detecting occurences of a sound
Of course you could just go around them by applying a high pass filter around 100Hz - 12dB. If you had trouble hearing them before, they should almost vanish if you do that. Juggle the values a bit.
This is the kind of thing we minimize by applying the filter at the time of recording -- particularly if we're shooting human voices.
Koz
This is the kind of thing we minimize by applying the filter at the time of recording -- particularly if we're shooting human voices.
Koz
Re: Detecting occurences of a sound
I don't have it in front of me to try it, but I'll give that a go tonight. You've just filtered at a lower frequency than I did, and perhaps made them more obvious. However, there are other sounds in other parts of the recording that also make big spikes like that when I use a low pass filter, e.g. the sound of birds fluttering near the microphone. The difference is that the gunshots, or whatever they are, start more abruptly. Is it possible that there's some way to highlight abrupt sounds in that frequency range? If not then I have to check them all.kozikowski wrote:It does sound like gunshots.
Apply a low pass filter of 120Hz at 24dB per octave. Select that one sharp spike in the middle and delete it.
Effect > Amplify > OK.
That should give you the display in the picture. All those spikes are booms.
Koz
-
kozikowski
- Forum Staff
- Posts: 69374
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Detecting occurences of a sound
Yes, if you have very low frequency thumping from something in the show, that's the end of automated tools and easy solutions. Somebody would have to write code to do that, and then there will only be one customer.
Koz
Koz
Re: Detecting occurences of a sound
I just found a better way. I adjusted the spectrogram parameters to make them more visible. I left everything at the default settings except:
size = 32768
max freq= 200
Now I can see them easily without even fiddling with low pass filters. I've only tried it on the one minute sample, so hopefully the high size value won't make it too slow to be usable on the long track. 8192 seems much faster, and is still usable.
I've also reassigned ctrl+Q to "Paste Text To New Label" (which I never knew existed before), and now I can mark them all quickly. An automated method would have been nice, but this is a million times better than I had before. Thanks for your help.
size = 32768
max freq= 200
Now I can see them easily without even fiddling with low pass filters. I've only tried it on the one minute sample, so hopefully the high size value won't make it too slow to be usable on the long track. 8192 seems much faster, and is still usable.
I've also reassigned ctrl+Q to "Paste Text To New Label" (which I never knew existed before), and now I can mark them all quickly. An automated method would have been nice, but this is a million times better than I had before. Thanks for your help.
Re: Detecting occurences of a sound
Try running this code in the "Nyquist Prompt" effect on a duplicate copy of the track. (make a duplicate copy of the track by selecting the entire track, then press Ctrl+D)
You will see peaks where there are "booms".
You will then need to "look" and "listen" to those sections that show up as "booms".
When you have looked at a few you will probably be able to identify the gunshots from what they look like. For example this is the obvious one zoomed in at 23 seconds:
Code: Select all
(clip (mult 10 (highpass8 (lowpass8 s 100) 10)) 0.8)You will then need to "look" and "listen" to those sections that show up as "booms".
When you have looked at a few you will probably be able to identify the gunshots from what they look like. For example this is the obvious one zoomed in at 23 seconds:
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Detecting occurences of a sound
Thanks, I've never used the nyquist prompt before. I'm guessing that filters everything outside the 10-100Hz range then amplifies the result? What does "clip" do?steve wrote:Try running this code in the "Nyquist Prompt" effect on a duplicate copy of the track. (make a duplicate copy of the track by selecting the entire track, then press Ctrl+D)
You will see peaks where there are "booms".Code: Select all
(clip (mult 10 (highpass8 (lowpass8 s 100) 10)) 0.8)
You will then need to "look" and "listen" to those sections that show up as "booms".
When you have looked at a few you will probably be able to identify the gunshots from what they look like. For example this is the obvious one zoomed in at 23 seconds:
I think my spectrogram method highlights them better with less fiddling around, but thanks for the intro to nyquist programming.
Re: Detecting occurences of a sound
I wonder if it's possible to write nyquist code to detect sets of points where they are, say, 1/100 of a second apart and rising by more than a certain value, and insert a label at that point. That might find all the abrupt sounds. It probably needs the high frequencies removed first, using the code you provided. I think I'll give the spectrogram method a go tonight, it might be all I need, and then fiddle with this if I find time.
Re: Detecting occurences of a sound
If you have any "geek" in you, you'll love itpshute wrote:Thanks, I've never used the nyquist prompt before.
Spot on.pshute wrote: I'm guessing that filters everything outside the 10-100Hz range then amplifies the result?
It "clips" (truncates) the amplitude to a maximum of 0.8 (linear track scale).pshute wrote:What does "clip" do?
This does 2 things:
1) It helps to prevent blowing your speakers or ear drums when there is a "boom"
2) It helps to make the booms show up terrifically on "spectrogram" track view because it "clips" the peaks, creating a surge right across the audio spectrum which shows up as a vertical line:
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)