import numpy as np
from matplotlib import pyplot as plt
from matplotlib.animation import ArtistAnimation
import scienceplots
#Warning : As of version 2.0.0, you need to add import scienceplots before setting the style (plt.style.use('science')).
plt.style.use(['science', 'notebook'])
波形のユーザ関数
def funcv2(alpha): # 関数の定義
return np.sin(alpha)
def funcv3(alpha,nT): # 関数の定義
n = len(alpha)
y = np.zeros(n)
x1 = alpha >= 0.0 # 信号の範囲
x2 = alpha <= pi2*nT # 信号の範囲
x3 = np.logical_and(x1, x2)
y = np.where(x3, funcv2(alpha), 0.0)
return y