Ive tried using the findpeaks function and using the location values however these do not seem to be in Hz how would i go about converting
Here is my code
p = 2^nextpow2(N);x = fft(y,nfft)/p; % performs fft of clip
forx = fs/2*linspace(0,1,nfft/2+1);X = 2*(abs(x(1:nfft/2+1)));[peakval, locval] = findpeaks(X,fs,'minpeakheight',1.8*10^-5);%% add synth
Freqs = locval;Xs = zeros(length(Freqs),length(time));for i=1:length(Freqs) %Xs(i,:) = singen(Freqs(i),fs,time);
Xs(i,:) = sin(2*pi*Freqs(i)*time);endx = sum(Xs);x = x./max(abs(x));soundsc(x)
Best Answer