matlab脉冲发生器 脉冲发生器matlab程序
function p=pulsegen(fs,T,edge,type,f,opt);
%p=pulsegen(fs,T,edge,type,f,opt);
%a signal generation program
%fs is the sampling frequency
%T is the total signal length
%edge is a decay parameter for some waveforms
% it is used in 'gaussian', 'monocycle', 'biexponential', 'mexican hat', 'sinc', 'double sinc', 'sinc squared'
% and windowed sweep
% it is mostly a parameter to describe how much the edge of the pulse is decayed.
%type is the type of the waveform desired
% allowable types are 'gaussian', 'square', 'triangle', 'monocycle',
% 'biexponential', 'mexican hat', 'sinc', 'double sinc', 'sinc squared','sweep', and 'windowed sweep'
%f is the modulation frequency if left out it is assumed 0.
%opt is an optional argument for pulse waveforms requiring a lower and higher frequency % it is used in 'double sinc' ,'sweep' and 'windowed sweep' for the low and high frequency. % the pulses are always normalized to a peak amplitude of 1