# Find the transfer function of the difference between IIR and FIR filter

I am using a filter following equations from papers. It is basically the difference between exponential moving average and simple moving average.

$$L[n]=\frac{1}{\alpha_L}f[n]+\left(1-\frac{1}{\alpha_L}\right)L[n-1]$$

$$S[n]=\frac{1}{\alpha_S}\sum_{k=0}^{\alpha_S}f[n-k]$$

$$g[n]=S[n]-L[n]$$

• $f[n]$ - original signal
• $g[n]$ - filtered signal
• $\alpha$ - window size

I can find their transfer function separately for $L$ and $S$, but I have no idea how to get transfer function of $g[n]$. Anyone please guide me, I would really appreciate it.

Because you are using a linear combination of the two filters, you can find the resulting transfer function by directly subtracting them from each other. If you want to do this, then you have to make sure that they have the same denominator, such that the total transfer function is one quotient of polynomials. If you do not know how to do this, you could check this example.

• Thanks for your suggestion. but there might be a problem in the term g[n]. because L[n] requires data from L[n-1] whereas S[n] only requires raw data f[n-k]. Do I understand it correctly? – Thanawin Oct 9 '16 at 12:20
• Oh..... I think I might got it now. – Thanawin Oct 9 '16 at 12:53

You have two parallel systems as follows:

The transfer function of parallel systems is sum of the transfer functions of each system.

• This is correct, why the downvote? – Matt L. Oct 8 '16 at 9:19
• No problem @MattL. I think the anonymous downvoter simply doesn't like the post. Otherwise s/he could type! – msm Oct 8 '16 at 9:21
• (+1) yes this seems correct, but then OP is using t for what purpose? – Fat32 Oct 8 '16 at 9:45
• You are right @Fat32, it is conflicting considering the tags (discrete signals and z-transform). But the concept is the same with continuous systems except we will have Laplace transform. – msm Oct 8 '16 at 10:01
• Thanks for your answer. This would be very helpful for my uderstanding. I will try and might have another question. please don't be bored with me. – Thanawin Oct 9 '16 at 12:54