Skip to content

Commit

Permalink
Fixed jinc filter
Browse files Browse the repository at this point in the history
  • Loading branch information
rosinality committed Aug 11, 2021
1 parent 6985087 commit d1a4c52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit d1a4c52

Please sign in to comment.