% F_FILTR ... formant filter 
%
% Usage: y = f_filtr(Fi,Bi,fs,x)
%
% Parameters: Fi ... formant frequency [Hz]
%             Bi ... formant bandwidth [Hz]
%             fs ... sampling frequency [Hz]
%             x ...  excitation signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [y] = f_filtr(Fi,Bi,fs, x);

T = 1/fs;

C = -exp(-2*pi*Bi*T);
B = 2*exp(-pi*Bi*T)*cos(2*pi*Fi*T);
A = 1-C-B;

a = [1 -B -C];
b = A;

y = filter(b,a,x);
