title: Detecting Number of Claps using MATLAB
body: <p>I'd like to detect the number of claps in a given wav file. Here's my first attempt. I can draw the spectogram but how can I print " There is only one clap " or " There are two claps " on the console? And can you suggest any other ways to the same problem? Here is my code:</p>
  
  <pre><code>hfile = 'two.wav';
  
  [stereo1, Fs, nbits, readinfo] = wavread(hfile);
  mono1 = mean(stereo1,2);
  
  M = round(0.01*Fs); 
  N = 2^nextpow2(4*M);
  w = hamming(M);
  
  spectrogram(mono1,w,120,N,Fs);
  </code></pre>