void vsip_vinvclip_i(const vsip_vview_i *a, vsip_scalar_i t1, vsip_scalar_i t2, vsip_scalar_i t3, vsip_scalar_i c1, vsip_scalar_i c2, const vsip_vview_i *r); void vsip_vinvclip_f(const vsip_vview_f *a, vsip_scalar_f t1, vsip_scalar_f t2, vsip_scalar_f t3, vsip_scalar_f c1, vsip_scalar_f c2, const vsip_vview_f *r);
This function performs an inverse clipping operation on a vector, replacing values within a specified range with corresponding clip values while preserving values outside this range. The inverse clipping operation is defined as:

for all
from 0 to
, where
is the length of the vectors.
const vsip_vview_p* a: Input vector containing the elements to process.
vsip_scalar_p t1: Lower threshold of the clipping range.
vsip_scalar_p t2: Middle threshold separating the two clip values.
vsip_scalar_p t3: Upper threshold of the clipping range.
vsip_scalar_p c1: Value to substitute for elements in the lower part of the clipping range.
vsip_scalar_p c2: Value to substitute for elements in the upper part of the clipping range.
const vsip_vview_p* r: Output vector that will store the processed results.
vsip_vview_f *signal, *processed_signal; vsip_length n = 1024; // Create vectors signal = vsip_vcreate_f(n, VSIP_MEM_NONE); processed_signal = vsip_vcreate_f(n, VSIP_MEM_NONE); // Initialize signal with some values (e.g., audio signal with noise) for (vsip_length i = 0; i < n; i++) { float val = 10.0f * sin(2 * M_PI * i / n) + 3.0f * sin(20 * 2 * M_PI * i / n); vsip_vput_f(signal, i, val); } // Apply inverse clipping to remove values in the [-1.0, 1.0] range, // replacing them with -2.0 and 2.0 respectively vsip_vinvclip_f(signal, -1.0f, 0.0f, 1.0f, -2.0f, 2.0f, processed_signal); // The processed_signal vector now contains: // - Original values where they were < -1.0 or > 1.0 // - -2.0 where values were between -1.0 and 0.0 // - 2.0 where values were between 0.0 and 1.0 // Clean up vsip_valldestroy_f(signal); vsip_valldestroy_f(processed_signal);
The input and output vectors must have the same length.
The thresholds should typically satisfy
.