Last active
April 13, 2020 03:20
-
-
Save nihalpasham/bd5503247faeb35bbdd1760b8288d200 to your computer and use it in GitHub Desktop.
Plotting a DSSS binary code sequence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from matplotlib.pyplot import step, xlim, ylim, show | |
| a = np.array([-1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1]) | |
| b = np.tile(a, 1) | |
| x = np.arange(0, 127) | |
| fig, (ax1) = plt.subplots(1, figsize=(15,4)) | |
| ax1.step(x, b) | |
| ax1.set(xlabel='Sample Number', ylabel='Amplitude') | |
| ax1.set_title('127-bit DSSS Binary Code Sequence', fontsize=12, fontweight="bold") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment