You are on page 1of 2

# Written in Python(x,y)

# -*- coding: utf-8 -*"""


Created on Sun Sep 21 16:03:38 2014
@author: Anish
"""
import os
os.system('cls')
import numpy as np
import matplotlib.pyplot as plt
import BasicSignals01
N = 50
nvec = np.linspace(0, 5, num=N)
t = nvec
m=1
ad = 0
y = BasicSignals01.fn_ramp(t,m,ad)
plt.plot(t,y)
plt.xlabel('time')
plt.ylabel('Signal')
#----------------------------------------------------------------------------------------------------------------------------------------

# -*- coding: utf-8 -*"""


Created on Sun Sep 21 15:44:07 2014
@author: Anish
"""
import numpy as np
def fn_ramp(t,m,ad):
N = len(t)
y = np.zeros(N)
for i in range(1,N):
if t[i] >= -ad:
y[i] = m*(t[i]+ad)
return y

#----------------------------------------------------------------------------------------------------------------------------------------

Figure: Basic ramp signal

You might also like