SHARE
TWEET

Untitled

a guest Oct 20th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %NRZ polar
  2. b=[1 0 1 0];
  3. %bits to level mapping
  4.  
  5. for p=1:length(b)
  6.     if b(p)==1;
  7.         x(p)=5;
  8.        
  9.     else
  10.         x(p)=0;
  11.        
  12.     end
  13. end
  14.  
  15. i=1;
  16.  
  17. t= 0:0.01:length(b);
  18. for j=1:length(t)
  19. if t(j)<=i
  20.    
  21.     y(j)=x(i)
  22.  
  23. else
  24.     i=i+1;
  25.    
  26.    y(j)=x(i);
  27. end
  28. end
  29.  
  30. plot(t,y,'b');
  31. axis ([ 0 7 -2 7]);
  32. xlabel('time');
  33. ylabel('ampitude');
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top