Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

bmedsp

DSP helpers and tools for biomedical signal processing

Importing and downloading files

Install BME-DSP library

pip install git+https://github.com/jd2504/bmedsp/

Downloading files using parrakit. Use grab_mat() method for MATLAB files and grab_wav() method for .wav files. Files loaded using scipy.io into numpy.

from bmedsp import parrakit as pk
x = pk.grab_mat('spike.mat')

Output:

https://parralab.org/teaching/biomed-dsp/spike.mat
dict_keys(['__header__', '__version__', '__globals__', 'x'])
b'MATLAB 5.0 MAT-file, Platform: LNX86, Created on: Sat Sep 28 19:09:03 2002'

Grab and inspect data

x = x['x']
print(x.shape)

Signal processing

Various filters

  • ma_filt() - simple moving average
  • gaborfir() - Gabor FIR linear filter
  • lpc() - Levinson recursion based linear prediction filter coefficients estimation

E.g. LPC estimation on white noise

N = 50000
seed(42)
noise = randn(N)

ar_coeffs = np.array([1.0, 1/2, 1/3, 1/4])
x = signal.lfilter([1], ar_coeffs, noise)
x = x[-4096:].flatten()

a, g = lpc(x, 3)

About

DSP helpers and tools for biomedical signal processing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages