matlab code to generate rectangular pulse

Status
Not open for further replies.

ashokone

Member level 3
Joined
Sep 30, 2009
Messages
56
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
banglore
Activity points
1,659
fc=2e9;
fs = 20e9; % sample freq
D = [2.5 10 17.5]' * 1e-9; % pulse delay times
t = 0 : 1/fs : 2500/fs; % signal evaluation time
w = 4e-9; % width of each pulse
yp = pulstran(t,D,@rectpuls,w);

if we plot this using matlab..it will generate rectangular pulse train with amplite varying from 0 to 1.. but how to modify this code so that it has to generate a pulse(amplitude0 varying from (-1 to 1);
..please let me know how to modify..
is there any other method.
 

Only add this line in the code.
yp=2*yp-1;

Muhammad Hanif
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…