Vous êtes sur la page 1sur 8

SIGNAL PROCESSING LAB

WEEKLY PROGRAM
CONTENTS
S.NO NAME OF THE TOPIC PAGE N0
1. PROBLEM STATEMENT 2
2. SPECIFICATION 3
3. LIST OF COMPONENTS USED 4
4. PIN CONFIGURATION DESCRIPTION 4
5. DESIGN PROCEDURE 7
6. LOGIC DIAGRAM 14
7. DETAILED DESCRIPTION 17

EXPERIMENT N0 1
INTRODUCTION TO PYTHON
Python is an interpreted high-level programming language for general-purpose programming.
Created by Guido van Rossum and first released in 1991, Python has a design philosophy that
emphasizes code readability, notably using significant whitespace. It provides constructs that
enable clear programming on both small and large scales. In July 2018, Van Rossum stepped
down as the leader in the language community after 30 years.

Python features a dynamic type system and automatic memory management. It supports
multiple programming paradigms, including object-oriented, imperative, functional and
procedural, and has a large and comprehensive standard library.

Python interpreters are available for many operating systems. CPython, the reference
implementation of Python, is open source software and has a community-based development
model, as do nearly all of Python's other implementations. Python and CPython are managed
by the non-profit Python Software Foundation.

EXPERIMENT NO 3
GENERATION OF SIGNALS
AIM:- TO GENERATE A SIGNAL USING PYTHON
XY
CODE FOR SINX :-

OUTPUT :-

CODE FOR UNIT RAMP:-


OUTPUT :-

UNIT STEP:-

OUTPUT :-
CODE FOR UNIT IMPULSE:-

OUTPUT:-

CODE FOR SIGNUM FUNCTION:-


import numpy as np
import matplotlib.pylab as plt
x=np.arange(-10,10,0.01)
n=len(x)
y=np.zeros(n)
for i in range (1,n):
if (x[i]>0):
y[i]=1
elif(x[i]<0):
y[i]=-1
elif (x[i]==0):
y[i]=0
plt.subplot(2,1,1)
plt.xlabel('time(t)')
plt.ylabel('amplitude')
plt.title('signum-continuous time')
plt.plot(x,y)
plt.subplot(2,1,2)
plt.xlabel('index(n)')
plt.ylabel('amplitude')
plt.title('signum-discrete time')
plt.stem(x,y)
plt.show()
OUTPUT:-

CODE FOR EXPONENTIAL:-


import numpy as np
import matplotlib.pylab as plt
x=np.arange(-10,10,0.1)
plt.subplot(2,1,1)
plt.xlabel('time(t)')
plt.ylabel('amplitude')
plt.title('exponential-continuous')
plt.plot(x,1*np.exp(x))
x1=np.arange(-10,10,1)
plt.subplot(2,1,2)
plt.title('exponential-discrete')
plt.xlabel('index(n)')
plt.ylabel('amplitude')
plt.stem(x1,1*np.exp(x1))
plt.show()

OUTPUT:-

Vous aimerez peut-être aussi