%********************************************************************
% ExpChanTaps.m
%     								     
% Return the FIR channel taps for the exponential channel model	     
% for indoor multipath.		       				     
%								     
% INPUTS:		    				     
%	sampRateMHz = sampling rate in MHz 			     
%       (reciprocal of tap spacing in usec)			     
%	delaySprdNsec =	delay spread in nsec (0 generates Rayleigh)  
%                                                                    
% OUTPUTS:                                                      
%	taps = complex channel taps for the exponential channel model
%
% AUTHOR:
%       Steve Halford, Intersil, shalford@intersil.com
%
% ACKNOWLEDGEMENTS:
%
% Thanks to Steve Halford for coding the agreed upon model and 
% submitting it to the IEEE 802.11g.  Thanks to Steve Halford,
% Mark Webster, Chris Heegard, Sean Coffey, Matthew Shoemake, 
% Naftali Chayat and the other members of IEEE 802.11 that 
% contributed to this model and its precise use in TGg simulations
%
% REFERENCES:
%   98/156, 00/282, 00/285
%
% CONTACTS:
%   Matthew B. Shoemake, IEEE 802.11g Chairperson, shoemake@ti.com
%
% VERSION: 1.0
%
% DATE: October 10, 2000
%
%********************************************************************

function [taps] = ExpChanTaps(sampRateMHz, delaySprdNsec)

sampTimeNsec = 1000 / sampRateMHz;

if delaySprdNsec == 0
   Kmax = 0;
   vark = 1;
else
   Kmax = ceil( 10 * delaySprdNsec/sampTimeNsec );
   var0 = 1 - exp( - sampTimeNsec/delaySprdNsec );
   k = (0:Kmax)';
   vark = var0 * exp( - k*sampTimeNsec/delaySprdNsec );
end

stdDevReOrIm = sqrt(vark/2);
taps = stdDevReOrIm .* (randn(Kmax+1,1) + j*randn(Kmax+1,1));

return;
