% ////////////////////////////////////////////////////////////////////
% FILE,     HBF2LCfg.m
% PROJECT,  HBF2L
% AUTHOR,   weitao.du
% DATE,     2007.Jun.11th
% VERSION,  0.1
% ////////////////////////////////////////////////////////////////////
% DECRIPTION
% 2 Level Half Band Fir Filter Design and Simulation, generate Config 
% ////////////////////////////////////////////////////////////////////

function cfg = HBF2LCfg();
  fprintf(1, 'HBF2LCfg, run\n');

  % set your simulation config here
    % stim config
    wNoise      = 1;    % white noise
    sine        = 2;    % sine signal
    stepUp      = 3;    % step Up sequency for debug only  
    stimType    = wNoise;
    stimLen     = 1024;
    loadDbgStim =   0;  % load debug stim data
    DBGFILENAME = 'InputDataDbg.mat';

  % model config
    % word Length config
    
    inputWL     = 18;   % input data Word Length, include sign bit
    coeffWL     = 18;   % coefficents Word Length, include sign bit

    adderWL     = 19;   % symetrical adder output word length
    adderFL     = 17;   % symetrical adder output integer length, include sign bit

    multWL      = 19;   % multply word length
    multFL      = 17;   % multply integer part length, include sign bit

    outputWL    = 23;   % output data Word Length
    outputFL1   = 17;   % level 1 HBF output data integer Length, include sign bit
    outputFL2   = 17;   % level 2 output data integer Length, include sign bit

    % filter order config
    K1          = 16;    % 1st level HBF is 4*K1-1 taps, with 0 and symmetry coeff
    K2          = 8;     % 2nd level HBF is 4*K2-1 taps, with 0 and symmetry coeff
   
    % half band pass-band setting
    inputFs     = 2048*1E3;    % input sampling frequency 
    inputBw     = 768*1E3;     % input signal bandwidth 
    passBand1   = inputBw/(inputFs  );  % hbf1 pass band 
    passBand2   = inputBw/(inputFs*2);  % hbf2 pass band 
    
    cfg.inputFs     = inputFs  ;
    cfg.inputBw     = inputBw  ;

    cfg.wNoise      = wNoise   ;
    cfg.sine        = sine     ;
    cfg.stepUp      = stepUp   ;
    cfg.stimType    = stimType ;
    cfg.stimLen     = stimLen  ;
    cfg.loadDbgStim = loadDbgStim;
    cfg.DBGFILENAME = DBGFILENAME;

    cfg.inputWL     = inputWL  ;
    cfg.coeffWL     = coeffWL  ;
    cfg.adderWL     = adderWL  ;
    cfg.adderFL     = adderFL  ;
    cfg.multWL      = multWL   ;
    cfg.multFL      = multFL   ;
    cfg.outputWL    = outputWL ;
    cfg.outputFL1   = outputFL1;
    cfg.outputFL2   = outputFL2;

                               ;
    cfg.K1          = K1       ;
    cfg.K2          = K2       ;

    cfg.passBand1   = passBand1;
    cfg.passBand2   = passBand2;
             
% half band pend  % function HBF2LCfg();
