Closed MattCarrickPL closed 11 months ago
The transition bandwidth (in above comment) is part of an anti-aliasing filter proceeding the resample_poly() call:
if anti_alias_lpf:
new_rate = up_rate / down_rate
taps = low_pass(
cutoff=new_rate * 0.98 / 2,
transition_bandwidth=(0.5 - (new_rate * 0.98) / 2) / 4,
)
tensor = sp.convolve(tensor, taps, mode="same")
# Resample
resampled = sp.resample_poly(tensor, up_rate, down_rate)
The problem is that the anti-aliasing filter is redundant, due to the anti-aliasing filter implicit within the resample_poly() call. Proposing that the anti-aliasing filter be removed all together. Here's an example showing the marginal effect of the anti-aliasing filter:
Merged into v0.4.2 via https://github.com/TorchDSP/torchsig/pull/211
The resampling() transform has problems when computing for resampling rates > 1 due to the transition bandwidth calculation,
https://github.com/TorchDSP/torchsig/blob/v0.4.2/torchsig/transforms/functional.py#L137
The transition bandwidth calculation also produces values that are too narrow and thus creates artificially large filter lengths.