HSincInterpolationParameters
Parameters to be used for sinc interpolation.
Methods
new
new(sinc_len: integer, f_cutoff: double, oversampling_factor: integer, interpolation: HInterpolationType, window: HWindowType) -> HSincInterpolationParameters
source
Creates a new HSincInterpolationParameters
.
Arguments
sinc_len
An integer. Length of the windowed sinc interpolation filter. Higher values can allow a higher cut-off frequency leading to less high frequency roll-off at the expense of higher cpu usage. A good starting point should be 256. The value will be rounded up to the nearest multiple of 8.
f_cutoff
A double. Relative cutoff frequency of the sinc interpolation filter (relative to the lowest one of fs_in/2
or fs_out/2
). Start at 0.95, and increase if needed.
oversampling_factor
An integer. The number of intermediate points to use for interpolation. Higher values use more memory for storing the sinc filters. Only the points actually needed are calculated during processing so a larger number does not directly lead to higher cpu usage. A lower value helps in keeping the sincs in the cpu cache. A good starting point should be 128.
interpolation
An HInterpolationType
. The interpolation type.
window
An HWindowType
. The window function to use.
Returns
An HSincInterpolationParameters
.
Examples
library(harmonium)
= 256L
sinc_len = 0.95
f_cutoff = 128L
oversampling_factor = HInterpolationType$Linear
interpolation = HWindowType$Blackman
window
= HSincInterpolationParameters$new(sinc_len, f_cutoff, oversampling_factor, interpolation, window) hsincinterpolationparameters
print()
source
Prints the HSincInterpolationParameters
.
Differently from R’s behaviour, print
doesn’t return the value invisibly.
Examples
library(harmonium)
= 256L
sinc_len = 0.95
f_cutoff = 128L
oversampling_factor = HInterpolationType$Linear
interpolation = HWindowType$Blackman
window
= HSincInterpolationParameters$new(sinc_len, f_cutoff, oversampling_factor, interpolation, window)
hsincinterpolationparameters $print()
hsincinterpolationparameters
# or similarly:
print(hsincinterpolationparameters)