0% found this document useful (1 vote)
115 views2 pages

Triangular Pulse to Impulse Signal Analysis

Python code for generating and triangular pulse and to show that it approximates an impulse signal in the limit

Uploaded by

anish25
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
115 views2 pages

Triangular Pulse to Impulse Signal Analysis

Python code for generating and triangular pulse and to show that it approximates an impulse signal in the limit

Uploaded by

anish25
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

Created on Thu Sep 25 20:35:51 2014


@author: Anish
"""
# Importing libraries
import os
[Link]('cls')
import numpy as np
import [Link] as plt
import BasicSignals01 as BSig
N1 = 100
nvec1 = [Link](-N1, N1, num=2*N1)
N2 = 500
N3 = N2/10
nvec2 = [Link](1, N2, num=N3)
delvec = 1/nvec2
t = nvec1/N1
ix = 0
while ix < N3:
delx = delvec[ix]
ix = ix + 1
u_t_p = BSig.fn_ustep(t,delx)
u_t_m = BSig.fn_ustep(t,-delx)
L_del_t = 1/delx*(1-abs(t)/delx)*(u_t_p-u_t_m)
[Link](t,L_del_t,'r')
[Link]() # redraw the canvas
pause(.50)

#------------------------------------------------------------------------------------------------------------------# -*- 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 = [Link](N)
for i in range(1,N):
if t[i] >= -ad:
y[i] = m*(t[i]+ad)

return y
def fn_ustep(t,ad):
N = len(t)
y = [Link](N)
for i in range(1,N):
if t[i] >= -ad:
y[i] = 1
return y

Fig. Traingular pulse approaches an impulse signal (in limit)

You might also like