Subtract a digital filter from another filter How to subtract a digital filter from another one, if their lengths are different. How to make the length equal.
If (and only if) the filters (either FIR or IIR) are linear, then you can subtract their coefficients term-wise, supposing they are correctly aligned (below, on the $0$ index), treating them as infinite series with trailing zeroes when the coefficients are not defined. For instance with:

$$h = [h_0, h_1, h_2]$$
and 
$$g = [g_{-1},g_0, g_1, g_2,g_3]$$

since the convolution with $h$ yields the same result as the convolution with a zero-padded $h$ (and $g$)

$$h' = [\ldots,0,0,h_0, h_1, h_2,0,0,\ldots]$$
the difference filter $d$ will have (symbolically $h'-g'$):

$$d = [\ldots,0,-g_{-1},h_0-g_{0}, h_1-g_{1}, h_2-g_{2},-g_{3},0,\ldots]$$

For FIR filters (or truncated IIR), you can limit to a finite sequence bounded by the smallest and the biggest index of both filters.