I would like to plot peaks on the autocorrelation graph. however, the findpeaks function does not give me the peaks of the autocorrelation graph. Is there something wrong with my code?
I have a histogram that looks like this:
I use this histogram to plot the autocorrelation:
and when I use the findpeaks function to find and plot the peaks, I get this:
my code is:
MINval = min(CODCT);MAXval = max(CODCT);width = 1;h=hist(CODCT,floor(MINval):width:ceil(MAXval)); %histogram
x = h;Rxx=autom(x); %autocorrelation
figure()grid;[pks,locs] = findpeaks(Rxx);plot(Rxx); hold onplot(Rxx(locs),pks,'k^','markerfacecolor',[1 0 0]), hold off
Best Answer