dspk-ops 0.0.1

Signal-processing operations for dspk, written once in CubeCL: filters, resampling, linear algebra, statistics, peak finding, spatial operators
Documentation
1
2
3
4
5
6
7
8
9
use cubecl::prelude::*;

/// Linear scaling and offset: `y = x ยท scale + offset` (gain calibration, unit conversion).
#[cube(launch)]
pub fn scale_samples_kernel<F: Float + CubeElement + LaunchArg>(input: &[F], output: &mut [F], scale_factor: F, offset: F) {
    if ABSOLUTE_POS < input.len() {
        output[ABSOLUTE_POS] = input[ABSOLUTE_POS] * scale_factor + offset;
    }
}