发布网友 发布时间:2024-05-05 15:38
共2个回答
热心网友 时间:2024-11-26 18:27
这个函数包是别人写好的(也可以自己写),你找到这个函数包的m文件,然后将它拷贝到你自己所写的代码文件夹里(软件左侧可以看到文件夹)就可以了。热心网友 时间:2024-11-26 18:28
pulstran(t,d,p,fs,w)其中t是时间,d为函数偏移(如y = func(t-d(1)) + func(t-d(2)) + ... );p是函数类型,'gauspuls',表示高斯类型,'tripuls'表示三角类型;fs表示频次;w表示带宽。官方解释: pulstran generates pulsetrains from continuous functions or sampled prototype pulses. y = pulstran(t,d,'func') generatesa pulse train based on samples of a continuous function, 'func',where 'func' is 'gauspuls', for generating a Gaussian-molatedsinusoidal pulse 'rectpuls', for generating a sampledaperiodic rectangle 'tripuls', for generating a sampledaperiodic triangle pulstran is evaluated length(d) timesand returns the sum of the evaluations y = func(t-d(1)) + func(t-d(2)) + ... The function is evaluated over the range of argument valuesspecified in array t, after removinga scalar argument offset taken from the vector d.Note that func must be a vectorized functionthat can take an array t as an argument. An optional gain factor may be applied to each delayed evaluationby specifying d as a two-column matrix, with theoffset defined in column 1 and associated gain incolumn 2 of d. Note that a row vector will be interpretedas specifying delays only. pulstran(t,d,'func',p1,p2,...) allowsadditional parameters to be passed to 'func' asnecessary. For example: func(t-d(1),p1,p2,...) + func(t-d(2),p1,p2,...) + ... pulstran(t,d,p,fs) generatesa pulse train that is the sum of multiple delayed interpolations ofthe prototype pulse in vector p, sampled at therate fs, where p spansthe time interval [0,(length(p)-1)/fs], and itssamples are identically 0 outside this interval.By default, linear interpolation is used for generating delays. pulstran(t,d,p) assumesthat the sampling rate fs is equal to 1 Hz. This example generates a periodic Gaussian pulse signal at 10 kHz with 50% bandwidth. The pulse repetition frequency is 1 kHz, the sample rate is 50 kHz, and the pulse train length is 10 ms. The repetition amplitude should attenuate by 0.8 each time. 调用举例: t = 0 : 1/50e3 : 10e-3; d = [0 : 1/1e3 : 10e-3 ; 0.8.^(0:10)]'; y = pulstran(t,d,'gauspuls',10e3,0.5); plot(t,y)