void vsip_vmaxmg_f(const vsip_vview_f *a, const vsip_vview_f *b, const vsip_vview_f *r);
This function computes the element-wise maximum of the magnitudes (absolute values) of corresponding elements from two vectors. The operation performs element-wise comparison of magnitudes:

for all
from 0 to
, where
is the length of the vectors.
const vsip_vview_p* a: First input vector.
const vsip_vview_p* b: Second input vector.
const vsip_vview_p* r: Output vector that will store the results.
vsip_vview_f *signal1, *signal2, *result; vsip_length n = 1024; // Create vectors signal1 = vsip_vcreate_f(n, VSIP_MEM_NONE); signal2 = vsip_vcreate_f(n, VSIP_MEM_NONE); result = vsip_vcreate_f(n, VSIP_MEM_NONE); // Initialize vectors with some signal data // For example, two different signal measurements for (vsip_length i = 0; i < n; i++) { vsip_vput_f(signal1, i, 5.0f * sin(2 * M_PI * i / n)); vsip_vput_f(signal2, i, 3.0f * cos(2 * M_PI * i / n) + 2.0f); } // Compute element-wise maximum of magnitudes vsip_vmaxmg_f(signal1, signal2, result); // The result vector now contains the maximum magnitude at each position // from the two input signals // Clean up vsip_valldestroy_f(signal1); vsip_valldestroy_f(signal2); vsip_valldestroy_f(result);
All three vectors must have the same length.