In [1]:
%matplotlib inline
In [5]:
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
In [6]:
x=list(range(10))
print(x)
In [7]:
y=[10,5,5,8,9,1,2,3,4,8]
In [10]:
plt.plot(x, y)
plt.show()
In [14]:
from math import cos
y=list()
x=list()
for i in range(500):
x.append(i)
y.append(cos(i/10.0))
In [15]:
y[1:10]
Out[15]:
In [16]:
plt.plot(x, y)
plt.show()
In [55]:
from math import exp
y1=list()
y2=list()
x=list()
for i in range(500):
x.append(i)
carrier = cos(i/10.0)
signal = exp(-abs(i-250)/100.0)
y1.append(signal)
y2.append(carrier*signal)
plt.plot(x, y1)
plt.plot(x, y2)
plt.show()
In [60]:
plt.plot(x, y1 , label = "signal")
plt.plot(x, y2, label = "final")
plt.legend(loc='upper right')
plt.show()
In [ ]: