Forum Discussion
Altera_Forum
Honored Contributor
16 years agoHi,
I don't see much code difference with regard to input stages. Remember the operator := means immediate assignment(no register). the only assignment for register is the operator <= (but I could be wrong as := may at times lead to register if its value updated at end of process but used on top, a rather mercky area that I avoid) Hence only "x" is one delay stage behind "input". The assignment <= on output is just a register on the output and doesn't come into calculation. I must also tell you that your filter is FIR not IIR as it depends on input stages only. In fact it is a type of differentiator(subtracts last sample from current, similar to one stage CIC comb). It is high pass filter Your current coeffs are [1 -.95] and this affects the dc gain so you need to adjust for gain control. Normally in high pass filters you target unity gain at Nguist, If you want unity dc gain in Matlab: h=[1 -.95]; h = h/sum(h) freqz(h) you will see 0dB at dc and 32B gain at high frequency.