Professional Documents
Culture Documents
Import As Import As: "Time in Seconds" "Amplitude" "Stationary Signal"
Import As Import As: "Time in Seconds" "Amplitude" "Stationary Signal"
import numpy as np #if not installed, install using pip install numpy in command window
import matplotlib.pyplot as plt #if not installed, install using pip install matplotlib incommand
fs=1000;
time=np.arange(0,5,1/fs); #generating the time axis
amplitude = np.sin(2*np.pi*2*time); #sinusoidal signal with a frequency component of 2 Hz
plt.plot(time, amplitude);
plt.xlabel("Time in seconds");
plt.ylabel("Amplitude");
plt.title("Stationary signal")
In [ ]: