function g=check_lsf(f,delta_f_min); % Syntax: g=check_lsf(f,delta_f_min); % % Function for checking the minimal distance of Line Spectrum Frequencies LSF. % f is the column vector of normalized LSFs (Fe=1), size P, where P % is the order of prediction/synthesis filter. % delta_f_min (optional) is the minimal difference of two LSFs. The % default is 0.01 (which is equivalent to 80Hz in case Fe=8000Hz). % The function is also forcing f(1) not to be zero - min. is delta_f_min. % the vectors f and g are COLUMN. if(nargin == 1), % default delta_f_min=0.01; end M=length(f); f=[0; f]; for i=2:M+1, if f(i)-f(i-1) < delta_f_min, f(i) = f(i-1) + delta_f_min; end end if f(M+1) > 0.5, disp ('check_lsf: warning - the last LSF after the checking is greater than 1/2'); end g=f(2:M+1);