Quick question about FIR filters

Hi all,

I’m interested in using the general purpose FIR filters onboard the LimeSDR to do some basic rectangular filtering. In GNU Radio if I carry out the filtering the latency increases too much for my application.

I’ve identified the function which I believe would be used to set the filter coefficients here. However, there’s a slightly concerning comment above stating

‘This function does not change GFIR*_L or GFIR*_N parameters, they have to be set manually’

Looking at the LMS7002M datasheet, to me it seems like GFIR*_L is referring to the filter length (= N/5, where N is the number of filter taps), and GFIR*_N is the number of filter taps.

I want to use a filter with 84 taps, all with magnitude 1, in the RX chain. I know I need to use filter 3 because that is the only filter which can deal with more than 40 taps. My questions are:

  1. Have I understood correctly? Do I need to use N = 85, and L = 17, and just set that last extra filter tap to 0?
  2. How do I set L and N for filter 3 for the receive path? I couldn’t find a specific function for it, and I’m not really familiar enough with the API to know how to do it unfortunately.

I’m guessing this can’t be done through Soapy or GNUradio or anything like that, so my plan is to shove this command in the constructor in the SoapyLMS7 API.


Ok, so after having done a bit more research I seem to be able to somehow edit the filter coefficients, but I’m not getting the results I expect. I now undestand that for 84 taps in GFIR 3 I need to set N to 90 (a multiple of 15), and set L to roundUp(90/15)-1 = 5.

I am using quite an old version of the drivers, at commit (22nd Nov 2017, browse here. This is because I have modified them in a few ways to get my application to work, and if I try to pull a recent version then because of the restructured limesuite those fixes dont work. What I have tried is adding the following lines here:

rfic->Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 90); // N=90
rfic->Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 5); // Set L to 5 as N = 90 (L = roundUp(N/15)-1 for GFIR3)

and I added the following line here

writeSetting(SOAPY_SDR_RX, 0, "ENABLE_GFIR_LPF", "0,90,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0");

I’ve tried various filter lengths, e.g. with all zeros to check if I get a zero output, and in general the results are not what I expect, althought htey are different from if I don’t attempt anything at all. Would anyone be able to point out where I’ve gone wrong?