FftConvolver constructor
Creates a reusable convolver with maximum input lengths xMax and hMax.
A larger capacity allows processing larger signals without recreation.
Implementation
factory FftConvolver({required int xMax, required int hMax}) {
final ctx = yl_fftconv_ctx_create_f32(xMax, hMax);
if (ctx == ffi.nullptr) {
throw StateError('Failed to create fft convolution context');
}
return FftConvolver._(
_FftConvolverResource(ctx),
xMax: yl_fftconv_ctx_x_max(ctx),
hMax: yl_fftconv_ctx_h_max(ctx),
nfft: yl_fftconv_ctx_nfft(ctx),
bins: yl_fftconv_ctx_bins(ctx),
);
}