I take a sample of the real world sensor and I need to display its filtered value. The signal is sampled at a speed of 10 Hz and during this period it can rise to 80% of the maximum range.
I used to use Root Mean Square as a filter and just applied it to the last five values that I registered. For this application, this will not be good, because I do not store constant values. In other words, I need to consider the time in my filter ...
I read in the DSP Guide , but I did not get much from this. Is there a tutorial that is specifically reserved for programmers, not Mathcad engineers? Are there some simple code snippets that could help?
Update. After several tests of the spreadsheet, I decided to register all samples and applied the Butterworth filter .
You always need to save some values (but not necessarily all input values). The output current of the filter depends on the number of input values and, possibly, some past output values.
The easiest filter is the first pass of the Butterworth lower pass filter. This would only require storing one output file value. The output signal (current) of the filter y (n) is equal to:
y (n) = x (n) - a1 * y (n-1)
x (n) - , y (n-1) - . a1 . 5 ( ), , , . , , !
( , #):
double a1 = 0.57; //0.57 is just an example value. double lastY = 0.0; while (true) { double x = <get an input value>; double y = x - a1 * lastY; <Use y somehow> lastY = y; }
(a ).
. ; y x.
DSP "" (.. "" ) . (FFT). , ( " " ) " ", "", 0 (10 ). , , (10 ) 0-2 , 2-4 , 4-6 , 6-8 8-10 .
"" , , , . , , , , 6 ( , 6 ). 6-8 8-10 0, .
, "", , . , , , . - , , , , .
( , FFT, ), . , , . , , " ", .
, , # Reactive LINQ - . (II.) - Reactive LINQ.
As a way to get events, so that you can do your processing without saving all the values, it will just do the processing when you get the next event.
To consider time, you can simply use a negative exponent to reduce the impact of past measurements.
Yes, for complex real-time systems that sample multiple data streams, there may be a problem in data processing (computing and storing data) and data consistency.
Source: https://habr.com/ru/post/1716393/More articles:Checking pg_query_params return value with php - phpIs it safe to use PBKDF2 with SHA256 to generate 128-bit AES keys? - securitySPGridView, data and the right data security method - datatablehow to unlock or enter windows by the application itself - winapiUsing Cases - Help - umlFileSystemWatcher does not control the user's local folder or temporary Internet files folder in Vista (64-bit) - c #Плагин Windows Media Center - pluginsWhat is a use case? How to define a precedent? - project-managementУстановка R-пакета - installationregex php: find everything in div - htmlAll Articles