Skip to content

Instantly share code, notes, and snippets.

View ThomasA's full-sized avatar

Thomas Arildsen ThomasA

View GitHub Profile
@ThomasA
ThomasA / coherence.py
Last active December 10, 2018 10:31
A small Python script to test a claim from the StackExchange answer https://dsp.stackexchange.com/a/53947/1464 about the coherence of a matrix
"""
This is a small script investigating the coherence discussed in the
Stackexchange Signal Processing answer here:
https://dsp.stackexchange.com/a/53947/1464
"""
import numpy as np
from scipy.fftpack import dct
from scipy.linalg import circulant
@ThomasA
ThomasA / test.ipynb
Created February 14, 2017 17:18
A minimal Jupyter notebook used for testing https://github.com/damianavila/RISE
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ThomasA
ThomasA / test_transform_calls.py
Created January 22, 2016 13:55
The purpose of this script is to evaluate how severe the run-time overhead is when specifying a transform size parameter for FFT and DCT. It has been observed that specifying this parameter increases the run-time, even if the specified size is equal to the size of the input. The objective here is to figure out whether this overhead is a constant…
"""The purpose of this script is to evaluate how severe the run-time
overhead is when specifying a transform size parameter for FFT and
DCT. It has been observed that specifying this parameter increases the
run-time, even if the specified size is equal to the size of the
input. The objective here is to figure out whether this overhead is a
constant set-up cost or it depends on the input size.
"""
import numpy as np
@ThomasA
ThomasA / iswt2_fail.py
Created July 3, 2015 11:09
This script attempts to prove that the ISWT2 implementation from https://groups.google.com/d/msg/pywavelets/xk3UeFz9ZK0/mylNG7qUyKsJ does not work properly.
"""
This script attempts to prove that the ISWT2 implementation from
https://groups.google.com/d/msg/pywavelets/xk3UeFz9ZK0/mylNG7qUyKsJ
does not work properly.
"""
import numpy as np
import pywt
import pywt_addon
@ThomasA
ThomasA / hide-output.ipynb
Created November 21, 2014 13:54
An example IPython notebook where the output of matplotlib.pyplot.plot is hidden in the last output cell
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ThomasA
ThomasA / gen_dummy_bib.py
Created September 22, 2014 07:43
I wrote this Python script as a "bridge" to generate a fake `.aux` file for use with xcite and Biblatex. It is a very crude attempt, but it worked for the case I needed it for. Run it as `python gen_dummy_bib.py document.bbl document_fake.aux`
import sys
import re
replace_count = 1
infile = open(str(sys.argv[1]), 'r')
outfile = open(str(sys.argv[2]), 'w')
for line in infile:
if '\\entry' in line:
outfile.write(re.findall('\\\\entry\{[^{]+', line)[0].replace('entry', 'bibcite') + '{' + str(replace_count) + '}\n')