Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top