Created
November 15, 2020 23:13
-
-
Save cobanov/c16932ea1c5562f02cc27d7908cf85b9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 as np | |
import matplotlib.pyplot as plt | |
def create_signal(f): | |
w = 2 * np.pi * f | |
t = np.linspace(0, 0.1, 1000) | |
value = np.sin(w * t) | |
return t, value | |
t1, v1 = create_signal(10) | |
t2, v2 = create_signal(20) | |
v3 = list(map(lambda x, y: x if x > y else y, v1, v2)) | |
plt.plot(t1, v1, linestyle="dashed") | |
plt.plot(t2, v2, linestyle="dashed") | |
plt.plot(t2, v3) | |
plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment