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