From d1a4c52ea0be9a6a853fe10e486402b276aef94b Mon Sep 17 00:00:00 2001 From: Kim Seonghyeon Date: Wed, 11 Aug 2021 14:55:43 +0000 Subject: [PATCH] Fixed jinc filter --- model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model.py b/model.py index dbd172a..912bee7 100755 --- a/model.py +++ b/model.py @@ -139,7 +139,7 @@ def lowpass_filter(n_taps, cutoff, band_half, sr, use_jinc=False): if use_jinc: ind_sq = ind.unsqueeze(1) ** 2 window = window.unsqueeze(1) - coeff = jinc(torch.sqrt(ind_sq + ind_sq.T)) + coeff = jinc((2 * cutoff / sr) * torch.sqrt(ind_sq + ind_sq.T)) lowpass = (2 * cutoff / sr) ** 2 * coeff * window * window.T lowpass = lowpass.to(torch.float32)