Alex Rivera | Logout

Given an audio stream, find when a door slams (sound pressure level calculation?)

Asked 2009-01-31T23:29:24.933
41

Not unlike a clap detector ("Clap on! clap clap Clap off! clap clap Clap on, clap off, the Clapper! clap clap ") I need to detect when a door closes. This is in a vehicle, which is easier than a room or household door:

Listen: http://ubasics.com/so/van_driver_door_closing.wav

Look:
image of waveform shows steady line, then sudden disruption, settling down to steady line

It's sampling at 16bits 4khz, and I'd like to avoid lots of processing or storage of samples.

When you look at it in audacity or another waveform tool it's quite distinctive, and almost always clips due to the increase in sound pressure in the vehicle - even when the windows and other doors are open:

Listen: http://ubasics.com/so/van_driverdoorclosing_slidingdoorsopen_windowsopen_engineon.wav

Look:
alt text

I expect there's a relatively simple algorithm that would take readings at 4kHz, 8 bits, and keep track of the 'steady state'. When the algorithm detects a significant increase in the sound level it would mark the spot.

  • What are your thoughts?
  • How would you detect this event?
  • Are there code examples of sound pressure level calculations that might help?
  • Can I get away with less frequent sampling (1kHz or even slower?)

Update: Playing with Octave (open source numerical analysis - similar to M

Edit
Report

1 Answer

3

I would imagine that the frequency and amplitude would also vary significantly from vehicle to vehicle. Best way to determine that would be taking a sample in a Civic versus a big SUV. Perhaps you could have the user close the door in a "learning" mode to get the amplitude and frequency signature. Then you could use that to compare when in usage mode.

You could also consider using Fourier analysis to eliminate background noises that aren't associated with the door close.

answered 2009-02-01T00:41:25.677

Your Answer