function [fc, bw] = estimate_frequency(data,Fs) %-- Function %-- Authors: Alfonso Rodriguez-Molares (alfonso.r.molares@ntnu.no) %-- Olivier Bernard (olivier.bernard@creatis.insa-lyon.fr) %-- $Date: 2016/03/01 $ [fx] = tools.power_spectrum(data,Fs); fpw = filter(ones(1,26)./26,1,pw);fpw=[fpw(13:end); zeros(12,1)]; [dc] = max(fpw.*(fx>0).'); fc=fx(ic); bw_up = min(fx((fx>fc)&(fpw