code: def lowpass_fir(data, freq, df, winlen=2048):
      
      # Source: Travis Oliphant
      # https://mail.scipy.org/pipermail/scipy-user/2004-February/002628.html
      #
      # There is not currently an FIR-filter design program in SciPy. One
      # should be constructed as it is not hard to implement (of course making
      # it generic with all the options you might want would take some time).
      #
      # What kind of window are you currently using?
      #
      # For your purposes this is what I would do:
      #
      # winlen = 2**11 #2**10 = 1024; 2**11 = 2048; 2**12 = 4096
      # give frequency bins in Hz and sample spacing
      w = np.fft.fftfreq(winlen, 1 / float(df))
      # cutoff is low-pass filter
      myfilter = np.where((abs(w) < freq), 1., 0.)
      # ideal filter
      h = np.fft.ifft(myfilter)
      beta = 11.7
      # beta implies Kaiser
      myh = np.fft.fftshift(h) * get_window(beta, winlen)
      return convolve(abs(myh), data)[winlen / 2:-winlen / 2]
docs: FIR-Lowpass Filter. (experimental)
  
      .. warning:: This is experimental code. Use with caution!
  
      Filter data by passing data only below a certain frequency.
  
      :type data: numpy.ndarray
      :param data: Data to filter.
      :param freq: Data below this frequency pass.
      :param df: Sampling rate in Hz.
      :param winlen: Window length for filter in samples, must be power of 2;
          Default 2048
      :return: Filtered data.
  
      .. versionadded:: 0.6.2