Home > By category > Scripts >Communication > Movingslope



Movingslope

  • Downloads: 
  • Views: 
  • Rating:

The gradient function in Matlab allows you to compute the slope of a curve along its entire length. But if your curve is a noisy one, then gradient will also be noisy. In this event one might desire to fit a moderately low order polynomial regression model in a sliding window, then differentiate that model. (Like a Savitzky-Golay filter.) All of this can be done efficiently in Matlab using filter. Note that this tool does not constrain the length of the support to be even or odd.

Also, this tool uses pinv to generate the filter coefficients - a more stable and accurate methodology than does the sgolay tool on the file exchange.

A few examples of movingslope in action:

Estimate the first derivative using a 7 point window with first through fourth order models in the sliding window. Note that the higher order approximations provide better accuracy on this curve with no noise.

t = 0:.1:1;
vec = exp(t);

Dvec = movingslope(vec,7,1,.1)
Dvec =
Columns 1 through 7
1.3657 1.3657 1.3657 1.3657 1.5093 1.668 1.8435
Columns 8 through 11
2.0373 2.0373 2.0373 2.0373

Dvec = movingslope(vec,7,2,.1)
Dvec =
Columns 1 through 7
0.95747 1.0935 1.2296 1.3657 1.5093 1.668 1.8435
Columns 8 through 11
2.0373 2.2403 2.4433 2.6463

Dvec = movingslope(vec,7,3,.1)
Dvec =
Columns 1 through 7
1.0027 1.1049 1.2206 1.3498 1.4918 1.6487 1.8221
Columns 8 through 11
2.0137 2.2268 2.4602 2.7138

Dvec = movingslope(vec,7,4,.1)
Dvec =
Columns 1 through 7
0.99988 1.1052 1.2214 1.3498 1.4918 1.6487 1.8221
Columns 8 through 11
2.0137 2.2255 2.4597 2.7181

Estimate the slope of a noisy curve, using a locally quadratic approximation. In this case, use a straight line so that we know the true slope should be 1. Use a moderately wide window (10 points), since we have noisy data.

t = 0:100;
vec = t + randn(size(t));
Dvec = movingslope(vec,10,2,1)
mean(Dvec)
ans =
1.0013
std(Dvec)
ans =
0.10598

By way of comparison, gradient gives a much noisier estimate of the slope of this curve.

std(gradient(vec))
ans =
0.69847

As a time test, generate a random data vector of length 500000. Compute the slopes using a window of width 10 and a quadratic approximation in the sliding window.

vec = rand(1,500000);
tic
Dvec = movingslope(vec,10,2);
toc

Elapsed time is 0.626021 seconds.

Free download from Shareware Connection - The gradient function in Matlab allows you to compute the slope of a curve along its entire length

Publisher: John D'Errico | License: Freeware | Price: 0.00
Version: 1.0 | Size: 10 KB | Platform: Matlab, Scripts
Released Date: 19-06-2013 | Rating: 0 | Title: Movingslope

Author Url: http://www.mathworks.com
Program Info Url: http://www.mathworks.com
Download Url: http://www.mathworks.com/matlabcentral/fx_files/16997/1/movingslope.zip

More downloads from Movingslope publisher John D'Errico:

fminsearchbnd - Fminsearch does not admit bound constraints.

The Fibonacci Sequence - Often I see students asking for help on a tool to compute the Fibonacci numbers

Fminsearchcon - Nonlinear optimization problems with bound constraints can be solved using FMINSEARCHBND (as well as using many other tools.)

Nonlinear Regression Shapes - The art of fitting a nonlinear regression model often starts with choosing a model form

Moving window standard deviation - Occasionally I see a request for computation of a running, windowed standard deviation.

Movingslope keywords:
Movingslope related downloads:

Solid Surface Firm Estimate Form - Solid Surface Firm Estimate Form is also called quotation form, value bill template, bill of estimate template, estimate format or estimate form.

GUI for distillation columns: McCabe and Thiele Method. - This GUI uses a constant relative volatility (alpha) to estimate the equilibrium curve

Good Faith Estimate - Good Faith Estimate of the Settlement Costs

Estimate - With Estimate, you create a price list. You create a simple estimate by choosing items from your price list. Saved estimates can in turn be chosen as items in later estimates. When prices change, you just update your price list.

DataGridView Columns .NET 2.0 assembly - DataGridView Columns .NET 2.0 assembly is a DataGridView Columns software package specifically designed for Windows Forms .NET developers.

Shareware Connection periodically updates pricing and software information of 'Movingslope' from company source 'John D'Errico' , so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft,  Using 'Movingslope' crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of Movingslope.

New Reviews

Backup Dwarf Home Edition - Making backups of data and media content has become extremely important for computer users nowadays. Owing to hardware failure, you may end up losing gigabytes of precious data. Besides, you may not want to leave sensitive data accessible to all ...

PureSync Personal - When you use computers, there is no way you can escape using specialized third party software. These need to be used for various needs including office productivity, web access, taking back-up and ensuring proper synchronization across multiple ...

PCFerret - For average PC users learning about the details of each hardware component used in the laptop or desktop may not be an easy task. It is something the geeks can find out easily. However, less tech savvy PC users can surely resort to specialized ...

Sophos Antivirus - Mac users used to feel complacent about security of their desktops and laptops as Apple proudly claimed Macs do not get affected by malware. The rising instances of Macs getting compromised by attacks and malware has changed this perception. ...

Skitch - Skitch is a user friendly and lightweight image capturing app for OS X that has been in the scene for quite some time. After its purchase by Evernote, the nifty Mac screen-capture tool has undergone some changes. You can still perform tasks with ...

SoftAmbulance Free Eraser - Windows comes with a set of integrated utilities to let users maintain and cleanup their computers. While you can always delete files and folders from partitions, that is not a fail proof method. The data remains on hard disk in reality and any ...

HWiNFO32 - While Windows ships with its inbuilt utilities and there are command prompts to diagnose hardware and software components, these may not be feasible for all users. To learn about exact hardware and software configuration in a computer, either ...

Google Drive - In last few years, the popularity and proliferation of Cloud storage and usage has shot up considerably. Everyone, including a teenager to a network administrator is using some type of cloud based data storage. You can opt for both free and paid ...

Nero Kwik Media - Nero is known mostly for its legendary disc burning software that has metamorphosed into a media editing powerhouse over a decade. The multimedia suite offered by the company caters to needs of intermediate and advanced users well but its price ...

HandBrake - Nearly every PC user gets into a situation when they fail to understand what to do with a DVD that will not play back on DVD player or PC owing to format restrictions. Some users may also feel irked about a video file downloaded from web refusing ...




New Downloads

eTaskMaker Project Planning
Tool

Parametric estimating tool
generates project schedules
for export to leading project
management software based upon
...

WebLogger

WebLogger is a php-based
application designed to help
Amateur Radio operators log
radio traffic.

Neural Network Hebb
Learning Rule

Simple Matlab Code for Neural
Network Hebb Learning Rule

Moran's I

calculate local Moran's I for
a local grid using a weight
matrix.

Sort Data Table

Sort Data Table script
provides you options to
dynamically sort data
contained in a table.

ffndgrid Fast 'n' Furious
N-D data gridding

FFNDGRID grids unevenly spaced
data.

Current Rating Computation
for M.V Cables in a Tunnel
as per IEC 287-1-1 (2006)

In this program , The Ampacity
of the M.V cables laid inside
a tunnel will be found as per
IEC standard where specific
...

Sequence Generator

Sequence Generator v0.91
allows an easy creation of
trial lists factorial designs
including various constraints
as run ...

geom2d

Library to handle and
visualize geometric primitives
such as points, lines, circles
and ellipses, polylines and
polygons...

frontal

These routines assist in the
manipulation of matrices with
same shape but different
content

change_position_select_obj

reads files and an offset to
the coordinates of the
selected objects

Impulsive Noise Meter

Main_Sound is the main
program. See read_me.txt for
more details.