www.pudn.com > EWT.rar > IFcleaning.m, change:2015-07-21,size:1628b

function f=IFcleaning(fin,lb,ub)
% function f=IFcleaning(fin,lb,ub)
% This function clean the frequencies which are out of the range [lb,ub].
% After detecting such intervals, an interpolation is used to replace these
% outliers.
% Inputs:
%   -fin: vector containing the instantaneous frequencies to be cleaned
%   -lb: lower frequency bound
%   -ub: upper frequency bound
% Outputs:
%   -f: cleaned instantaneous frequencies
% Author: Jerome Gilles
% Institution: UCLA - Department of Mathematics
% Year: 2014
% Version: 1.0

% Find the intervals where the frequency is out of the range
ind=find((fin>=lb) & (fin<=ub));

% check if we removed the first point, if yes then we need an initial point
% so, as we don't have any a priori, we fix this initial point to the first
% kept value
if ind(1)~=1
    fe=[fe(1) ; fe];   
    ind=[1 ; ind];

% check if we removed the last point, if yes then we need a final point so,
% as we don't have any a priori, we fix this final point to the last kept
% value
if ind(end)~=length(fin)
    fe=[fe ; fe(end)];
    ind=[ind ; length(fin)];

% we interpolate within the intervals previously detected (for the lowest
% frequency band we use a linear interpolation in order to avoid possible
% osccillation which will return us back to negative frequencies,
% otherwise we use spline interpolation
if lb==0