Microchip® Advanced Software Framework

dsp16_resampling_options_t Struct Reference

Options to attribute to the resampling algorithm.

Note
The structure must be initialized to 0 before using it. This will ensure all the default options will be chosen.

#include <dsp_resampling.h>

Public Types

enum  {
  DSP16_RESAMPLING_OPTIONS_USE_DYNAMIC = 0,
  DSP16_RESAMPLING_OPTIONS_USE_FIXED
}
 Method used to generate the filter coefficients. More...
 

Data Fields

union {
   struct {
      bool   coefficients_normalization
 If set to true, normalize the filter coefficients to ensure the output won't be too reduced. More...
 
      int   custom_fc_hz
 Use a custom cut-off frequency for this filter. By default it will choose min(fsin, fsmax) / 2. More...
 
      void(*   dsp16_custom_filter )(dsp16_t *coefficients, int
         fc_hz, int fs_hz, int order)
 Custom filter function. If set to NULL, the algorithm will use the dsp16_filt_lpfirdesign function. More...
 
      void(*   dsp16_custom_window )(dsp16_t *window, dsp16_t
         *input, int size)
 Custom window function. If set to NULL, the algorithm will use a rectangular window. More...
 
   }   dynamic
 If using the dynamic method to generate the filter coefficients. More...
 
   struct {
      dsp16_t *   dsp16_coefficients
 Pointer on the fixed coefficient table. More...
 
   }   fixed
 If using the static method to generate the filter coefficients. More...
 
}; 
 
enum
dsp16_resampling_options_t:: { ... }  
coefficients_generation
 Method used to generate the filter coefficients. More...
 

anonymous enum

Method used to generate the filter coefficients.

Enumerator
DSP16_RESAMPLING_OPTIONS_USE_DYNAMIC 

Dynamic is the default method.

DSP16_RESAMPLING_OPTIONS_USE_FIXED 

Use coefficients from a static table.

union { ... }
enum { ... } dsp16_resampling_options_t::coefficients_generation

Method used to generate the filter coefficients.

Referenced by dsp16_resampling_setup(), and main().

bool dsp16_resampling_options_t::coefficients_normalization

If set to true, normalize the filter coefficients to ensure the output won't be too reduced.

int dsp16_resampling_options_t::custom_fc_hz

Use a custom cut-off frequency for this filter. By default it will choose min(fsin, fsmax) / 2.

dsp16_t* dsp16_resampling_options_t::dsp16_coefficients

Pointer on the fixed coefficient table.

void(* dsp16_resampling_options_t::dsp16_custom_filter)(dsp16_t *coefficients, int fc_hz, int fs_hz, int order)

Custom filter function. If set to NULL, the algorithm will use the dsp16_filt_lpfirdesign function.

void(* dsp16_resampling_options_t::dsp16_custom_window)(dsp16_t *window, dsp16_t *input, int size)

Custom window function. If set to NULL, the algorithm will use a rectangular window.

struct { ... } dsp16_resampling_options_t::dynamic

If using the dynamic method to generate the filter coefficients.

Referenced by dsp16_resampling_setup(), and main().

struct { ... } dsp16_resampling_options_t::fixed

If using the static method to generate the filter coefficients.

Referenced by dsp16_resampling_setup().