Sunday, 7 October 2018
function [c] = savgol(m, nl, nr, ld) %SAVGOL Calculate Savitzky-Golay filter coefficients. % c = savgol(m,nl,nr,ld) % m is the order of the smoothing polynomial (positive integer) % nl number of left (past) data points (positive integer) % nr number of right (future) data points (positive integer) % ld is the order of the derivative desired. ld=0 for smoothing, % ld=1 for the filtered first derivate (needs to be divided % by the step size). m>=4 is recommended for derivatives. % % Example cubic smoothing: % f = [1 1.4 1.5 1.4 1.3]'; % example data % c = savgol(3, 2, 2, 0); % smooth with cubic polynomial % f_smooth = c'*f % smoothed value at index = 3 % % Example calculate first derivative with 2nd order polynomial: % f = [1 1.4 1.5 1.4 1]'; % example data % dt = 1.0; % example data step size % c1 = savgol(2, 4, 0, 1); % 1st derivate at rightmost position % df_dt = (c1'*f)/dt; % divide by step size assert(nl >= 0 && nr >= 0 && ld <= m && nl+nr >= m && ld >= 0); assert(mod(nl,1)==0 && mod(nr,1)==0 && mod(ld,1)==0 && mod(m,1)==0); i = -nl:nr; % rows of Vandermonde matrix j = 0:m; % columns of Vandermonde matrix A = i' .^ j; % Vandermonde design matrix: A(line, col) = i^j; K = (A'*A)\A'; % least squares: (A'*A)^(-1)*A' c = K(ld+1, :)'; % line 1 = smoothing, line 2 = 1st derivative ... end
Monday, 21 December 2015
Es gibt eine neue Tetromino Version auf zwiener.org.
Link.
- Hochauflösender Fullscreen Mode.
- Künstliche Intelligenz spielt selbst (bevor man ein Spiel startet).
- 7-Bag System eingeführt.
- Rendering Algorithmus benötigt weniger Neuzeichnungen.
- Farben der Steine leicht verändert.
- Highscoredatenbank nimmt auch wieder weniger gute Ergebnisse auf.
- Neues Hintergrundbild.
- Fehler behoben. Danke an Paula Currle-Scholz
Link.
- Hochauflösender Fullscreen Mode.
- Künstliche Intelligenz spielt selbst (bevor man ein Spiel startet).
- 7-Bag System eingeführt.
- Rendering Algorithmus benötigt weniger Neuzeichnungen.
- Farben der Steine leicht verändert.
- Highscoredatenbank nimmt auch wieder weniger gute Ergebnisse auf.
- Neues Hintergrundbild.
- Fehler behoben. Danke an Paula Currle-Scholz
Sunday, 6 March 2011
I've written a small tutorial on how to use the clang_complete Vim plugin for accurate autocompletion in C/C++.
Sunday, 23 January 2011
We are not wise enough to know which lies, or even which shadings of the facts, can competently serve some higher social purpose — especially in the long run.
Carl Sagan
Tuesday, 14 December 2010
I've compiled a list of my top 10 favourite things in the Vim text editor:
Open complete list
- 1: Save time with macros
- 2: Block mode editing
- 3: Powerful search and replace
- 4: Repeat actions with the .dot key
- 5: Snippets
- 6: Switch between different open files (Lusty Juggler)
- 7: Command-T plugin
- 8: Taglist plugin
- 9: Auto format source code
- 10: Split windows
Open complete list
Page: 4/15 | Newer entries | Older entries |
Copyright © 2004-2024 Jan Zwiener