Skip to content

Instantly share code, notes, and snippets.

@OmarAlkousa
Last active January 25, 2023 11:44
Show Gist options
  • Save OmarAlkousa/e3fb07ab6d2f45726de5c02e39a50db4 to your computer and use it in GitHub Desktop.
Save OmarAlkousa/e3fb07ab6d2f45726de5c02e39a50db4 to your computer and use it in GitHub Desktop.
This gist is to represent how to generate a simple random signal using numpy package and plot the results using matplotlib.
# Import the required packages
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('seaborn-poster')
%matplotlib inline
# Generate a random signal with length 10
random_signal = np.random.rand(100)
# Plot the results
plt.plot(random_signal)
plt.xlabel('samples')
plt.ylabel('amplitude')
plt.title('Noise Signal')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment