fork download
  1. import scipy
  2. import scipy.fftpack
  3. import cmath
  4. import math
  5. import matplotlib.pyplot as plt
  6. import numpy as np
  7. from scipy import signal
  8. from scipy.signal import freqs, iirfilter
  9. x = np.linspace(0, 1024, 1024) # диапазон значений x
  10. byts = np.array([0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1])
  11. ff = 64 # %Частота несущей
  12. ns = np.sin(2 * np.pi * (x - 1) * ff / 1024) # несущая
  13. y = ns * byts[np.round((x + 31) / 64).astype(int)] # %сигнал
  14. plt.plot(y)
Runtime error #stdin #stdout #stderr 0.73s 419520KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 13, in <module>
IndexError: index 16 is out of bounds for axis 1 with size 16