I'm working on a project that detects the pulse width of an audio signal, which uses a microphone as an input. The user gives 2 different types of sounds one last less 0.3 seconds and other lasting less than 0.7 seconds. I've attached the audio visualisation of the signal pic in the attachment. All want to detect is their pulse widths.
I tried Pulsein() - but as you can see that it has a variable until 0.3 or 0.7 seconds it only detect the first and most peak and returns the value which is almost zero.
But all I need is the total time taken for the pulse to rise from 0 and to variate and then become 0 this total time period is what I require. would duty cycle help ? or any other functions available to detect two different sounds in arduino ?