STATLAB/ListaFunkcji: Różnice pomiędzy wersjami

Z Brain-wiki
(Utworzono nową stronę "Lista Funkcji ===Matematyczne z pakietu numpy=== ===Macierzowe z pakietu numpy=== [http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html zeros] [http://...")
 
 
(Nie pokazano 11 wersji utworzonych przez jednego użytkownika)
Linia 1: Linia 1:
Lista Funkcji
 
===Matematyczne z pakietu numpy===
 
  
===Macierzowe z pakietu numpy===
+
===Biblioteki===
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html zeros]
+
[http://docs.scipy.org/doc/numpy/reference/index.html numpy]
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ones.html ones]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html array]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.shape.html shape]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html reshape]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.arange.html arange]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html dot]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html where]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.logical_and.html logical_and]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.logical_or.html logical_or]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.hstack.html hstack]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html vstack]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.concatenate.html concatenate]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.copy.html copy]
 
[http://docs.scipy.org/doc/numpy/reference/generated/numpy.diff.html diff]
 
  
===Wykresy z pakietu pylab===
+
[http://docs.scipy.org/doc/scipy-0.16.0/reference/signal.html scipy.signal]
plot
+
 
stem
+
[http://docs.scipy.org/doc/scipy-0.16.0/reference/stats.html scipy.stats]
subplot
+
 
figure
+
[https://docs.python.org/2/library/functions.html wbudowane]
imshow
+
 
title
+
===Lista funkcji===
xlim, ylim
+
====Matematyczne z pakietu numpy====
xlab, ylab
+
{| class="wikitable"
label
+
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.sin.html numpy.sin]
legend
+
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.exp.html numpy.exp]
grid
+
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.log.html numpy.log]
show
+
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.real.html numpy.real]
fill_between
+
|-
step
+
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.imag.html numpy.imag]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.conj.html numpy.conj]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.unwrap.html numpy.unwrap]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.angle.html numpy.angle]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.sqrt.html numpy.sqrt]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.sum.html numpy.sum]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.power.html numpy.power]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ceil.html numpy.ceil]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.floor.html numpy.floor]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.round.html numpy.round]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.absolute.html numpy.absolute]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.iinfo.html numpy.iinfo]
 +
|}
 +
 
 +
====Macierzowe z pakietu numpy====
 +
{| class="wikitable"
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.zeros.html numpy.zeros]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ones.html numpy.ones]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.min.html numpy.ndarray.min]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.max.html numpy.ndarray.max]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.shape.html numpy.ndarray.shape]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html numpy.reshape]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.arange.html numpy.arange]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html numpy.dot]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html numpy.where]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.logical_and.html numpy.logical_and]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.logical_or.html numpy.logical_or]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.hstack.html numpy.hstack]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html numpy.vstack]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.concatenate.html numpy.concatenate]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.copy.html numpy.copy]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.diff.html numpy.diff]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.array.html numpy.array]
 +
|
 +
|
 +
|
 +
|}
 +
 
 +
====Sygnałowe====
 +
{| class="wikitable"
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fft.html numpy.fft.fft]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fftshift.html numpy.fft.fftshift]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fftfreq.html numpy.fft.fftfreq]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.ifft.html numpy.fft.ifft]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.bartlett.html numpy.bartlett]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.blackman.html numpy.blackman]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.hamming.html numpy.hamming]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.hanning.html numpy.hanning]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.kaiser.html numpy.kaiser]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.rfft.html numpy.fft.rfft]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.rfftfreq.html numpy.fft.rfftfreq]
 +
|[http://scipy.github.io/devdocs/generated/scipy.signal.periodogram.html scipy.signal.periodogram]
 +
|-
 +
|[http://scipy.github.io/devdocs/generated/scipy.signal.welch.html scipy.signal.welch]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.correlate.html numpy.correlate]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.convolve.html scipy.signal.convolve]
 +
|
 +
|}
 +
 
 +
====Statystyczne====
 +
{| class="wikitable"
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.mean.html numpy.mean]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html numpy.std]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.scoreatpercentile.html scipy.stats.scoreatpercentile]
 +
|[http://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy.stats.norm.html scipy.stats.norm]
 +
|-
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html numpy.random.rand]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randn.html numpy.random.randn]
 +
|
 +
|
 +
|}
 +
 
 +
====Filtry====
 +
{| class="wikitable"
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.firwin.html scipy.signal.firwin]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.firwin2.html scipy.signal.firwin2]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.freqz.html scipy.signal.freqz]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter.html scipy.signal.lfilter]
 +
|-
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.cheby1.html scipy.signal.cheby1]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.cheby2.html scipy.signal.cheby2]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.ellip.html scipy.signal.ellip]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.buttord.html scipy.signal.buttord]
 +
|-
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html scipy.signal.butter]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.cheb1ord.html scipy.signal.cheb1ord]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.cheb2ord.html scipy.signal.cheb2ord]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.ellipord.html scipy.signal.ellipord]
 +
|-
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.kaiserord.html scipy.signal.kaiserord]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.filtfilt.html scipy.signal.filtfilt]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.decimate.html scipy.signal.decimate]
 +
|
 +
|}
 +
 
 +
====Pliki====
 +
{| class="wikitable"
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromfile.html numpy.fromfile]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.tofile.html numpy.ndarray.tofile]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.loadtxt.html numpy.loadtxt]
 +
|[http://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html numpy.savetxt]
 +
|-
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.read.html scipy.io.wavfile.read]
 +
|[http://docs.scipy.org/doc/scipy/reference/generated/scipy.io.wavfile.write.html scipy.io.wavfile.write]
 +
|
 +
|
 +
|}
 +
 
 +
====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===
 +
<source lang= python>
 +
import pylab as py
 +
import numpy as np
 +
 
 +
def sin(f = 1., T = 1., Fs = 128., phi =0. ):
 +
'''
 +
(float, float, float, float) -> (numpy.ndarray, numpy.ndarray)
 +
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
 +
Zwraca macierz amplitud i czasu.
 +
'''
 +
 
 +
dt = 1.0/Fs
 +
t = np.arange(0,T,dt)
 +
s = np.sin(2*np.pi*f*t + phi)
 +
return (s,t)
 +
 
 +
def delta(t0=0.5, T=1.0 ,Fs = 128.):
 +
    '''
 +
    (float, float, float) -> (numpy.ndarray, numpy.ndarray)
 +
    Generowanie funkcji delta. Zwraca macierz amplitud i czasu.
 +
    t0: położenie maksimum
 +
    T: czas trwania sygnału
 +
    Fs: częstość próbkowania
 +
    '''
 +
    dt = 1.0/Fs
 +
    t = np.arange(0,T,dt)
 +
    d = np.zeros(len(t))
 +
    d[np.ceil(t0*Fs)]=1
 +
    return (d,t)
 +
 
 +
def gabor(f = 1., T = 1., Fs = 128., phi =0., t0 = 0.0, std = 1.0 ):
 +
    '''
 +
    (float, float, float, float, float, float) -> (numpy.ndarray, numpy.ndarray)
 +
    Generowanie funkcji Gabora. Zwraca macierz amplitud i czasu.
 +
    f: częstość oscylacji
 +
    T: czas trwania sygnału
 +
    Fs: częstość próbkowania
 +
    phi: faza
 +
    t0: położenie maksimum
 +
    std: odchylenie standardowe
 +
    '''
 +
    dt = 1.0/Fs
 +
    t = np.arange(0,T,dt)
 +
    g = np.cos(2*np.pi*f*(t-t0)+phi)*np.exp(-0.5*(t-t0)**2/(std**2))
 +
    return (g, t)
 +
</source>
 +
 
 +
 
 +
<source lang = python>
 +
import numpy as np
 +
from numpy.fft import  fft, fftfreq, fftshift
 +
 
 +
def widmo_dB(s, N_fft, F_samp):
 +
    '''
 +
    (numpy.ndarray, int, float) -> (numpy.ndarray, numpy.ndarray)
 +
    s: sygnał
 +
    N_fft: ilość punktów DTF
 +
    F_samp: częstość próbkowania
 +
    Oblicza widmo mocy w skali decybelowej. Zwraca macierz mocy i częstości
 +
    '''
 +
    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))
 +
</source>
 +
-->

Aktualna wersja na dzień 11:14, 10 lis 2016

Biblioteki

numpy

scipy.signal

scipy.stats

wbudowane

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 numpy.iinfo

Macierzowe z pakietu numpy

numpy.zeros numpy.ones numpy.ndarray.min numpy.ndarray.max
numpy.ndarray.shape numpy.reshape numpy.arange numpy.dot
numpy.where numpy.logical_and numpy.logical_or numpy.hstack
numpy.vstack numpy.concatenate numpy.copy numpy.diff
numpy.array

Sygnałowe

numpy.fft.fft numpy.fft.fftshift numpy.fft.fftfreq numpy.fft.ifft
numpy.bartlett numpy.blackman numpy.hamming numpy.hanning
numpy.kaiser numpy.fft.rfft numpy.fft.rfftfreq scipy.signal.periodogram
scipy.signal.welch numpy.correlate scipy.signal.convolve

Statystyczne

numpy.mean numpy.std scipy.stats.scoreatpercentile scipy.stats.norm
numpy.random.rand numpy.random.randn

Filtry

scipy.signal.firwin scipy.signal.firwin2 scipy.signal.freqz scipy.signal.lfilter
scipy.signal.cheby1 scipy.signal.cheby2 scipy.signal.ellip scipy.signal.buttord
scipy.signal.butter scipy.signal.cheb1ord scipy.signal.cheb2ord scipy.signal.ellipord
scipy.signal.kaiserord scipy.signal.filtfilt scipy.signal.decimate

Pliki

numpy.fromfile numpy.ndarray.tofile numpy.loadtxt numpy.savetxt
scipy.io.wavfile.read scipy.io.wavfile.write

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