You are on page 1of 1

import numpy as np

import matplotlib.pyplot as plt


def X(t):
x = []
for j in t:
s1 = 0
s1 += 2.5*np.sin(2*np.pi*1000*t)
x.append(s1)
return x
def X1(t):
y = []
for j in t:
s2 = 0
s2 += 1.75*np.sin(2*np.pi*2000*t)
y.append(s2)
return y
def X2(t):
z = []
for j in t:
s3 = 0
s3 += -0.75*np.sin(2*np.pi*4000*t)
z.append(s3)
return z
def X3(t):
y = []
for j in t:
s2 = 0
s2 += 1.75*np.sin(2*np.pi*2000*t)+2.5*np.sin(2*np.pi*1000*t)+(-
0.75)*np.sin(2*np.pi*4000*t)
y.append(s2)
return y

T = np.linspace(0 , 0.001 , 100)


F = X(T)
F1 = X1(T)
F2 = X2(T)
F3 = X3(T)
i = 0;
for s,m,n in zip(F,F1,F2):
F3.append((s+m+n)%5)
plt.figure( )

plt.subplot(2,2,1).plot(T,F[0], c = "green")
plt.title("sunisoid 1")
plt.subplot(2,2,2).plot(T,F1[0], c = "blue")
plt.title("sunisoid 2")
plt.subplot(2,2,3).plot(T,F2[0], c = "red")
plt.title("sunisoid 3")
plt.subplot(2,2,4).plot(T,F3[0], c = "orange")
plt.title("la somme")
plt.show()

You might also like