www.gusucode.com > UWB_matlab源码程序 > CP0201/cp0201_waveform.m
% % FUNCTION 2.5 : "cp0201_waveform" % % Generates the energy-normalized pulse waveform % % Special case of the second derivative Gaussian pulse: % SCHOLTZ'S MONOCYCLE % % ********************************************************* % ref: % Scholtz R.A. "Multiple Access with Time-Hopping Impulse % Modulation" % in Proceedings of MILCOM'93, 1993, pp. 679-691 % ********************************************************* % % 'fc' is the sampling frequency % 'Tm' is the pulse duration % 'tau' is the shaping parameter % % Programmed by Guerino Giancola % function [w0]= cp0201_waveform(fc,Tm,tau); % ------------------------------------ % Step One - Pulse waveform generation % ------------------------------------ dt = 1 / fc; % reference sampling period OVER = floor(Tm/dt); % number of samples representing % the pulse e = mod(OVER,2); kbk = floor(OVER/2); tmp = linspace(dt,Tm/2,kbk); s = (1-4.*pi.*((tmp./tau).^2)).* ... exp(-2.*pi.*((tmp./tau).^2)); if e % OVER is odd for k=1:length(s) y(kbk+1)=1; y(kbk+1+k)=s(k); y(kbk+1-k)=s(k); end else % OVER is even for k=1:length(s) y(kbk+k)=s(k); y(kbk+1-k)=s(k); end end E = sum((y.^2).*dt); % pulse energy w0 = y ./ (E^0.5); % energy normalization