This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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`. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################ | |
# 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 |