Sneaking in a few warning fixes to this branch.
[debian/gnuradio] / gnuradio-core / src / lib / filter / gri_fir_filter_with_buffer_ccf.h
index c91d70534e26fdd4847d91c681bd3f01e7f3e5ee..bd7fa33cf6f58424dde25aa1cb23cb5052f7e7da 100644 (file)
  */
 
 /*
- * WARNING: This file is automatically generated by generate_gr_fir_XXX.py
+ * WARNING: This file is automatically generated by generate_gri_fir_XXX.py
  * Any changes made to this file will be overwritten.
  */
 
 
-#ifndef INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_H
-#define INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_H
+#ifndef INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
+#define INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H
 
 #include <vector>
 #include <gr_types.h>
@@ -46,8 +46,8 @@ class gri_fir_filter_with_buffer_ccf {
 
 protected:
   std::vector<float>   d_taps;         // reversed taps
-  gr_complex           *d_buffer;
-  unsigned int          d_idx;
+  gr_complex                     *d_buffer;
+  unsigned int                  d_idx;
 
 public:
 
@@ -69,13 +69,25 @@ public:
   /*!
    * \brief compute a single output value.
    *
-   * \p input must have ntaps() valid entries.
-   * input[0] .. input[ntaps() - 1] are referenced to compute the output value.
+   * \p input is a single input value of the filter type
    *
    * \returns the filtered input value.
    */
   gr_complex filter (gr_complex input);
 
+  
+  /*!
+   * \brief compute a single output value; designed for decimating filters.
+   *
+   * \p input is a single input value of the filter type. The value of dec is the
+   *    decimating value of the filter, so input[] must have dec valid values.
+   *    The filter pushes dec number of items onto the circ. buffer before computing
+   *    a single output.
+   *
+   * \returns the filtered input value.
+   */
+  gr_complex filter (const gr_complex input[], unsigned long dec);
+
   /*!
    * \brief compute an array of N output values.
    *
@@ -93,26 +105,12 @@ public:
    * compute the output values.
    */
   void filterNdec (gr_complex output[], const gr_complex input[],
-                  unsigned long n, unsigned decimate);
+                  unsigned long n, unsigned long decimate);
 
   /*!
    * \brief install \p new_taps as the current taps.
    */
-  void set_taps (const std::vector<float> &taps)
-  {
-    d_taps = gr_reverse(taps);
-
-    if(d_buffer != NULL) {
-      free(d_buffer);
-      d_buffer = NULL;
-    }
-    
-    // FIXME: memalign this to 16-byte boundaries for SIMD later
-    size_t t = sizeof(gr_complex) * 2 * d_taps.size();
-    d_buffer = (gr_complex*)malloc(t);
-    memset(d_buffer, 0x00, t);
-    d_idx = 0;
-  }
+  void set_taps (const std::vector<float> &taps);
 
   // ACCESSORS
 
@@ -130,4 +128,4 @@ public:
   }
 };
 
-#endif /* INCLUDED_GR_GR_FIR_FILTER_WITH_BUFFER_CCF_H */
+#endif /* INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H */