概要
python3で振幅復調してみた。
復調アルゴリズムは、hilbert
写真
サンプルコード
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import hilbert
sample_rate = 48000.
nsamples = 320
F_1KHz = 1000.
A_1KHz = 1.0
F_15KHz = 15000.
A_15KHz = 0.5
F_14KHz = 14800.
t = np.arange(nsamples) / sample_rate
vin = A_1KHz * np.sin(2 * np.pi * F_1KHz * t)
vam = (A_1KHz * np.sin(2 * np.pi * F_1KHz * t) + 1.0) * A_15KHz * np.sin(2 * np.pi * F_15KHz * t)
hil = hilbert(vam)
o = np.abs(hil)
fig = plt.figure(1)
ax = fig.add_subplot(311)
ax.plot(vin[1: 300])
ax = fig.add_subplot(312)
ax.plot(vam[1: 300])
ax = fig.add_subplot(313)
ax.plot(o[1: 300])
fig.set_tight_layout(True)
plt.savefig("am4.png")
plt.show()