typedef enum _vsip_symmetry { VSIP_NONSYM = 0, VSIP_SYM_EVEN_LEN_ODD = 1, VSIP_SYM_EVEN_LEN_EVEN = 2 } vsip_symmetry; typedef enum _vsip_obj_state { VSIP_STATE_NO_SAVE = 1, VSIP_STATE_SAVE = 2 } vsip_obj_state; typedef enum _vsip_alg_hint { VSIP_ALG_TIME = 0, VSIP_ALG_SPACE = 1, VSIP_ALG_NOISE = 2 } vsip_alg_hint; vsip_fir_f *vsip_fir_create_f(const vsip_vview_f *kernel, vsip_symmetry symm, vsip_length n, vsip_length d, vsip_obj_state state, vsip_length ntimes, vsip_alg_hint hint); vsip_fir_d *vsip_fir_create_d(const vsip_vview_d *kernel, vsip_symmetry symm, vsip_length n, vsip_length d, vsip_obj_state state, vsip_length ntimes, vsip_alg_hint hint); vsip_cfir_f *vsip_cfir_create_f(const vsip_cvview_f *kernel, vsip_symmetry symm, vsip_length n, vsip_length d, vsip_obj_state state, vsip_length ntimes, vsip_alg_hint hint); vsip_cfir_d *vsip_cfir_create_d(const vsip_cvview_d *kernel, vsip_symmetry symm, vsip_length n, vsip_length d, vsip_obj_state state, vsip_length ntimes, vsip_alg_hint hint);
This function creates a FIR (Finite Impulse Response) filter with the specified kernel, symmetry, length, decimation factor, state, number of times to apply the filter, and algorithm hint.
const vsip_dvview_p* kernel: Pointer to the kernel vector view.
vsip_symmetry symm: Symmetry of the filter kernel.
VSIP_NOSYM - No symmetry
VSIP_SYM_EVEN_LEN_ODD - Odd symmetry
VSIP_SYM_EVEN_LEN_EVEN - Even symmetry
vsip_length n: Length of the filter.
vsip_length d: Decimation factor.
vsip_obj_state state: State of the filter object.
VSIP_STATE_NO_SAVE - Do not save state
VSIP_STATE_SAVE - Save state
vsip_length ntimes: Number of times to apply the filter.
vsip_alg_hint hint: Algorithm hint for the filter.
VSIP_ALG_TIME - Optimize for time
VSIP_ALG_SPACE - Optimize for memory usage
VSIP_ALG_NOISE - Optimize for noise
On success, a pointer to the newly created FIR filter object is returned.
On error, NULL is returned.
vsip_vview_f *kernel_view; vsip_symmetry symm = VSIP_NONSYM; vsip_length length = 10; vsip_length decimation = 1; vsip_obj_state state = VSIP_STATE_SAVE; vsip_length ntimes = 1; vsip_alg_hint hint = VSIP_ALG_TIME; vsip_fir_f *fir_filter; // Assuming kernel_view has been properly initialized fir_filter = vsip_fir_create_f(kernel_view, symm, length, decimation, state, ntimes, hint); if (fir_filter == NULL) { // Handle error }