omid2006
Junior Member level 2
- Joined
- Apr 24, 2019
- Messages
- 20
- Helped
- 0
- Reputation
- 0
- Reaction score
- 5
- Trophy points
- 3
- Activity points
- 120
out[n]+=(in[n]-out[n-1])*500*Ts
That equation reminds me of the leaky integrator(LPF):Hello friends
I found a unknown digital low pass filter in a sample code but I can't adapt it's formula with common filters like IIR because it's like a IIR filter with negative coefficient. it's like feedback filter but feedback filter is a highpass in ordinary and this filter is low pass. I'll write it's formula and I appreciate if anyone can help.
Code:out[n]+=(in[n]-out[n-1])*500*Ts
and Ts is the sampling frequency thus execution rate of filter.
Read Ts as sampling interval, 500 as cut-off omega, a valid estimation if Ts*omega << 1. Exact formula uses an exponential function.I doubt:
* that Ts here is the sampling frequency ... especially here multiplying the sampling_frequency makes no sense (on first sight)
* that the value of "500" is useful. I expect useful values in the range of 0...1.
I have never seen filter equation as += so I can't understand its meaning but surely it implies one delay unit as there is ( n) and (n-1) index but no (n-2).I did miss that, here added is a unit delay to each fdbk path to
kill the algebraic loop caused by adder/product fed back to itself,
thanks for catching the error, caused by the += .
View attachment 193841
If I get a chance I will verify sample set generated with Excel solution. Better yet let OP
choose the correct Ts and generate the sample set himself.....
Regards, Dana.
Ok but that means second order IIR and this is what I expect in hardware (FPGA/ASIC) for second order. In software, it seems in OP equation they can go for combinatorial feedback so you can add a scaled version of (x( n) - y(n-1)) back to y( n) but I got no idea why would anyone do that.Not expert here but if I add equal unit delays (which is what I did) to all paths the group
delay of filter is affected, but not the magnitude behavior of it ? So its latency is affected
but not response.....
Knight
That reduces to, assuming Ts =0.001:No doubt that original equation is first order and involves one and only one unit delay.
+= is unary operator in C, post #1 equation can be rewritten
out[n]=out[n-1]+(in[n]-out[n-1])*500*Ts
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?