def n_even_fcn(f, o, w, l):
"""Even case."""
# Variables :
k = np.array(range(0, int(l) + 1, 1)) + 0.5
b = np.zeros(k.shape)
# # Run Loop :
for s in range(0, len(f), 2):
m = (o[s + 1] - o[s]) / (f[s + 1] - f[s])
b1 = o[s] - m * f[s]
b = b + (m / (4 * np.pi * np.pi) * (np.cos(2 * np.pi * k * f[
s + 1]) - np.cos(2 * np.pi * k * f[s])) / (
k * k)) * abs(np.square(w[round((s + 1) / 2)]))
b = b + (f[s + 1] * (m * f[s + 1] + b1) * np.sinc(2 * k * f[
s + 1]) - f[s] * (m * f[s] + b1) * np.sinc(2 * k * f[s])) * abs(
np.square(w[round((s + 1) / 2)]))
a = (np.square(w[0])) * 4 * b
h = 0.5 * np.concatenate((np.flipud(a), a))
return h
评论列表
文章目录