Created
February 19, 2018 05:57
-
-
Save denismaster/aa01731a0395317379a1c833dc408aca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy | |
import matplotlib.pyplot as plt | |
print("Введите X_min") | |
xmin=int(input()) | |
print("Введите X_max") | |
xmax=int(input()) | |
xcoords = numpy.arange(xmin, xmax+1, 0.1) | |
toSin = lambda x: numpy.sin(x) | |
mapFunc = numpy.vectorize(toSin) | |
sinus = mapFunc(xcoords) | |
plt.title("График синусоиды") | |
plt.plot(sinus, color='red', linewidth=2); | |
plt.show() | |
mean = 0 | |
std = 1 | |
samples = numpy.random.normal(mean, std, size=sinus.shape[0]) | |
plt.title("Белый шум") | |
plt.plot(samples) | |
plt.show() | |
sum = numpy.add(sinus, samples) | |
plt.title("Смесь синусоиды и белого шума") | |
plt.plot(sum) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment