Skip to content

Instantly share code, notes, and snippets.

View ruohoruotsi's full-sized avatar
🎙️
Múra síṣẹ́ ọ̀rẹ́ mi

Ruoho Ruotsi ruohoruotsi

🎙️
Múra síṣẹ́ ọ̀rẹ́ mi
View GitHub Profile
@ruohoruotsi
ruohoruotsi / Signal reconstruction from spectrograms.ipynb
Created October 10, 2025 22:42 — forked from carlthome/Signal reconstruction from spectrograms.ipynb
Try to recover audio from filtered magnitudes when phase information has been lost.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ruohoruotsi
ruohoruotsi / istft-torch.py
Created April 20, 2019 05:45 — forked from keunwoochoi/istft-torch.py
temporary - inverse STFT
def istft(stft_matrix, hop_length=None, win_length=None, window='hann',
center=True, normalized=False, onesided=True, length=None):
"""stft_matrix = (batch, freq, time, complex)
All based on librosa
- http://librosa.github.io/librosa/_modules/librosa/core/spectrum.html#istft
What's missing?
- normalize by sum of squared window --> do we need it here?
Actually the result is ok by simply dividing y by 2.
"""
@ruohoruotsi
ruohoruotsi / hpss_torch.py
Created April 20, 2019 05:40 — forked from keunwoochoi/hpss_torch.py
median-filtering based harmonic-percussive (drum) source separation in Pytorch
import torch
import torch.nn.functional as F
EPS = 1e-7
def _enhance_either_hpss(x_padded, out, kernel_size, power, which, offset):
"""x_padded: one that median filtering can be directly applied
kernel_size = int
dim: either 2 (freq-axis) or 3 (time-axis)
which: str, either "harm" or "perc"
@ruohoruotsi
ruohoruotsi / frequency_estimator.py
Created September 2, 2018 10:58 — forked from endolith/frequency_estimator.py
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log
from matplotlib.mlab import find
from scipy.signal import blackmanharris, fftconvolve
from time import time
import sys
try:
import soundfile as sf
except ImportError:
@ruohoruotsi
ruohoruotsi / Machinedness.ipynb
Created June 22, 2018 04:33 — forked from bmcfee/Machinedness.ipynb
Machinedness detector - NYC Monthly Music Hackathon, July 27
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ruohoruotsi
ruohoruotsi / autofs.md
Created November 15, 2017 20:56 — forked from rudelm/autofs.md
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file '/etc/auto_master' and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@ruohoruotsi
ruohoruotsi / gist:7239732938ec8b0142d1c3573a5f3fea
Created June 7, 2016 22:35
copy a list of ids from a grep regex command to the current dir
cat ../kaldi_97_call_WER_results_caller.txt | grep '[a-zA-Z0-9]\-[a-zA-Z0-9]' | xargs -I {} echo /work/luigi-cache/audio/*{}*.wav | xargs -I@ sh -c "cp @ ."
@ruohoruotsi
ruohoruotsi / gist:6d6917b300b9d87820e0
Last active March 28, 2016 16:03
Installing tensorflow on Ubuntu14.04, unsupported wheel workaround
# When installing tensorflow on Ubuntu14.04, do you get a message that says "tensorflow-0.7.1-cp34-none-linux_x86_64.whl is not a supported wheel on this platform."? Run the commands below to download and install manually, from command history:
1056 wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl
1058 mv tensorflow-0.7.1-cp34-none-linux_x86_64.whl Downloads/
1060 cd Downloads/
1062 mv tensorflow-0.7.1-cp34-none-linux_x86_64.whl tensorflow-0.7.1-cp35-none-linux_x86_64.whl
1063 sudo pip3.5 install --upgrade tensorflow-0.7.1-cp35-none-linux_x86_64.whl
@ruohoruotsi
ruohoruotsi / iOS-Universal-Framework-crips.md
Last active December 23, 2015 04:08
iOS Universal Framework static framework crips

To build a Fake Static “embedded” iOS Framework

  1. Download and install the beta branch of iOS-Universal-Framework: https://github.com/kstenerud/iOS-Universal-Framework/tree/beta

  2. Add a new Fake Static iOS Framework target. Follow the wizard. Choose ARC. Do not include Unit-Tests

  3. Change the iOS Deployment Target Build Settings to 5.1