Adelsbach/VSIPL
Core Programming Reference Guide
DD-00016-015
Core

5.2.1 vsip_dconv1d_create_p - Create 1D Convolution Object

typedef enum _vsip_alg_hint { 
  VSIP_ALG_TIME  = 0, 
  VSIP_ALG_SPACE = 1, 
  VSIP_ALG_NOISE = 2 
} vsip_alg_hint; 
 
typedef enum _vsip_support_region { 
  VSIP_SUPPORT_FULL = 0, 
  VSIP_SUPPORT_SAME = 1, 
  VSIP_SUPPORT_MIN  = 2, 
} vsip_support_region; 
 
typedef enum _vsip_symmetry { 
  VSIP_NONSYM            = 0, 
  VSIP_SYM_EVEN_LEN_ODD  = 1, 
  VSIP_SYM_EVEN_LEN_EVEN = 2 
} vsip_symmetry; 
 
vsip_conv1d_f* vsip_conv1d_create_f(const vsip_vview_f *h, vsip_symmetry symm, vsip_length n, vsip_length d, vsip_support_region support, vsip_length ntimes, vsip_alg_hint hint);
Description

This function creates a one-dimensional convolution object. The convolution object can handle various types of impulse responses and supports different output regions and decimation factors.

Parameters
Return Value
Example

vsip_conv1d_f *conv; 
vsip_vview_f *h; 
vsip_length h_len = 31;  // Impulse response length 
vsip_length n = 1024;    // Input signal length 
vsip_length d = 1;        // No decimation 
 
// Create impulse response vector 
h = vsip_vcreate_f(h_len, VSIP_MEM_NONE); 
 
// Initialize impulse response (e.g., Gaussian kernel) 
// vsip_vramp_f(0.0f, 1.0f, h); 
// Apply window function or other modifications to h... 
 
// Create convolution object for full convolution 
conv = vsip_conv1d_create_f(h, VSIP_SYM_NONE, n, d, 
                           VSIP_SUPPORT_FULL, 100, VSIP_ALG_TIME); 
if (conv == NULL) { 
    fprintf(stderr, "Error: Could not create convolution object\n"); 
    return; 
} 
 
// Use the convolution object for your signal processing 
// vsip_vview_f *input = vsip_vcreate_f(n, VSIP_MEM_NONE); 
// vsip_vview_f *output = vsip_vcreate_f(n + h_len - 1, VSIP_MEM_NONE); 
// vsip_conv1d_f(conv, input, output); 
 
// Clean up when done 
vsip_conv1d_destroy_f(conv); 
vsip_vdestroy_f(h);
Notes