Skip to content

Instantly share code, notes, and snippets.

View SDIdo's full-sized avatar

Ido SDIdo

View GitHub Profile
@axelborja
axelborja / profiling_python.py
Last active June 13, 2023 03:57
Profile your python code using CProfile or Yappi and KCachegrind / QCachegrind
################
# CPROFILE #
#############################################################################
# 1 - Profile myfunc() from ipython
import cProfile
filename = 'filename.prof'
cProfile.run('myfunc()', filename)
# 2 - Convert your file to a usable kcachegrind file in your shell
@mbauman
mbauman / filtfilt_gustafsson.jl
Created July 7, 2014 14:10
Forward-backward IIR filter that uses Gustafsson's method.
# Forward-backward IIR filter that uses Gustafsson's method.
#
# Apply the IIR filter defined by `(b,a)` to `x` twice, first forward
# then backward, using Gustafsson's initial conditions [1]_.
#
# Let `y_fb` be the result of filtering first forward and then backward,
# and let `y_bf` be the result of filtering first backward then forward.
# Gustafsson's method is to compute initial conditions for the forward
# pass and the backward pass such that `y_fb == y_bf`.
#