From 199668d4f4c6ed65a3da3b679ccecb7f3360b43c Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Sun, 20 May 2018 14:07:57 +0300 Subject: More slide updates --- talk.slides.html | 103 ++++++++++++++++++------------------------------------- 1 file changed, 34 insertions(+), 69 deletions(-) (limited to 'talk.slides.html') diff --git a/talk.slides.html b/talk.slides.html index d88e18d..31d711f 100644 --- a/talk.slides.html +++ b/talk.slides.html @@ -11953,20 +11953,30 @@ a.anchor-link {

import numpy as np
-import matplotlib.pyplot as plt
-modulator_frequency = 4.0
-carrier_frequency = 40.0
-modulation_index = 1.0
-size = 44100.0 * 2
-
-time = np.arange(size) / size
-modulator = np.sin(2.0 * np.pi * modulator_frequency * time) * modulation_index
-carrier = np.sin(2.0 * np.pi * carrier_frequency * time)
-
-product = np.zeros_like(modulator)
-for i, t in enumerate(time):
- product[i] = np.sin(2. * np.pi * (carrier_frequency * t + modulator[i]))
-
-modulator = np.sin(2.0 * np.pi * modulator_frequency * time) * modulation_index
-amp = np.zeros_like(modulator)
-for i, t in enumerate(time):
- amp[i] = np.sin(2. * np.pi * (carrier_frequency * t * modulator[i]))
-plt.subplot(4, 1, 1)
-plt.title('Frequency Modulation')
-plt.plot(modulator)
-plt.ylabel('Amplitude')
-plt.xlabel('Modulator signal')
-
-plt.subplot(4, 1, 2)
-plt.plot(carrier)
-plt.ylabel('Amplitude')
-plt.xlabel('Carrier signal')
-
-plt.subplot(4, 1, 3)
-plt.plot(product)
-plt.ylabel('Amplitude')
-plt.xlabel('Output signal')
-
-plt.subplot(4, 1, 4)
-plt.plot(modulator * carrier)
-plt.ylabel('Amplitude')
-plt.xlabel('Output signal')
-plt.show()
-