x='Examplefile.xls'; %%Insert the title of the Excel file produced by from Beating Signal analysis
timevalues=xlsread(x,'A:A');
ampvalues=xlsread(x,'B:B');
data = iddata(ampvalues,[],0.0396); %%The value '0.0396' is based on the framerate
fftData = fft(data);
plot(fftData)

[pks2, locs2]=islocalmax(ampvalues, 'MinSeparation',0.5, 'SamplePoints',timevalues)
output = [timevalues(pks2) ampvalues(pks2)]
xlswrite('Examplefile-peaks.xls', [timevalues(pks2) ampvalues(pks2)]); %%Insert the title of a new Excel file for the extraction of peaks
plot(timevalues,ampvalues, timevalues(pks2),ampvalues(pks2),'r*')