function [ch_LowPassFilt,LowB,LowA,ch_HighPassFilt,HighB,HighA,LowFreqsMat,HighFreqsMat,LowRipMat,HighRipMat,LowFiltType,HighFiltType,...
            LowFiltOrder,HighFiltOrder] = GetHighLowFiltCoeff(SampRate,HighDefFreqsMat,HighDefRipMat,LowDefFreqsMat,LowDefRipMat,...
	        ch_LowPassFilt,ch_HighPassFilt,FunctionStatus)
        
%   GetHighLowFiltCoeff
% 
%   See also PREPRO, GETLOWFILTCOEFF, GETHIGHFILTCOEFF.

%	Markus Junghoefer	[1995]
%   This software is protected by german copyright and international treaties.             
%   Copyright 2004 Markus Junghöfer & Peter Peyk. All Rights Reserved.                     
%                                                                                          
%   THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE        
%   NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO,    
%   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE    
%   OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
%   TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT,       
%   INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE      
%   OR DOCUMENTATION.

	global num den FreqsMat LowFiltOrder LowFiltType LowRipMat HighFiltOrder HighFiltType HighRipMat
FiltType = [];
hFiltFig=[];    

HighFiltType = [];
HighFiltOrder = [];
HighRipMat = [];   

LowFiltType = [];
LowFiltOrder = [];
LowRipMat = [];

if nargin<8; FunctionStatus = 0;end;
if nargin<7; ch_HighPassFilt=[]; end;
if nargin<6; ch_LowPassFilt=[]; end;
if nargin<5; LowDefRipMat=[]; end;
if nargin<4; LowDefFreqsMat=[]; end;
if nargin<3; HighDefRipMat=[]; end;
if nargin<2; HighDefFreqsMat=[]; end;
if nargin<1; SampRate=[]; end;



[SampRate]=IfEmptyInputSpecVal(SampRate,[125 250],[250],['Please insert the sampling rate:']);

if isempty(HighDefRipMat); HighDefRipMat=[3 45]; end
if isempty(HighDefFreqsMat); HighDefFreqsMat=[SampRate 5 2]; end
if isempty(LowDefRipMat); LowDefRipMat=[3 45]; end
if isempty(LowDefFreqsMat); LowDefFreqsMat=[SampRate 40 50]; end

[ch_LowPassFilt]=IfEmptyInputBo(['Do you want to filter channels lowpass ?'],[],ch_LowPassFilt,1,1);
if ch_LowPassFilt
	[num,den,FreqsMat,hFigure,LowRipMat,LowFiltType,LowFiltOrder]=GetLowFiltCoeff('initialize',[],LowDefFreqsMat,LowDefRipMat,FunctionStatus);
	waitfor(hFigure);
	LowB=num;
	LowA=den;
	LowFreqsMat=FreqsMat;
else
	LowB=[];
	LowA=[];
	LowFreqsMat=[];
end
[ch_HighPassFilt]=IfEmptyInputBo(['Do you want to filter channels highpass ?'],[],ch_HighPassFilt,1,1);
if ch_HighPassFilt
	[num,den,FreqsMat,hFigure,HighRipMat,HighFiltType,HighFiltOrder]=GetHighFiltCoeff('initialize',[],HighDefFreqsMat,HighDefRipMat,FunctionStatus);
	waitfor(hFigure);
	HighB=num;
	HighA=den;
	HighFreqsMat=FreqsMat;
else
	HighB=[];
	HighA=[];
	HighFreqsMat=[];
end
return
