FIR filter compensator when using a CIC decimation filter
There was a similar question, https://dsp.stackexchange.com/a/1551/306, and the following is a subset of the answer from the other post.

Generally, to compensate a CIC filter the inverse of the CIC filters response
can be used to generate the compensation filter.  The CIC has 
a response of 2

$$
  H(\omega) = \left| \frac{sin(\omega D/2)}{sin(\omega M/2)} \right|^N
$$

Where D is the differentiate delay, M is the decimation rate, and N is the 
filter order (number of cascaded filters).  The inverse can be specified as

$$
  H(\omega) = \left| \frac{sin(\omega M/2)}{sin(\omega D/2)} \right|^N
$$

Once we have the 
frequency response of the compensation filter, we can simply choose the length
of FIR filter that we desire.  The length of the FIR is application 
specific.  Obviously the longer the FIR filter the better compensation.  

The following are plots of this straight forward compensation.






The following is the Python code to create the frequency responses and plots.


    import numpy as np
    from numpy import sin, abs, pi
    import pylab

D = 1; M = 7; N = 3

Hfunc = lambda w : abs( (sin((w*M)/2)) / (sin((w*D)/2.)) )**N
HfuncC = lambda w : abs( (sin((w*D)/2.)) / (sin((w*M)/2.)) )**N

w = np.arange(1024) * pi/1024

G = (M*D)**N
H = np.array(map(Hfunc, w))
Hc = np.array(map(HfuncC, w))
# only use the inverse (compensation) roughly to the first null.
Hc[int(1024*pi/M/2):] = 1e-8
plot(w, 20*log10(H/G))
plot(w, 20*log10(Hc*G))
grid('on')




See, Altera, "Understanding CIC compensation filters", for other approaches and $sinc^{-1}$ approximation 1.

1 Altera, "Understanding CIC compensation filters"

2 R. Lyons, "Understanding Digital Signal Processing", 
    2nd ed., Prentice Hall, Upper Saddle River, New Jersey, 2004