Tx FIR filter and outout power

We have a question regarding the Tx FIR filter and output power when the filter is enabled. We are using the FIR coefficients that are part of the reference software for the IIO Scope program, when the Auto Filter option is selected.

The filter works very well but the output power (both peak and channel power of the wanted spectrum) is attenuated compared to when it is not enabled, in the order of 4-6dB. I see in the reference manual that for the Tx FIR filter only 0dB or -6dB gain settings are available, so given we set it to 0, what else could be affecting the output? (I have tried the -6dB setting and it does indeed reduce the output level by a further 6dB).

The Tx output attenuation registers are also set to 0 so we can’t compensate for the loss in the output stage.

Is it a case of overflows in the filter stages? Do we need to tweak the digital samples somehow?

For reference, screenshots with FIR Off & FIR On are shown.

FIR OFF

 

FIR ON:

  • Apart from the FIR filter gain settings the coefficients and filter interpolation may also introduce "losses". I have previously seen issues with the standard TX filter config in libad9361-iio where the amplitude was not maintained. In particular, one of the filters used in aforementioned library does not compensate for amplitude loss due to interpolation. The result being that the amplitude is cut in half causing 6dB power loss compared to when the filter is not used.

    edit: I actually made a pull request to libad9361-iio regarding this but apparently the filters are not supposed to maintain amplitude and power loss is thus expected when using them. I must admit I disagree with this but regardless all I did was tweak the coefficients in my application to avoid the issue of amplitude loss.

    Reference: https://github.com/analogdevicesinc/libad9361-iio/pull/55

    Note that I think the overflow being talked about is only with an absolute maximum input. Had I scaled the coefficients by 1.99 instead of 2.0 I don't think it would have been a problem. Regardless, if you want to maintain the same power with or without the filter you must compensate for amplitude loss during interpolation.

  • 0
    •  Analog Employees 
    on Jan 19, 2021 9:42 AM 1 month ago in reply to Wramberg

    What is the BW of the input signal that you used? Can you send us the profile that you generated from the filter wizard tool alongwith a screenshot of the wizard settings that you used for generating the profile? 

  • 0
    •  Analog Employees 
    on Jan 19, 2021 4:29 PM 1 month ago in reply to srimoyi

    Thank you.

    B/W = 8MHz, please see the output header file that includes coefficients, clocks and bandwidth details below..

    The coefficients were not generated by the wizard, but taken from the source code of IIO oscilloscope. If you look at the published source code, when “auto filter” is enabled (ticked), it calls up a pre-defined set of filter coefficients. That is being used.

    // Generated with AD9361 Filter Design Wizard 16.1.3
    // MATLAB 9.9.0.1538559 (R2020b) Update 3, 07-Jan-2021 19:18:27
    // Inputs:
    // Data Sample Frequency = 9142857 Hz

    AD9361_RXFIRConfig rx_fir_config = {
     1, // rx
     -6, // rx_gain
     4, // rx_dec
     {
     -15,-27,-23,-6,17,33,31,9,-23,-47,-45,-13,34,69,67,21,-49,-102,-99,-32,69,146,143,48,-96,-204,-200,-69,129,278,275,97,-170,
     -372,-371,-135,222,494,497,187,-288,-654,-665,-258,376,875,902,363,-500,-1201,-1265,-530,699,1748,1906,845,-1089,-2922,-3424,
     -1697,2326,7714,12821,15921,15921,12821,7714,2326,-1697,-3424,-2922,-1089,845,1906,1748,699,-530,-1265,-1201,-500,363,902,875,
     376,-258,-665,-654,-288,187,497,494,222,-135,-371,-372,-170,97,275,278,129,-69,-200,-204,-96,48,143,146,69,-32,-99,-102,-49,21,
     67,69,34,-13,-45,-47,-23,9,31,33,17,-6,-23,-27,-15},
     128, // rx_coef_size
     {1170285700,292571424,146285712,73142856,36571428,9142857}, // rx_path_clks[6]
     8000000 // rx_bandwidth
    };

    AD9361_TXFIRConfig tx_fir_config = {
     1, // tx
     0, // tx_gain
     4, // tx_int
     {
     -15,-27,-23,-6,17,33,31,9,-23,-47,-45,-13,34,69,67,21,-49,-102,-99,-32,69,146,143,48,-96,-204,-200,-69,129,278,275,97,-170,
     -372,-371,-135,222,494,497,187,-288,-654,-665,-258,376,875,902,363,-500,-1201,-1265,-530,699,1748,1906,845,-1089,-2922,-3424,
     -1697,2326,7714,12821,15921,15921,12821,7714,2326,-1697,-3424,-2922,-1089,845,1906,1748,699,-530,-1265,-1201,-500,363,902,875,
     376,-258,-665,-654,-288,187,497,494,222,-135,-371,-372,-170,97,275,278,129,-69,-200,-204,-96,48,143,146,69,-32,-99,-102,-49,21,
     67,69,34,-13,-45,-47,-23,9,31,33,17,-6,-23,-27,-15},
     128, // tx_coef_size
     {1170285700,292571424,146285712,73142856,36571428,9142857}, // tx_path_clks[6]
     8000000 // tx_bandwidth

    };

  • 0
    •  Analog Employees 
    on Jan 25, 2021 4:17 PM 1 month ago in reply to natural_inquisitive

    I checked the output by enabling the auto filter using IIO, and could not see the difference in output power between the enabled and disabled case. You can try using other filters and then check the output

  • For me, the power drop was observed when running with sample rates below 20 MSPS and using the ad9361_set_bb_rate()function. See https://github.com/analogdevicesinc/libad9361-iio/pull/55 for details.