Tel: 848-445-5017
e-mail: orfanidi@rutgers.edu
Any feedback from readers is welcome.
This book is an updated and much enlarged 2018 edition of Optimum Signal Processing, which was published in 2007 as a republication of the second edition published by McGraw-Hill Publishing Company, New York, NY, in 1988 (ISBN 0-07-047794-9), and also published earlier by Macmillan, Inc., New York, NY, 1988 (ISBN 0-02-389380-X). All copyrights to this work reverted to Sophocles J. Orfanidis in 1996.
Initially posted online in August 2018. Latest revision date - August 1, 2018.
The entire book is freely available in PDF 2-up format, and in PDF 1-up format. Individual chapters are available below.
A printed version is also available as a two-volume 6x9 paperback set ( vol.1, vol.2).
Copyright (c) 2018 by Sophocles J. Orfanidis, All Rights Reserved. The book exists in online form through the web page Applied Optimum Signal Processing. Links to this page may be placed on any web site.
Any part of this book may be downloaded and printed for personal or educational use only, as long as the printed or photocopied pages are not altered in any way from the original PDF files posted on the book's web page.
No part of this book may be reproduced, altered in any way, or transmitted in any form for commercial, profit, sale, or marketing purposes.
MATLAB (R) is a registered trademark of The MathWorks, Inc.
OSP Toolbox by S. J. Orfanidis, August 2018.
CVX software by Michael Grant and Stephen Boyd, September 2013.
The OSP toolbox contains about 270 MATLAB functions for carrying out all of the computations and simulation examples in the book. Code segments illustrating the usage of these functions are found throughout the book, and serve as a user manual. Please read the license agreement before using the toolbox. The zipped file osp_toolbox.zip (last revised on August 1, 2018) contains all the MATLAB functions. Note that just typing the name of any function will produce a help/usage comment for that function. The detailed list of the MATLAB functions is as follows:
Local Polynomial Smoothing Filters
----------------------------------
binom - vector of binomial coefficients
bkfilt - Baxter-King bandpass filter
cldec - classical decomposition method
combfd - comb fractional-delay filter design
compl - complement of an odd-length symmetric filter
diffb - backward difference operator
diffmat - difference convolution matrix
diffpol - differentiate polynomial
diffs - seasonal backward difference operator
ecg - ECG generator
ecgsim - ECG simulation
filtdbl - filtering with double-sided FIR filter
hahnbasis - Hahn orthogonal polynomials
hahncoeff - coefficients of Hahn orthogonal polynomials
hahnpol - Hahn orthogonal polynomial evaluation
hahnrec - Hahn orthogonal polynomials
hend - Henderson weighting function
kmat - difference convolution matrix
kraw - Krawtchouk binomial weighting function
kwindow - Kaiser window for spectral analysis
lagrfd - Lagrange-interpolation fractional-delay filter
lpbasis - local polynomial basis
lpdiff - weighted local polynomial differentiation filters
lpfilt - local polynomial filtering - fast version
lpfilt2 - local polynomial filtering - slower version
lpinterp - local polynomial interpolation and differentiation filters
lpmat - local polynomial smoothing matrix
lpmissing - weighted local polynomial filters for missing data
lprs - local polynomial minimum-Rs smoothing filters
lprs2 - local polynomial minimum-Rs smoothing filters (closed-form)
lpsm - weighted local polynomial smoothing and differentiation filters
minrev - minimum revision asymmetric filters
polval - polynomial evaluation in factorial power series
rlpfilt - robust local polynomial filtering
sigav - signal averaging
smadec - decomposition using seasonal moving-average filters
smafilt - impulse responses of seasonal decomposition moving average filters
smat - seasonal moving-average filtering matrix
smav - seasonal moving average filter
stirling - Stirling numbers of first or second kind, signed or unsigned
swhdec - seasonal Whittaker-Henderson decomposition
trendma - trend moving-average filter, 2xD if D is even, 1xD if D is odd
upmat - upsample matrix of smoothing filters
whkdec - Whittaker-Henderson-Kaiser seasonal decomposition
x11dec - US Census X-11 decomposition method for seasonal adjustment
x11filt - impulse responses of the US Census X-11 seasonal adjustment filters
Local Linear Regression
-----------------------
avobs - average repeated observations
locband - bandwidth for local polynomial regression
locgcv - local polynomial GCV and CV evaluation
locgrid - uniform grid for local polynomial evaluation
locpol - local polynomial regression
locval - evaluation/interpolation of local polynomial regression
locw - local weighting functions for local polynomial regression
loess - Cleveland's robust locally weighted scatterplot smoothing (loess)
loess2 - Cleveland's robust locally weighted scatterplot smoothing (loess)
Spline and Whittaker-Henderson Smoothing
----------------------------------------
splambda - find optimum lambda for spline smoothing using GCV
splav - averaged repeated observations at spline knots
splcoeff - spline coefficients
splgcv - evaluate GCV(lambda)
splmat - spline smoothing matrices Q,T
splsm - spline smoothing using Reinsch's algorithm
splsm2 - spline smoothing using Reinsch's algorithm - robust version
splval - evaluate spline smoothing polynomials
whgcv - Whittaker-Henderson GCV
whgen - generalized Whittaker-Henderson
whimp - Whittaker-Henderson filter impulse response
whsm - Whittaker-Henderson smoothing method
whsm1 - Whittaker-Henderson smoothing method - L1 version
Exponentially Weighted Average
------------------------------
binmat - binomial boost matrices for exponential smoothers
ema - exponential moving average - exact version
emaerr - calculate MAE, MSE, and MAPE for a range of lambda's
emap - map equivalent lambdas between d=0 EMA and d=1 EMA
emat - polynomial to cascaded transformation matrix
holt - Holt's exponential smoothing
holterr - calculate MAE, MSE, and MAPE for a range of lambda's
mema - multiple exponential moving average
stema - steady-state exponential moving average
Linear Prediction & Wiener and Kalman Filtering Functions
---------------------------------------------------------
acext - autocorrelation sequence extension using Levinson recursion
acf - sample auto-correlation function
acmat - construct autocorrelation Toeplitz matrix from autocorrelation lags
acsing - sinusoidal representation of singular autocorrelation matrices
aicmdl - estimates dimension of signal subspace from AIC and MDL criteria
argen - generate a zero-mean segment of an AR process
bkwlev - backward Levinson recursion
burg - Burg's method of linear prediction
dir2nl - direct form to normalized lattice
dpd - dynamic predictive deconvolution
dwf - sample processing algorithm of direct-form Wiener filter
dwf2 - direct-form Wiener filter using circular delay-line buffer
dwfilt - direct-form Wiener filtering of data
dwfilt2 - circular-buffer direct-form Wiener filtering of data
faest - sample processing algorithm of adaptive lattice Wiener filter
firw - FIR Wiener filter design
flipv - flip a vector, column, row, or both for a matrix
frwlev - forward Levinson recursion
glwf - sample processing algorithm of lattice Wiener filter
kfilt - Kalman filtering
ksmooth - Kalman smoothing
latt - sample processing algorithm of analysis lattice filter
lattfilt - lattice filtering of a data vector
lattsect - sample processing algorithm of a single lattice section
lattsynth - sample processing algorithm of synthesis lattice filter
lev - Levinson-Durbin recursion
lms - sample processing LMS algorithm of direct-form Wiener filter
lpf - extract linear prediction filter from matrix L
lpg - extract reflection coefficients from matrix L
lpspec - compute LP spectrum of a prediction-error filter
lwf - sample processing algorithm of lattice Wiener filter
lwfilt - lattice Wiener filtering of data
mgs - adaptive modified Gram-Schmidt
mgslms - adaptive Gram-Schmidt using LMS
minorm - minimum-norm noise subspace eigenvector
music - MUSIC spectrum computation
nlfilt - filtering in the normalized lattice form
obmat - observability matrix for canonical or transposed realizations
obmatc - observability matrix for continuous-time
rlev - reverse of Levinson's algorithm
rls - RLS algorithm for adaptive linear combiner
rlsl - sample processing algorithm of lattice Wiener filter
rmusic - minimum-norm noise subspace eigenvector
scatt - direct scattering problem
schur1 - Schur algorithm for linear prediction
schur2 - Schur algorithm for Cholesky factorization
spike - spiking filter design
yw - Yule-Walker method of linear prediction
SVD, Subspace, and ARMA Modeling Functions
------------------------------------------
arma2imp - ARMA impulse response
armaacf - ARMA autocorrelation function
armachol - ARMA covariance matrix Cholesky factorization
armafit - fitting an ARMA(p,q) model to covariance lags
armainf - ARMA asymptotic Fisher information matrix
armainnov - ARMA modeling using the innovations method
armamf - Mayne-Firoozan ARMA modeling method
armamyw - ARMA modeling by the modified Yule-Walker method
armasim - simulate a zero-mean segment of a gaussian ARMA process
armasim2 - simulate a zero-mean segment of a gaussian ARMA process
bwidth - beamwidth mapping from psi-space to phi-space
cca - Canonical Correlation Analysis
ccacov - CCA applied to a covariance matrix
cholgs - Cholesky factorization by Gram-Schmidt orthogonalization
cholinnov - Cholesky factorization by innovations representation
crb - calculate Cramer-Rao bounds for sinusoids in noise
crb2 - calculate Cramer-Rao bounds for sinusoids in noise
datamat - convolution data matrix of a signal vector
datasig - extract data signal from a Toeplitz or Toeplitz/Hankel data matrix
dolph - Dolph-Chebyshev array weights
fisher - calculate Fisher information matrix for sinusoids in noise
imp2arma - impulse response to ARMA coefficients
irls - Lp_regularized iteratively reweighted least squares
irls_wh - Lp_regularized IRLS Whittaker-Henderson
lpls - construct least-squares linear prediction filter from data matrix
madurbin - MA modeling by Durbin's method
mafit - Wilson's method of fitting an MA(q) model to covariance lags
mainnov - MA modeling by the innovations method
mpencil - matrix-pencil method of extracting sinusoids in noise
poly2 - specialized version of poly
scan - scan array with given scanning phase
setrank - reduce the rank of a diagonal matrix of singular values
sigsub - construct reduced-rank signal subspace of a data matrix
sines - generate sum of real or complex decaying sinusoids in noise
snap - generate snapshot matrix for array problems
snapshot - generate data matrix of snapshots for array problems
snr - magnitude to SNR in dB, and conversely
steer - steer array towards given angle
steering - construct steering matrix of multiple sinusoids/plane-waves
steermat - construct steering matrix of multiple sinusoids/plane-waves
svdenh - SVD signal enhancement
toepl - Toeplitz, Hankel, or Toeplitz/Hankel approximation of data matrix
varper - percentage variances
Wavelet Functions
-----------------
advance - circular time-advance (left-shift) of a vector
casc - cascade algorithm for phi and psi wavelet functions
circonv - circular convolution
cmf - conjugate mirror of a filter
convat - convolution a trous
convmat - sparse convolution matrix
convmat2 - sparse convolution matrix (simplified version)
daub - Daubechies scaling filters (daublets, symmlets, coiflets)
dn2 - downsample by a factor of 2
dwtcell - cell array of sparse discrete wavelet transform matrices
dwtdec - DWT decomposition into orthogonal multiresolution components
dwtmat - discrete wavelet transform matrices
dwtmat2 - discrete wavelet transform matrices
dwtwrap - wrap a DWT matrix into a lower DWT matrix
flipv - flip a vector, column, row, or both for a matrix
fwt - fast wavelet transform using convolution and downsampling
fwtm - fast wavelet transform in matrix form
fwtmat - overall DWT orthogonal matrix
ifwt - inverse fast wavelet transform using upsampling and convolution
ifwtm - inverse fast wavelet transform in matrix form
iuwt - inverse undecimated wavelet transform
iuwtm - inverse undecimated wavelet transform
modwrap - wrap matrix column-wise mod-N
phinit - eigenvector initialization of phi
plotdec - plot DWT/UWT decomposition or DWT/UWT coefficients
up2 - upsample a vector by factor of two
upr - upsample a vector by factor of 2^r
uwt - undecimated wavelet transform
uwtdec - UWT multiresolution decomposition
uwtm - undecimated wavelet transform
uwtmat - undecimated wavelet transform matrices
uwtmat2 - undecimated wavelet transform matrices
w2V - wavelet vector to wavelet matrix
wcoeff - extract wavelet coefficients from DWT at given level
wdenoise - Donoho & Johnstone's VisuShrink denoising procedure
wduwt - wavelet denoising with UWT
wthr - soft/hard level-dependent wavelet thresholding
Technical Analysis Functions
----------------------------
accdist - accumulation/distribution line
atr - true range & average true range
bbands - Bollinger bands
bma - Butterworth moving average
cci - commodity channel index
chosc - Chaikin oscillator
chvol - Chaikin volatility
cmflow - Chaikin money flow
cmo - Chande momentum oscillator
delay - lag or delay or advance by d samples
dema - steady-state double exponential moving average
dirmov - directional movement system
dmi - dynamic momentum index (DMI)
donch - Donchian channels
dpo - detrended price oscillator
ehma - exponential Hull moving average
fbands - fixed-envelope bands
forosc - forecast oscillator
gdema - generalized dema
hma - Hull moving average
ilrs - integrated linear regression slope indicator
kbands - Keltner bands or channels
lreg - linear regression, slope, and R-squared indicators
mom - momentum and price rate of change
ohlc - make Open-High-Low-Close bar chart
ohlcyy - OHLC plot with other indicators on the same graph
pbands - Projection Bands and Projection Oscillator
pma - predictive moving average, linear fit
pma2 - predictive moving average, polynomial order d=1,2
pmaimp - predictive moving average impulse response
pmaimp2 - predictive moving average impulse response, d=1,2
pnvi - positive and negative volume indices (PVI & NVI)
prosc - price oscillator & MACD
psar - Wilder's parabolic SAR
r2crit - R-squared critical values
rsi - relative strength index (RSI)
sebands - standard-error bands
sema - single exponential moving average
shma - SMA-based Hull moving average
sma - simple moving average
stbands - STARC bands
stdev - standard deviation index
stoch - stochastic oscillator
t3 - Tillson's T3 indicator, triple gdema
tcrit - critical values of Student's t-distribution
tdistr - cumulative t-distribution
tema - triple exponential moving average
tma - triangular moving average
trix - TRIX oscillator
vema - variable-length exponential moving average
vhfilt - Vertical Horizontal filter
wema - Wilder's exponential moving average
wma - weighted or linear moving average
yylim - adjust left/right ylim & ticks
Miscellaneous Functions
-----------------------
canfilt - IIR filtering in canonical form using linear delay-line buffer
ccan - IIR filter in canonical form using circular delay-line buffer
ccanfilt - IIR filtering in canonical form using circular delay-line buffer
frespc - frequency response of a cascaded IIR filter at a frequency vector w
loadfile - load data file ignoring any text lines
taxis - define time axis
up - upsample by a factor of L
ustep - unit-step or rising unit-step function
xaxis - set x-axis limits and tick marks
yaxis - set y-axis limits and tick marks
zmean - zero mean of each column of a data matrix (or row vector)