% function ynew=adsmoothdiff(dados,xnew,sdx,isdx,q,nmin)% written by Carlos J Dias%% ADAPTIVE DEGREE SAVISTZKY-GOLAY SMOOTHING AND DIFFERENTIATION% This function smooths and differentiates a sequence of numbers based on% an algorithm drawn on the ideas of Savistky and Golay and Barak.% There are no restrictions however, on the number of points% or on their spacing.% This function also calculates the first derivative at the xnew points%% INPUT:% dados - data in a two column matrix (first column x; second column y)% xnew - is a vector where new ordinates are to be computed%% sdx - is the abscissa range of data to be used to find the least squares% polynomial% isdx - is a fraction of the sdx range between [0 1] where new y_values% for xnew will be calculated. It usually is 0.8 (i.e. 80%) of the sdx range.% q - is the highest degree of the polynomial to be used in the interpolation% nmin - is the minimum data points to be used in the interpolation.%% ALGORITHM:% For each point xnew_i of the xnew vector, this function finds the least% squares polynomial (with polyfit) passing through the experimental points% lying between [xnew_i - sdx, xnew_i + sdx].% The degree of the polynomial is chosen based on a F-statistic.% Using this polynomial it calculates, with polyval, the values for% y and its derivative in that same interpolating window.%% All calculated values for each abscissa are used to compute an average% value of the smoothed function and its derivative.% When sdx range includes fewer points than nmin, the range is enlarged to% include at least nmin points. This may occur more often at the edges% of the data.% Note that we should have nmin>q%% OUTPUT (ynew - 5 column matrix)% column 1- new abscissas% column 2- new ordinates% column 3- their standard error% column 4- first derivative% column 5- no. of values that were calculated for the ith point%% DEMO SCRIPT (SMOOTHING OF 1000 POINTS)% x=linspace(-10,10,1000)';% y=1./(1+((x-2)/0.5).^2)+2./(1+((x+2)/0.5).^2);%two lorenztians% noise=0.5*(rand(length(y),1)-0.5);% y=y+noise;% ynew=adsmoothdiff([x y],x,1.1,0.8,11,15);% %(it takes about 30 s to run this script in my computer)%% P Barak, Analytical Chemistry 1995, 67 2758-2762% A Savitzky, MJE Golay, Analytical Chemistry 1964, 36(8) 1627-1638% I also acknowledge Jianwen Luo for drawing my attention to adaptive% strategies.

Travel
-
TouristGuideSriLanka 1.0.0.0
This is an app designed to deliver information about the places to visit in Sri Lanka. This app include includes information on Places to see, hotels, hospitals, wildlife, night life, banks embassies, vehicle hiring places and beaches in Sri...

26 MB

Development Tools
-
Smoooth and Differentiate 1.0
% function ynew=smoothdiff(dados,xnew,sdx,q,nmin)%% This function smoothes and differentiates a sequence of numbers based on% an algorithm similar to Savistky and Golay. There are no restrictions% however, on the number of points or on their...

10 KB

Musical Instrument Tools
-
Sothink Movie DVD Maker 1.0
Sothink Movie DVD Maker enables you to create DVDs from your video files. It can automatically convert popular video formats and either burn them to DVD, using the included burning engine, or save them as converted video files. The program also...

5.17 MB

Libraries
-
Text::Indent 0.1
Text::Indent is a simple indentation of text shared among modules. SYNOPSIS In your main program: use Text::Indent; my $indent = Text::Indent->new; $indent->spaces(2); In a module to produce indented output: use Text::Indent; my...

5.12 KB

Games
-
Gem Thief 1.0
Enter the combat arena as six nanobots clash, all striving to destroy their opponents and claim victory using nothing more than quick reaction and sheer brutality. Features Include: -* Includes 4 Individual Games.* Simultaneous 6 players option...

Network & Internet
-
Tapestry JSCookMenu 2.30
Tapestry JSCookMenu provides a component for the Apache Tapestry Web framework that makes it possible to create JavaScript menus and navigation sidebars easily with an arbitrary number of hierarchical pop up sub menus. The famous JavaScript...

Development Tools
-
IrisMVC 2.0 rc1
IrisMVC is an OOP PHP framework that developers can use as a strong and secure foundation to build on various web applications following the Model-View-Controller (MVC) pattern. It provides the basic functionality developers need, without...

Development Tools
-
Barnardextest 1.0
This file, as the Fisher's exact test, performs the exact probability test for a table of frequency data cross-classified according to two categorical variables, each of which has two levels or subcategories (2x2). It is a non-parametric...