MATLAB - Finding Peaks and Valleys : <p>So I have 2 .wav files that was recorded frequency. One is the original audio and the other one is the filtered one. Both are stereo .wav files.</p>

<p>Right now, I am supposed to find the peaks and valleys of these 2 .wav file.
I was told to that I have to take 3 consecutive data and determine which of the 3 is the max or the min. If the middle one is the max or the min, then peak/valley have been found. Repeat this until there are no more data.</p>

<p>How should I achieve the above?</p>

<p>I was told to do a sliding window of size 3 and take 3 points by 3 points.</p>

<p>I googled it but could not find how to start. Could anyone assist please. Thank You!</p>
