discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] FIR filter 'filterN' method


From: Johnathan Corgan
Subject: [Discuss-gnuradio] FIR filter 'filterN' method
Date: Mon, 03 Jul 2006 13:50:11 -0700
User-agent: Thunderbird 1.5.0.4 (X11/20060615)

I'm designing an adaptive FIR filter base class.

In the guts of all the current FIR filter types, there are filterN and
filterNdec methods that compute multiple outputs as a batch.  These are
called in the ::work method of the calling signal processing block:

  ...

  if (decimation() == 1)
    d_fir->filterN (out, in, noutput_items);

  else
    d_fir->filterNdec (out, in, noutput_items, decimation());

  ...

As far as I can tell, in all the various types, these are implemented
identically as simple loops calling the 'filter' method to calculate
single outputs iteratively:

...
void
gr_fir_ccf_generic::filterN (gr_complex output[],
                             const gr_complex input[],
                             unsigned long n)
{
  for (unsigned i = 0; i < n; i++)
    output[i] = filter (&input[i]);
}
...

In an adaptive filter, the class needs to update the filter taps after
each output sample. So I'd like to call 'filter' directly in my own loop
in my ::work function, followed by a call to update_weights during the
same loop iteration.

Is there any reason not to do it this way? Since all the existing
filterN functions are implemented as this simple loop, can I just do the
same thing myself in my ::work function instead? Will there ever be
additional stuff implemented in filterN in some FIR class that won't
ever get called because I'm bypassing it to do myself?

-Johnathan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]