Mu Analysis and Synthesis Toolbox    
vfft, vifft, vspect

Calculate FFTs, inverse FFTs, and perform spectral analysis on VARYING matrices

Syntax

Description
vfft implements the MATLAB fft command on VARYING matrix structures. A one-dimensional FFT of length n is performed on each element of the VARYING matrix ytime. It is assumed that the independent variable is in units of seconds. The independent variables are regularly spaced -- only the first interval is used to determine the frequency scale. yfreq is returned with the independent variable, frequency, in radians/second.

vifft performs the inverse FFT. This is done with the MATLAB command ifft(yfreq) for each element of the VARYING matrix.

vspect is the VARYING matrix structure equivalent of the Signal Processing Toolbox command, spectrum. For algorithmic details, see the spectrum command. Note that vspect gives you the option of specifying a window for the data. For example, using the string hamming as the fifth argument generates a window with the command window = hamming(n);. hamming is an M-file in the Signal Processing Toolbox. You can use custom windows by specifying the name as the window argument.

In the case of the spectrum of a single signal, the command

will return a VARYING matrix, P, containing the power spectral density of x. Note that x, and therefore P, can be a matrix of signals. In the case of the spectrum, and cross-spectrum, of two signals, the command

P = vspect(x,y,m,noverlap,'window');

will return a VARYING matrix, P, with the following five columns.

These are given below.

Pxx
Power spectral density of x
Pyy
Power spectral density of y
Pxy
Cross spectral density
Txy
Complex transfer function between x and y
Cxy
Coherence function between x and y

The signal x, must be scalar (i.e., a one row, one column, VARYING matrix). y can be a vector signal. The row dimension of p is the same as that of y. vspect can do single-input, multiple-output (SIMO) identification. This is illustrated in the following example. Refer also to the example in the Tutorial chapter.

vfft, vifft, and vspect have not been optimized for speed. The appropriate row and column data is extracted from the VARYING matrices with the µ-Tools commands, sel and xtract. sbs and abv are used to create the final output.

Examples
A single-input two-output system is generated as an identification example. This example is only a simple illustration of some of the frequency domain techniques available.

Now a random input signal is created.

The signal u is the input to the system. siggen is used to generate some random noise on the output signal, y.

The vspect command specifies a 1024 point window, with 512 points of overlap. A Hamming window is applied to the data.

Column 4 in P contains the complex transfer function estimate. Its magnitude is compared to the actual system transfer function.

Algorithm
vfft, vifft, and vspectrum call the MATLAB commands fft and ifft.

Reference
Ljung, L., System Identification: Theory for the User, Prentice Hall, New Jersey, 1987.

Oppenheim, A.V., and R.W. Schafer, Digital Signal Processing, Prentice Hall, New Jersey, 1975.

See Also
fft, ifft, spectrum



veval vfind