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
import os | |
import librosa | |
import matplotlib | |
import matplotlib.pyplot as plt | |
matplotlib.rcParams['svg.fonttype'] = 'none' | |
import numpy as np | |
from scipy.io.wavfile import read as readwav | |
# Constants |
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
export default function LowpassFilter(Fc) { | |
var Q = 0.707; | |
var K = Math.tan(Math.PI * Fc); | |
var norm = 1 / (1 + K / Q + K * K); | |
this.a0 = K * K * norm; | |
this.a1 = 2 * this.a0; | |
this.a2 = this.a0; | |
this.b1 = 2 * (K * K - 1) * norm; | |
this.b2 = (1 - K / Q + K * K) * norm; |