---
+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Member level 3
    Points: 937, Level: 6

    Join Date
    Sep 2009
    Location
    banglore
    Posts
    56
    Helped
    1 / 1
    Points
    937
    Level
    6

    matlab code to generate rectangular pulse

    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.

    •   Alt1st December 2009, 08:38

      advertising

        
       

  2. #2
    Member level 2
    Points: 1,438, Level: 8

    Join Date
    Jun 2008
    Location
    Universe
    Posts
    50
    Helped
    15 / 15
    Points
    1,438
    Level
    8

    matlab code to generate rectangular pulse

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

    Muhammad Hanif



+ Post New Thread
Please login