Ich habe AM-Modulation und Demodulation mit Python versucht. Demodulation zerstört den IQ.
import numpy as np
import scipy.signal as sg
import matplotlib.pyplot as plt
sample_rate = 48000.
nsamples = 320
F_1KHz = 1000.
A_1KHz = 1.0
F_15KHz = 15000.
A_15KHz = 0.5
F_14KHz = 14800.
A_14KHz = 0.8
t = arange(nsamples) / sample_rate
vin = A_1KHz * sin(2 * pi * F_1KHz * t)
vam = (A_1KHz * sin(2 * pi * F_1KHz * t) + 1.0) * A_15KHz * sin(2 * pi * F_15KHz * t)
i1 = vam * np.cos(2 * np.pi * F_14KHz * t)
q1 = vam * np.sin(2 * np.pi * F_14KHz * t)
nyq_rate = sample_rate / 2.
cutoff_hz = 6000.0
numtaps = 29
lpf = firwin(numtaps, cutoff_hz / nyq_rate)
i2 = sg.lfilter(lpf, 1, i1)
q2 = sg.lfilter(lpf, 1, q1)
o = np.sqrt(i2 * i2 + q2 * q2)
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.show()
Recommended Posts