예제 #1
0
    def plot_bode(self,b,c):
	s1 = signal.lti(b,c)
	w, mag, phase = signal.bode(s1)
	plt.figure()
	plt.grid()
	plt.semilog(w, mag)
	plt.semilog(w, phase)
	plt.show()
예제 #2
0
 def plot_bode(self, b, c):
     s1 = signal.lti(b, c)
     w, mag, phase = signal.bode(s1)
     plt.figure()
     plt.grid()
     plt.semilog(w, mag)
     plt.semilog(w, phase)
     plt.show()
def basic_plot(params):
    # nothing fancy, just plot it
    if params.type == "loglog":
        plt.loglog(params.xax, params.yax, '.')
    elif params.type == "log":
        plt.semilog(params.xax, params.yax, '.')
    elif params.type == "bar":
        plt.bar(params.xax, params.yax)
    else:
        plt.plot(params.xax, params.yax, '.')

    plt.xlabel(params.xlabel)
    plt.ylabel(params.ylabel)
    plt.title(params.title)
    plt.show()
예제 #4
0
파일: psd.py 프로젝트: kgofron/FFT
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np

fs = 10e3
N = 1e5
amp = 2 * np.sqrt(2)
freq = 1234.0
noise_power = 0.001 * fs / 2
time = np.arange(N) / fs
x = amp * np.sin(2 * np.pi * freq * time)
x += np.random.normal(scale=np.sqrt(noise_power), size=time.shape)

f, Pxx_den = signal.welch(x, fs, nperseg=1024)
plt.semilog(f, Pxx_den)
plt.ylim(0.5e-3, 1)
plt.xlabel('frequency (Hz)')
plt.ylabel('PSD [V**2/Hz]')
plt.show()
예제 #5
0
파일: psd.py 프로젝트: kgofron/FFT
from scipy import signal
import matplotlib.pyplot as plt
import numpy as np

fs = 10e3
N=1e5
amp = 2*np.sqrt(2)
freq = 1234.0
noise_power =0.001 * fs / 2
time = np.arange(N) / fs
x = amp*np.sin(2*np.pi*freq*time)
x += np.random.normal(scale=np.sqrt(noise_power), size=time.shape)

f, Pxx_den = signal.welch(x, fs, nperseg=1024)
plt.semilog(f, Pxx_den)
plt.ylim(0.5e-3, 1)
plt.xlabel('frequency (Hz)')
plt.ylabel('PSD [V**2/Hz]')
plt.show()