void vsip_vcminmg_f(const vsip_cvview_f *a, const vsip_cvview_f *b, const vsip_vview_f *r);
This function computes the element-wise minimum of the magnitudes of corresponding elements from two complex vectors, storing the results in a real output vector. The operation performs element-wise comparison of complex magnitudes:

for all
from 0 to
, where
is the length of the vectors, and
and
are the magnitudes of the complex
numbers.
const vsip_cvview_p* a: First input complex vector.
const vsip_cvview_p* b: Second input complex vector.
const vsip_vview_p* r: Output real vector that will store the minimum magnitude results.
vsip_cvview_f *reference, *noisy_signal; vsip_vview_f *min_magnitudes; vsip_length n = 1024; // Create vectors reference = vsip_cvcreate_f(n, VSIP_MEM_NONE); noisy_signal = vsip_cvcreate_f(n, VSIP_MEM_NONE); min_magnitudes = vsip_vcreate_f(n, VSIP_MEM_NONE); // Initialize complex vectors with signal data for (vsip_length i = 0; i < n; i++) { // Create a reference signal and a noisy version float angle = 2 * M_PI * i / n; vsip_cscalar_f ref_val = VSIP_CMPLX_F(5.0f * cos(angle), 5.0f * sin(angle)); // Add some noise to create the noisy signal float noise_real = 0.5f * ((float)rand()/RAND_MAX - 0.5f); float noise_imag = 0.5f * ((float)rand()/RAND_MAX - 0.5f); vsip_cscalar_f noisy_val = VSIP_CMPLX_F(ref_val.r + noise_real, ref_val.i + noise_imag); vsip_cvput_f(reference, i, ref_val); vsip_cvput_f(noisy_signal, i, noisy_val); } // Compute element-wise minimum of magnitudes vsip_vcminmg_f(reference, noisy_signal, min_magnitudes); // The min_magnitudes vector now contains the minimum magnitude at each position // from the two input complex signals, which can be useful for noise analysis // Clean up vsip_cvalldestroy_f(reference); vsip_cvalldestroy_f(noisy_signal); vsip_valldestroy_f(min_magnitudes);
All three vectors must have the same length.