function [ f ] = freq( Fs, CH1, CH2 )
L_CH1 = length(CH1);
L_CH2 = length(CH2);
F_CH1=fft(CH1-mean(CH1));
F_CH2=fft(CH2-mean(CH2));

[~,indexMax_F_CH1] = max(abs(F_CH1));
frequency_CH1 = indexMax_F_CH1 * Fs / L_CH1;
[~,indexMax_F_CH2] = max(abs(F_CH2));
frequency_CH2 = indexMax_F_CH2 * Fs / L_CH2;

f=(frequency_CH1+frequency_CH2)/2;

disp('frekvencia CH1: ');
disp(frequency_CH1);
disp('frekvencia CH2: ');
disp(frequency_CH2);
end