BUT, I asked for that I did not know the concept of the filter implementation. I know MCU coding, I am developing some digital algorithms but how can I embed these matematical equation <...>
It is strange to hear such a question from a student that finished several classes about signals and digital signals particularly. That is why I am still confused if I understand your problem correctly. I think that we should talk not about implementation but about theory first. Correct me if I am wrong.
I think we are talking about filters as a linear processing forgetting more complicate cases.
Linear filter is a combination of "linear" operations upon input data and upon results of previous linear operations upon results of previous linear operations ... and so on. Linear operations are - sum, delay and multiplication by constant. Or in other words - a linear combination as a sum with different constant weights of signal and delayed copies of it. In common case - a sum of indefinite number of such copies. You should understand how finite filter can have infinite impulse response, do you? If you are confused that was not my intention.
Digital linear filter - linear filter upon digital signals. Most usual case of digital signal is a quantized values given for regular discrete moments. You should think about word "regular" and how it represents itself in equation y[n]=x[n] - x[n-1]. Yet again - be familiar with connection of meanings "regular" and "iteration".
Then between iterations there is a magic hidden data manipulation
that perhaps is the biggest concern for you as I see it.
All these rectangular blocks with T or Z^(-1) inside are delay lines with delay T. Our signal is digital with discretization interval T. So delay line with length "T" has only one value to remember. All other values of continuous analog could be considered as zero so could be not simulated computationally. Remaining part for digital simulation - is to pass values from input to output of delay lines at the end of each iteration (in between). So delay line is a memory of one value. In your simple filter example there is only one memory cell. After completing calculation of linear combination between signal and delayed copy of it you should update this memory by data that is one tact newer - then I wrote: previous_sample = sample; That is a computational procedure required by digital delay line T.
In terms of processors you need to copy value from one memory cell to another. Then think about another magic. Some digital filters allow not to perform this copy operations at all that is quite useful if filter needs thousand of memory cells. You probably know that trick or can understand it yourself being a programmer.Posted on: September 24, 2016, 02:07:40 02:07 - Automerged
<...> Do I implement filtering by that way on every platform?
What do you call by "that way". Please, explain your doubts.
On every platform digital filter is an updated memory and calculation upon it. Different platforms has different available data types (int of float, 16 bit or 32 bit...). Some "platforms" have special functions that could significantly improve performance if used by algorithm designer or coder. Such functions are: operations on vector data (SIMD, MMX, SSE...), built in saturation mode of arithmetic operations, bit-reversal index addressing, ring buffers, ...
You can make your "processing" as somehow universal portable C-code, or use specific functions that are available as library or use intrinsic functions of given processor. But life of your digital filter remains the same in its space - linear operations upon enumerable number of memory cells.