So, i have this code:
[sound,fs,bits] = wavread(file);
[S,F,T] = spectrogram(sound, 256, 200, 256, fs);
plot(F,abs(S));
[sorted index] = sort(list,'descend');
Now i need to find the highest 3 peaks of the amplitudes in S (between the frequences 0 and 1000, 1000 and 2000 and > 2000), for that,i do the following:
ind = length(F);
for k=1:1:ind
if F(k) >= 0 && F(k) < 1000
listaAmpF1(k) = sorted(k);
else
if F(k) >= 1000 && F(k) < 2000
listaAmpF2(k) = sorted(k);
else
if F(k) >= 2000
listaAmpF3(k) = sorted(k);
end
end
end
end
maxAmpF1 = max(listaAmpF1);
maxAmpF2 = max(listaAmpF2);
maxAmpF3 = max(listaAmpF3);
Assuming that i have now all the max 3 amps that i need, i need to find now the corresponding frequences, how can i do that?
Edit: S and F have different lengths