Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Лаба 3 / main

.py
Скачиваний:
1
Добавлен:
30.05.2025
Размер:
399 б
Скачать
import matplotlib.pyplot as plt
import numpy as np

freq = 0.0125 # carrier signal freq
period_per_bit = 10
level_len = period_per_bit/freq
bit_seq = np.array([1, 0, 1, 1, 0])

sig_len = level_len * len(bit_seq)

x = np.arange(0, sig_len)
y = np.sin(2 * np.pi * freq * x)

wide_seq = np.repeat(bit_seq, level_len)
m = wide_seq*y

plt.plot(x,wide_seq,x,m)
plt.savefig('plot.png')
Соседние файлы в папке Лаба 3