Signal Processing Utilities¶
Functions¶
signals.corrvis()
… Visualization for cross- and auto-correlationsignals.pSpect()
… Simple power spectrum from FFTsignals.savgol()
… Savitzky-Golay filtersignals.show_se()
… Show mean and standard error, of a dataset in column form.
Details¶
Utilities for signal processing
-
signals.
corrvis
(x, y)[source]¶ Visualize correlation, by calculating the cross-correlation of two signals. The aligned signals and the resulting cross correlation value are shown, and advanced when the user hits a key or clicks with the mouse.
- Parameters
- Xarray (N,)
Comparison signal
- Yarray (M,)
Reference signal
Notes
Based on an idea from dpwe@ee.columbia.edu
Examples
>>> x = np.r_[0:2*pi:10j] >>> y = np.sin(x) >>> corrvis(y,y)
-
signals.
pSpect
(data, rate)[source]¶ Power spectrum and frequency
- Parameters
- dataarray, shape (N,)
measurement data
- ratefloat
sampling rate [Hz]
- Returns
- powerspectrumarray, shape (N,)
- frequencyarray, shape (N,)
-
signals.
show_se
(raw)[source]¶ Show mean and standard error, of a dataset in column form.
- Parameters
- rawarray (N,M)
input data, M sets of N data points
- Returns
- avgarray (N,)
average value
- searray (N,)
standard error
Notes
Examples
>>> t = np.arange(0,20,0.1) >>> x = np.sin(t) >>> data = [] >>> for ii in range(10): >>> data.append(x + np.random.randn(len(t))) >>> show_se(np.array(data).T)