How to change sawtooth function so it raises from 0.15 to 0.18 instead of -1 to 1
Question:
Answers:
You could do the following:
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
a = .15
b = .18
t = np.linspace(0, 3, 500)
y = (b+a)/2 + ((b-a)/2) * signal.sawtooth(np.pi * 4 * t)
plt.plot(t, y)
plt.show()
You could do the following:
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
a = .15
b = .18
t = np.linspace(0, 3, 500)
y = (b+a)/2 + ((b-a)/2) * signal.sawtooth(np.pi * 4 * t)
plt.plot(t, y)
plt.show()