OSDN Git Service

Edit comment
authorsuikan <suikan@users.sourceforge.jp>
Sun, 23 Feb 2014 02:10:08 +0000 (11:10 +0900)
committersuikan <suikan@users.sourceforge.jp>
Sun, 23 Feb 2014 02:10:08 +0000 (11:10 +0900)
algorithm_fir/fr32_fir.h

index 866d524..1f7d483 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * \file fx32_fir.h
- * \date 2013/05/01
+ * \date 2014/03/17
  * \author takemasa
  * \brief Basic FIR filter implementation
  *
  */
 typedef struct
 {
-       int taps;               ///< tap number of FIR filter
-       fract32 * coeff;        ///< pointer to the coefficient array
+       int taps;              ///< tap number of FIR filter. This have to be integer multiple of following parameter ratio, in case of decimator.
+       fract32 * coeff;        ///< pointer to the coefficient array.
        fract32 * delayline;    ///< pointer to the internal delay line
        fract32 * head;         ///< pointer to the current write head in the delayline.
-       int ratio;              ///< Interpolation / decimation ratio. effective only for the decimator and interpolator
-       int tapsByRatio;         ///< taps / ratio pre-calcuration.
+       int ratio;             ///< Interpolation / decimation ratio. effective only for the decimator and interpolator. Set to 1 for FIR filter.
+       int tapsByRatio;       ///< taps / ratio pre-calcuration.
 }TFIR32;
 
 /**
@@ -45,9 +45,10 @@ void fr32_fir_init( TFIR32 *filter, int taps, fract32 * coeff, fract32 * delayli
  * \parameter filter TFIR32 struct. Have to be initialized by fr32_fir_init().
  * \parameter in input samples buffer
  * \parameter out output sample buffer.
- * \parameter count number of input samples.
+ * \parameter count number of input and output samples.
  * \details
- * Finite Impulse Response filter.
+ * Finite Impulse Response filter. The variable given to filter parameter have to be initialized by fr32_fir_init() function,
+ * at least and once before invoking this funciton.
  */
 
 void fr32_fir(TFIR32 *filter, fract32 in[], fract32 out[], int count );
@@ -57,9 +58,11 @@ void fr32_fir(TFIR32 *filter, fract32 in[], fract32 out[], int count );
  * \parameter filter TFIR32 struct. Have to be initialized by fr32_fir_init().
  * \parameter in input samples buffer
  * \parameter out output sample buffer.
- * \parameter count number of input samples.
+ * \parameter count number of input samples. The number of output data in out array will be count * ratio.
  * \details
- * Interpolator. The number of output samples are count * ratio. Where, ratio is defined by fr32_fir_init function.
+ * Interpolator. The variable given to filter parameter have to be initialized by fr32_fir_init() function,
+ * at least and once before invoking this function.
+ * The number of output samples are count * ratio. Where, ratio is defined by fr32_fir_init function.
  */
 
 void fr32_interpolator(TFIR32 *filter, fract32 in[], fract32 out[], int count );
@@ -69,9 +72,10 @@ void fr32_interpolator(TFIR32 *filter, fract32 in[], fract32 out[], int count );
  * \parameter filter TFIR32 struct. Have to be initialized by fr32_fir_init().
  * \parameter in input samples buffer
  * \parameter out output sample buffer.
- * \parameter count number of input samples. Must be integer multiples of ratio which are given by fr32_fir_init funciton.
+ * \parameter count number of input samples. The number of output data in out array will be count / ratio. Where ratio is specified by fr32_fir_init().
  * \details
- * Decimator. The number of output samples are count / ratio. Where, ratio is defined by fr32_fir_init function.
+ * Decimator. The variable given to filter parameter have to be initialized by fr32_fir_init() function, at least and once before invoking this funciton.
+ * The number of output samples are count / ratio. Where, ratio is defined by fr32_fir_init function.
  */
 
 void fr32_decimator(TFIR32 *filter, fract32 in[], fract32 out[], int count );