MATLAB Matlab - finding peaks

  • Thread starter Ophyron
  • Start date

i'm pretty new to matlab - but i've been using it to perform FFT's on .wav files to graph frequency and amplitude. i've been using the following code to generate the graphs:

[h,Fs] = wavread('x.wav');

H = fft(h);

N = length(h);

f = (0:(N-1))*(Fs/N);

t = (0:(N-1))/Fs;

xlabel('Frequency (Hz)');
ylabel('Amplitude (dB)');

is there any way i can find the frequency at which peaks appear, and the amplitude of these peaks with code? i'm only really interested in the peaks in the first 5000Hz or so, above about 20dB. anyone got any ideas? any pointers would be much appreciated! thanks

take care


Want to reply to this thread?

"Matlab - finding peaks" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving