I have a fundamental misunderstanding of the filter system in gnuradio.
I
would appreciate some help. I wrote a simple C++ testbench to help me
figure out what’s going on, but it continues to not behave as I expect.
I
am using fir_filter_fff with 29 taps that I set. I send an impulse into
the
filter and want to see the filter taps at the output in response. The
first
sample that comes out is correct, but every sample after the first is
either the smallest or largest number representable by float. The code
that
does this is below.
float impulse[29] =
{1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // 29
samples
long
float filter_taps[29] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1,
1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1}
//
input to filter
shape_filter = new gr::filter::kernel::fir_filter_fff(1, filter_taps);
for(int i = 0; i < 29; i++) {
filter_out[i] = shape_filter->filter(&impulse[i]);
}
Printing filter_out to the screen produces:
0.1 0 8.12753e-44 1.61149e-43 -4.16205e-20 -8.32411e-20
-1.24862e-19 -1.66482e-19 1.13358e+21
When I expect to see
0.1 0.2 0.3 0.4 etc…, the taps of the filter that I set above
You can see only the first output matches the expected.
What am I doing wrong here?
Thanks,
Rich
On Wed, Aug 19, 2015 at 12:02 PM, Richard B. [email protected]