Random-Signals-and-Applied-Kalman
所属分类:matlab编程
开发工具:PDF
文件大小:4797KB
下载次数:72
上传日期:2014-08-22 10:49:26
上 传 者:
贝克尼奥
说明: 介绍了随机信号处理,并重点阐述了卡尔曼滤波在随机信号处理中的应用,并有matlab仿真的实例。
(Introduction to Random Signals and Applied Kalman Filtering with Matlab Exercise)
文件列表:
RandomSignals and Applied Kalman Filtering with Matlab Exercise (0, 2014-08-22)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\Introduction to Random Signals and Applied Kalman Filtering with Matlab Exercise.pdf (5037894, 2014-08-19)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM (0, 2014-08-20)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO (0, 2014-08-20)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO\GPS.H (2188, 1996-06-02)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO\GPS.P0 (103, 1991-03-28)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO\GPS.PRM (72, 1996-08-06)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO\GPSQ.txt (103, 1991-03-28)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO\GPSR.txt (61, 1991-03-28)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\GPSDEMO\GPSSTM.txt (92, 1991-03-28)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS (0, 2014-08-20)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\ATT.BGI (6269, 1988-08-29)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\CGA.BGI (6253, 1988-08-29)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\DEFFONT.GLF (11750, 1989-11-03)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\EGAVGA.BGI (5363, 1988-08-29)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\EIGNPROC.EXE (44832, 1992-01-11)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\HERC.BGI (6125, 1988-08-29)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\IBM8514.BGI (6665, 1988-08-29)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\KALM.EXE (100160, 1995-11-04)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\N-LIES.EXE (163008, 1993-04-20)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\PC3270.BGI (6029, 1988-08-29)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\PRINTER.CFG (42, 1995-04-18)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\PROCESOR.EXE (98320, 1995-11-04)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\KALM\PROGS\STMQPROC.EXE (31520, 1993-04-04)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES (0, 2014-08-19)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\CHISQ1.M (190, 1996-08-12)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\CHISQ16.M (198, 1996-08-12)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\CHISQ2.M (164, 1996-08-12)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\CHISQ4.M (169, 1996-08-12)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\COVAR521.M (801, 1996-08-12)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\DRNCOS1.M (2047, 1996-06-04)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\DRNCOS2.M (2045, 1996-06-03)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\EX05_3.M (1181, 1996-06-01)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\EX06_1.M (894, 1996-04-04)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\EX06_5.M (929, 1996-04-04)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\EX10_2.M (4318, 1996-05-26)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\EX11_1.M (4590, 1996-08-13)
RandomSignals and Applied Kalman Filtering with Matlab Exercise\MFILES\FILCOVAR.M (1086, 1996-04-12)
... ...
USER'S GUIDE FOR KALM 'N SMOOTH (VERSION 2.0)
=============================================
Kalm 'N Smooth was the main tutorial tool used in conjunction
with the previous edition of this book. It has now been supplanted
by MATLAB for the versatility and power of the latter. Kalm 'N Smooth
is still effective software for solving many Kalman filtering problems,
so it is included for those who prefer a menu-oriented program. This
user's guide in its text form is understandably limited in its typesetting
qualities and hence must be read with caution and a little imagination.
We suggest that the user's guide be printed out for easier perusal.
Before describing the capabilities of the Kalm 'N Smooth
software package, we wish to emphasize that the programs were
written primarily for instructional purposes and in spite of its
limitations, we invite its usage for solving practical problems
as well. No extraordinary attempt was made to make the software
especially efficient, either in terms of speed, program or memory
capacity. Quite to the contrary, "user friendliness" was the
prime consideration in the software development. All programs in
the software package are menu oriented, and the user is prompted
at each step as to what needs to be done to get to the next step.
And the user will find that even on a personal computer with
modest speed, most assigned tasks will be executed expediently
enough for tutorial purposes.
OVERVIEW OF THE SOFTWARE CAPABILITIES
Covariance Analysis for Optimal Filtering and Smoothing:
In covariance analysis, the random input (measurement) and
output (estimate) processes are not generated. Rather, the
program simply cycles through the error covariance equations
recursively beginning with the initial covariance. In order to
do this, of course, the user must specify the four key parameters
phi, Q, H, and R, plus the initial P(0)-. The end result that
the user would want to derive from this processing is a sequence
of error covariance matrices. These data contain information
about the estimation accuracy under optimal conditions. There
are separate functions available for filtering and smoothing.
The required parameters are identical for both, except that in
the latter, the smoothing interval must be specified in addition.
Suboptimal Analysis:
It is not difficult to imagine a sequence of filter gains
that are suboptimal. They could be the result of a mismodeled
situation, or the suboptimal gain sequence might be specified
completely arbitrarily with no connection to any model.
Regardless, once the gain sequence is specified the structure of
the filter dictates that the estimate update and projection be
done in accordance with Eqs. 5.5.8 and 5.5.23.
The theory allows us to compute the error covariance associated
with this operation for any arbitrary gain K (with the proper
dimensions, of course). The general recursive equations for the
error covariance (optimal or suboptimal) can be found in Eqs. 5.5.18
and 5.5.25.
The suboptimal analysis program simply implements these
equations. Obviously, the user must specify the true phi, Q, H,
and R which define the structure of the filter. This is
sometimes referred to as the "truth" model. The user must also
specify the gain sequence K. If this comes from an "untruth"
model, then this system must be run first to generate the
appropriate number of computational steps, the gains saved in a
data file, and then these suboptimal gains used in the suboptimal
component program. (Caveat: There are some restrictions to this
elementary approach to suboptimal analysis. See Section 6.7 of the
text for details).
Monte Carlo Kalman Filter and Smoother Simulation:
In a Monte Carlo filter simulation, a sample realization of
the input (measurement) process must first be generated using the
random process generation function described below. Separate
Monte Carlo processing functions are available for filtering and
smoothing. Therefore, in addition to parameters specified above
for the covariance analysis, the user must specify the
measurement sequence z as well as an initial state estimate x(0)-.
The filter or smoother then yields a corresponding output
(estimate) process that constitutes simply one sample realization
for the specified number of computational steps. This can, of
course, be repeated over and over again with different noisy
measurement sequences made from the random process generation.
In doing so, the user obtains an ensemble of experiments which
may be analyzed statistically. This makes a vivid demonstration
that the error covariance sequence associated with the experiment
does, in fact, yield meaningful information about the estimation
accuracy.
Random Process Generation:
In Monte Carlo simulation work we often have occasion to
generate a discrete random sequence in state-space form (see
Eqs. 5.5.1 and 5.5.2). This form allows the generation of any
stationary Gaussian process with a given rational spectral function
using the modeling methods of Chapter 5. Clearly, if the user
wishes to generate a "noiseless" version of the process, the
variance of the parameter v(k) can simply be set to zero. This
program requires the user to specify the usual phi, Q, H, and R
parameters, and also the initial conditions on x(k). The end
results are files for both x(k) and z(k), which can then be used in
subsequent programs.
Schmidt Filtering (covariance analysis and Monte Carlo simulation):
Schmidt filtering may be executed with Kalm 'N Smooth by setting
up a state vector that consists of both the reduced-order states x and
the "consider" states y (see Eq. 9.4.1). The Kalman filter parameters
are to be set up according to Eqs. 9.4.2 and 9.4.3. When the Schmidt
filter function is invoked, the user will be prompted for the number
of reduced-order states (x). This number defines where the partition
separating the x and y subvectors lie. In the subsequent processing,
the Schmidt model is treated like a regular Kalman filter except the
gains associated with the y states are zeroed on every iteration.
Even though this is not the way a Schmidt filter is actually implemented,
this way of processing performs the same exact function. There are
separate functions to construct a Schmidt filter for covariance
analysis and for Monte Carlo simulation.
Steady-State Characteristic Roots Computation:
It was mentioned in Chapter 6.9 that a Kalman filter behaves
much the same as any other constant-parameter digital filter when
(and if) the filter gain reaches a steady-state condition. The
user only needs to specify the usual phi, Q, H, and R
parameters and the program computes the steady-state gain. The
end result of this program is the set of characteristic roots of
the filter in the z-plane.
State Transition Matrix (STM) and Q Matrix Computations:
Calculation of the STM and Q matrices in higher-order
systems is an onerous task with paper-and-pencil methods. This
program relieves the user of this task. We begin with the
continuous model for the system state vector x:
dx/dt = F x + G u
where F and G are constant matrices, and u is the input vector
whose elements are independent unity white noises. The user
specifies F and G in the model and the step size Dt, and the
program does the rest. The end products are data files for both
phi(k) and Q(k) that can be used in subsequent programs.
Discrete Fourier Transform (DFT), Inverse DFT, and Periodogram:
In signal analysis, it is important to be able to go back
and forth between the time and frequency domain. Thus direct and
indirect Fourier transform programs have been included in the
software package. Note that the straightforward Discrete Fourier
Transform (DFT) is implemented in this software (in contrast to
the FFT), so the number of data points is not restricted to an
integer power of 2. The DFT takes a little longer to execute
than the FFT, but from a tutorial viewpoint it is better because
it is less restrictive. In the included programs, the data
stream may be of any reasonable length and may be either real or
complex in both the time and frequency domains. It is worth
noting that the DFT program transforms an N-point time function
into an N-point complex function in the frequency domain. If the
original time function is real, this of course leads to
redundancy in the frequency domain, with points above the
foldover frequency being complex conjugates of the corresponding
lower-frequency points. We all know that this is excess baggage
for the special case of real-valued time-domain functions, but it
does no harm to do so and is correct mathematically.
The periodogram of a time signal is also of special interest
in signal analysis. Recall from Chapter 2 that the periodogram
is proportional to the square of the Fourier transform, and that
it has a close statistical connection to the autocorrelation
function. Therefore, in the DFT program, an additional output is
provided which is proportional to the square of the magnitude of
the Fourier transform, i.e. the periodogram.
Autocorrelation Function:
The autocorrelation function is a basic descriptor of a
stationary random process. There is, of course, no way that one
can determine the true autocorrelation function from just one
sample realization of a process. First, there is the matter of
the sample length; and second there is the problem of ergodicity.
However, if the data span is long relative to the pertinent
correlation times, and if we assume that the sample realization
at hand is representative of all possible samples (i.e., assume
ergodicity), then we can compute something that approximates the
true autocorrelation function. This is done simply by
multiplying the time function by itself shifted t units in time,
and then averaging. The autocorrelation function program
included in this software package does just that. The
approximation so obtained does have limitations, though, and
these should be recognized, especially when the number of shifts
(the "tau" parameter) is appreciable relative to the data span (see
Chapter 2).
Data Graphing:
Who was it that said, "A picture is worth a thousand words"?
How true this is, especially in analysis work. For this reason,
data plotting capability has been built into this software
package in two ways. First, in procedures where it is
appropriate, the user is provided with a prompt such as "Press
ENTER to view the data" after a procedure is executed. This
provides a quick look at the data in bar graph form without
formal plotting. Second, a more formal data graphing capability
is provided in a separate program whereby several data files may
be plotted together on the same X-Y or line (unspecified
independent variable) graphs.
Note on Learning to Use the Software:
A User's Guide giving detailed instructions on how to use
the accompanying software follows in the next section. After
installation of the programs on your computer, we suggest that
you first familiarize yourself with the various features provided
in this software package by working simple examples of your own
creation. For example, to check out the DFT procedure, you might
try creating a data file for a simple 16-point unit impulse in
the time domain. Then take the DFT of this function (which we
know to have a constant magnitude); and, finally, form the
inverse of the DFT to see if you get the unit impulse back again
(within roundoff error, of course). In this way, you not only
become familiar with the various procedures, but you gain a
degree of confidence that the programs are doing the job and
giving the correct answers.
You are now ready to begin using the accompanying software
package. Be forewarned that a modest amount of practice is
necessary before you will begin to feel completely comfortable
with the software. This is true with any new software package,
and it is to be expected. We trust that the "learning curve"
will be brief in this case. Once you get past the initial
familiarization phase, we think you will find that Kalman
filtering can be fun!
HARDWARE REQUIREMENTS
The programs provided will run on an IBM PC, PS/2, XT, or AT (or
a 100 percent compatible computer) with ***0 KBytes of internal
memory. Most of the standard display adapters and printers are
supported. Color displays are recommended. DOS Version 3.2 or
later should be used.
INSTALLING PROGRAMS
The programs can be executed from the floppy disk provided or
from a hard disk. If it is desired to have the programs from
your original diskette transferred to another diskette or
installed onto a hard disk, simply copy all the programs over
with any file copying utility. In DOS, the file copying utility
COPY is suitable for such a task. Important: All programs and
files furnished on the original diskette must be located on the
same directory path. If installing on a hard disk, a (programs)
subdirectory should be set up on the hard disk for this purpose
of containing the furnished programs and files. For efficient
management, it is recommended that a separate (work) subdirectory
be set up on the hard disk for new data files created in the
process of using these programs. Starting from this work
subdirectory, the need program can be executed by properly
specifying the proper path and the appropriate program name. The
following example shows the execution of the program KALM which
resides in the programs subdirectory named PROGS while all data
files specified during execution will by default be stored or
read from the work subdirectory named KALMDATA:
C:\KALMDATA> \PROGS\KALM
PROGRAMS AND FILES
On the 1.44-MByte 3.5-inch diskette furnished with the book, there
are a total of thirteen files and a subdirectory of files
intended for a demonstration. Of those in the main directory,
four are executable programs that work together to provide Kalman
Filter-related functions: KALM.EXE, PROCESOR.EXE, EIGNPROC.EXE,
STMQPROC.EXE. A fifth executable program N-LIES.EXE contains
simple utilities intended to provide the user some additional
analysis and graphing capabilities. In addition to these
programs, the diskette also contains several display drivers for
some of the more common graphics standards available today for
IBM-compatible PC systems. These driver files are identified by
the extension .BGI:
CGA.BGI For IBM CGA or MCGA
EGAVGA.BGI For IBM EGA or VGA
HERC.BGI For Hercules Monochrome
ATT.BGI For AT&T 6300 (400 line)
PC3270.BGI For IBM 3270 PC
IBM8514.BGI For IBM-8514
The capability for printing onscreen-generated graphics is also
supported. The two files associated with this capability are
named DEFFONT.GLF and PRINTER.CFG . PRINTER.CFG is an ASCII text
file that contains user-defineable parameters pertaining to the
desirable printer and printing configurations. Prior to doing
any printing with these programs, PRINTER.CFG must be properly
set up. See the section on Printer Configurations for
instructions to do this, using the Data Editor program function
provided with the N-LIES program.
KALM
The main program KALM.EXE handles input data files and runs in
conjunction with several processing programs to provide Kalman
filtering and other utility functions. They comprise the
following:
PROCESOR.EXE - Handles all the Kalman filtering functions
including generation of random processes;
EIGNPROC.EXE - Computes eigenvalues and eigenvectors of
the state space model and also the steady-
state covariance of a time-invariant state
model;
STMQPROC.EXE - Computes the state transition matrix and
the process noise covariance matrix for a
discrete-time model from a continuous-time
equivalent.
There is a limit to the size of the Kalman filter that can be
modeled with the KALM 'N SMOOTH programs. The state
dimensionality must be no larger than 20. The limit on the
dimensionality on the measurement space is also 20. Therefore,
the largest H matrix allowable is 20x20.
The two principal data elements utilized here to manage the flow
of information are the Parameter and Data files. They are
described in detail in the discussion that follows.
Parameter File:
By convention, the full set of Kalman parameters that may be used
consist of the following, although in certain cases, some are not
necessary:
1. State transition matrix (phi)
2. Process noise covariance matrix (Q)
3. Measurement matrix (H)
4. Measurement noise covariance matrix (R)
5. Initial state (x0)
6. Initial error covariance (P0)
7. Measurement (z)
8. State output (x)
In addition to the names of the Data Files for the Kalman
parameters above, a Parameter File also records several other
items which includes the mode of data entry for the respective
Kalman parameter as well as the dimensions of the state and
measurement spaces. Although these parameters are important for
the data processing that follows, they are primarily intended for
housekeeping functions by the programs that use them and should
really be transparent to the user.
Data File:
A Data File is an ASCII text file which allows the user to input
information for a particular Kalman parameter. There are three
standard modes of data entry into the processing Kalman filter:
1) constant , 2) file, and 3) equation (see Mode of Data Entry).
In each Data File, the mode of data entry must be specified along
with the dimensions of the matrix representing the parameter.
Both are located in the very first line of each Data File. The
dimensions of the matrix must be delimited by brackets and
separated (number of rows versus columns) by a colon. If the
parameter represented is a vector instead, the dimension may be
represented as a single number without use of the colon. The
data that follow are read in sequence across the columns of the
matrix and down the rows. Comments, which are ignored by the
data processing, can be added to each line by placing them to the
right of a colon. Equations used in the equation mode of data
entry must be in the form of function of time, t or T (see
Reference). The following are examples of various formats that
can be used for a Data File:
1. A Data File with 2x3 matrices to be read at each iteration,
with comments:
[2:3] File
3.2 1.1 4.8
2.0 8.2 5.2E-2 : 0
3.1 1.1 5.0
2.5 8.4 5.2E-2 : 1
3.0 1.1 5.1
3.0 8.4 5.2E-2 : 2
.
.
.
2. A Data File with 2x3 constant matrix:
[2:3] Constant
3.2 1.1 4.8
2.0 8.2 5.2E-2
3. A Data File with 2x2 equations matrix using semicolon
separators:
[2:2] Equation
k1 = 2*t+3; k2 = cos (2*pi*t)
$1$1 = k1*k2; $1$2 = k1+4
$2$1 = t ; $2$2 = 3
4. A Data File with 2x2 eq ... ...
近期下载者:
相关文件:
收藏者: