
function [peakFreq] = maxFreq(peakAmplitudes, peakFrequencies)

    len_peak = length(peakAmplitudes);
    len_freq = length(peakFrequencies);
    peakAmp = zeros(1,len_peak);   
    peakFreq = zeros(1,len_freq);

    for i=1:len_peak
        
        peakAmp(i) = max(peakAmplitudes{i});
        index = peakAmplitudes{i}==peakAmp(i);
        peakFreq(i) = peakFrequencies{i}(index);

    end

end