
STATLAB/ListaFunkcji: Różnice pomiędzy wersjami
Z Brain-wiki
| Linia 130: | Linia 130: | ||
| ====Wykresy Matplotlib==== | ====Wykresy Matplotlib==== | ||
| http://matplotlib.org/api/pyplot_api.html | http://matplotlib.org/api/pyplot_api.html | ||
| − | + | {| | |
| − | plot | + | |plot | 
| − | stem | + | |stem | 
| − | subplot | + | |subplot | 
| − | figure | + | |figure | 
| − | imshow | + | |- | 
| − | title | + | |imshow | 
| − | xlim | + | |title | 
| − | xlab | + | |xlim | 
| − | label | + | |ylim | 
| − | legend | + | |- | 
| − | grid | + | |xlab | 
| − | show | + | |ylab | 
| − | fill_between | + | |label | 
| − | step | + | |legend | 
| + | |- | ||
| + | |grid | ||
| + | |show | ||
| + | |fill_between | ||
| + | |step | ||
| + | |} | ||
| ===Dodatkowe=== | ===Dodatkowe=== | ||
Wersja z 20:45, 4 lis 2015
Spis treści
Biblioteki
Lista funkcji
Matematyczne z pakietu numpy
| numpy.sin | numpy.exp | numpy.log | numpy.real | 
| numpy.imag | numpy.conj | numpy.unwrap | numpy.angle | 
| numpy.sqrt | numpy.sum | numpy.power | numpy.ceil | 
| numpy.floor | numpy.round | numpy.absolute | 
Macierzowe z pakietu numpy
Sygnałowe
Statystyczne
| numpy.mean | numpy.std | scipy.stats.scoreatpercentile | scipy.stats.norm | 
| numpy.random.rand | numpy.random.randn | 
Filtry
Pliki
| numpy.fromfile | numpy.ndarray.tofile | numpy.loadtxt | numpy.savetxt | 
Wykresy Matplotlib
http://matplotlib.org/api/pyplot_api.html
| plot | stem | subplot | figure | 
| imshow | title | xlim | ylim | 
| xlab | ylab | label | legend | 
| grid | show | fill_between | step | 
Dodatkowe
import pylab as py
import numpy as np
def sin(f = 1, T = 1, Fs = 128, phi =0 ):
	'''sin o zadanej częstości (w Hz), długości, fazie i częstości próbkowania
	Domyślnie wytwarzany jest sygnał reprezentujący 
	1 sekundę sinusa o częstości 1 Hz i zerowej fazie próbkowanego 128 Hz
	'''
	dt = 1.0/Fs
	t = np.arange(0,T,dt)
	s = np.sin(2*np.pi*f*t + phi)
	return (s,t)
import numpy as np
from numpy.fft import  fft, fftfreq, fftshift
def widmo_dB(s, N_fft, F_samp):
    S = fft(s,N_fft)/np.sqrt(N_fft)
    S_dB = 20*np.log10(np.abs(S))
    F = fftfreq(N_fft, 1.0/F_samp)
    return (fftshift(S_dB),fftshift(F))

