Functions of the MATLAB Signal Processing Toolbox

INVFREQZ Functions of the MATLAB Signal Processing Toolbox. Version 3.0b Waveform generation. DIRIC Dirichlet, or periodic sinc function. SAWTOOTH S...
11 downloads 0 Views 62KB Size
INVFREQZ

Functions of the MATLAB Signal Processing Toolbox. Version 3.0b

Waveform generation. DIRIC Dirichlet, or periodic sinc function. SAWTOOTH Sawtooth and triangle wave generation. SINC Sin(pi*x)/(pi*x) function. SQUARE Square wave generation.

3 3 3 3 3

IIR filter order selection. BUTTORD Butterworth filter order selection. CHEB1ORD Chebyshev type I filter order selection. CHEB2ORD Chebyshev type II filter order selection. ELLIPORD Elliptic filter order selection.

Filter analysis and implementation. ABS Absolute value and string to numeric conversion. ANGLE Phase angle. CONV Convolution and polynomial multiplication. FFTFILT Overlap-add method of FIR filtering using FFT. FILTER Digital filter. FILTFILT Zero-phase forward and reverse digital filtering. FILTIC Make initial conditions for 'filter' function. FREQS Laplace-transform frequency response. FREQSPACE Frequency spacing for 2-D frequency responses. FREQZ Z-transform digital filter frequency response. GRPDELAY Group delay of a digital filter. IMPZ Impulse response of digital filter. UNWRAP Unwrap phase angle in radians. ZPLANE Z-plane zero-pole plot.

4 4 4 4 4 4 5 5 5 5 5 6 6 6 6

FIR filter design. 15 FIR1 FIR filter design using the window method. 15 FIR2 FIR filter design using the window method - arbitrary filter shape. 15 FIRLS Linear-phase FIR filter design using least-squares error minimization. 15 INTFILT Interpolation (and Decimation) FIR Filter Design. 15 REMEZ Parks-McClellan optimal equiripple FIR filter design. 16 REMEZORD FIR order estimator (lowpass, highpass, bandpass, multiband). 16

Linear system transformations. 8 CONVMTX Convolution matrix. 8 POLY2RC Compute reflection coefficients from polynomial coefficients. 8 RC2POLY Compute polynomial coefficients from reflection coefficients. 8 RESIDUEZ Z-transform partial-fraction expansion. 8 SOS2SS Second-order sections to state space linear system model conversion. 8 SOS2TF 2nd-order sections to transfer function linear system model conversion. 9 SOS2ZP Second-order sections to zero-pole-gain linear system model conversion. 9 SS2SOS State-space to second-order sections linear system model conversion. 9 SS2TF State-space to transfer function conversion. 10 SS2ZP State-space to zero-pole conversion. 10 TF2SS Transfer function to state-space conversion. 10 TF2ZP Transfer function to zero-pole conversion. 10 ZP2SOS Zero-pole-gain to second-order sections linear system model conversion. 11 ZP2SS Zero-pole to state-space conversion. 11 ZP2TF Zero-pole to transfer function conversion. 11 IIR digital filter design. 12 BESSELF Bessel analog filter design. 12 BUTTER Butterworth digital and analog filter design. 12 CHEBY1 Chebyshev I digital and analog filter design. 12 CHEBY2 Chebyshev II digital and analog filter design. 12 ELLIP Elliptic or Cauer digital and analog filter design. 13 YULEWALK Recursive filter design using a least-squares method. 13

MATLAB Signal Processing Toolbox

14 14 14 14 14

Transforms. CZT Chirp z-transform. DCT Discrete cosine transform. DFTMTX Discrete Fourier transform matrix. FFT Discrete Fourier transform. FFTSHIFT Move zeroth lag to center of spectrum. HILBERT Hilbert transform. IDCT Inverse discrete cosine transform. IFFT Inverse discrete Fourier transform.

17 17 17 17 17 17 17 18 18

Statistical signal processing. COHERE Coherence function estimate. CORRCOEF Correlation coefficients. COV Covariance matrix. CSD Cross Spectral Density estimate. PSD Power Spectral Density estimate. SPECTRUM Power spectrum estimate of one or two data sequences. TFE Transfer Function Estimate. XCORR Cross-correlation function estimates. XCOV Cross-covariance function estimates.

19 19 19 19 19 20

Windows. BARTLETT BLACKMAN BOXCAR CHEBWIN HAMMING HANNING KAISER TRIANG

22 22 22 22 22 22 22 22 22

Bartlett window. Blackman window. Rectangular window. Chebyshev window. Hamming window. Hanning window. Kaiser window. Triangular window.

LEVINSON LPC PRONY STMCB

Discrete filter least squares fit to frequency response data. 23 Levinson-Durbin Recursion. 23 Linear Predictive Coefficients. 23 Prony's method for time-domain IIR filter design. 24 Compute linear model via Steiglitz-McBride iteration. 24

Specialized operations. 25 CCEPS Complex cepstrum. 25 DECIMATE Resample data at a lower rate after lowpass filtering. 25 DECONV Deconvolution and polynomial division. 25 DEMOD Signal demodulation for communications simulations.25 INTERP Resample data at a higher rate using lowpass interpolation. 26 INTERP1 1-D data interpolation (table lookup). 26 MEDFILT1 One dimensional median filter. 26 MODULATE Signal modulation for communications simulations. 26 RCEPS Real cepstrum. 27 RESAMPLE Change the sampling rate of a signal. 27 SPECGRAM Calculate spectrogram from signal. 27 SPLINE Cubic spline data interpolation. 28 VCO Voltage controlled oscillator. 28 Analog lowpass filter prototypes. BESSELAP Bessel analog lowpass filter prototype. BUTTAP Butterworth analog lowpass filter prototype. CHEB1AP Chebyshev type I analog lowpass filter prototype. CHEB2AP Chebyshev type II analog lowpass filter prototype. ELLIPAP Elliptic analog lowpass filter prototype.

29 29 29 29 29 29

Frequency translation. LP2BP Lowpass to bandpass analog filter transformation. LP2HP Lowpass to highpass analog filter transformation. LP2LP Lowpass to lowpass analog filter transformation. BILINEAR Filter discretization. IMPINVAR Impulse invariance method for analog to digital filter conversion.

30 30 30 30 30 30

Other CONV2 CPLXPAIR DETREND FFT2 FFTSHIFT IFFT2 POLYSTAB STEM STRIPS XCORR2

31 Two dimensional convolution. 31 Sort numbers into complex conjugate pairs. 31 Remove a linear trend from a vector, usually for FFT processing. 31 Two-dimensional Fast Fourier Transform. 31 Move zeroth lag to center of spectrum. 31 Two-dimensional inverse discrete Fourier transform. 31 Polynomial stabilization. 31 Plot discrete sequence data. 32 Strip plot. 32 Two-dimensional cross-correlation. 32

Demonstrations. CZTDEMO Demonstrates the FFT and CZT in the Image Processing Toolbox. FILTDEMO Demonstrates filter design tools in the Signal Processing Toolbox. MODDEMO Demonstrates modulation and demodulation. SOSDEMO Second Order Sections Demontration for the Signal Processing Toolbox.

33 33 33 33 33

Hidden utility functions for toolbox. 34 ABCDCHK Checks dimensional consistency of A,B,C,D matrices.34 COMB Plot discrete sequence data. 34 DENF Compute denominator from covariances. 34 FILTDEMO Demonstrates filter design tools in the Signal Processing Toolbox. 34 KRATIO Utility function for use with ELLIP. 34 MLTPLCTY Multiplicity of a pole. 34 MPOLES Identify repeated poles & their multiplicities. 34 NARGCHK Check number of input arguments. 35 NUMF Find numerator B given impulse-response h of B/A and denominator A. 35 RCUNWRAP Phase unwrap utility used by CCEPS. 35 REMEZDD Lagrange interpolation coefficients. 35 REMLPORD IR lowpass filter Length estimator. 35 SINEINT Numerical Sine Integral. 35 VRATIO Utility function for use with ELLIP. 35

20 21 21 21

Parametric modeling. 23 INVFREQS Analog filter least squares fit to frequency response data. 23

1

MATLAB Signal Processing Toolbox

2

Waveform generation.

Filter analysis and implementation.

DIRIC

Dirichlet, or periodic sinc function.

Y = DIRIC(X,N) returns a matrix the same size as X whose elements are the Dirichlet function of the elements of X. Positive integer N is the number of equally spaced extrema of the function in the interval 0 to 2*pi.

ABS

The Dirichlet function is defined as d(x) = sin(N*x/2)./(N*sin(x/2))for x not a multiple of 2*pi +1 or -1 for x a multiple of 2*pi. (depending on limit)

SAWTOOTH

Sawtooth and triangle wave generation.

SAWTOOTH(T) generates a sawtooth wave with period 2*pi for the elements of time vector T. SAWTOOTH(T) is like SIN(T), only it creates a sawtooth wave with peaks of +1 to -1 instead of a sine wave. SAWTOOTH(T,WIDTH) generates a modified triangle wave where WIDTH, a scalar parameter between 0 and 1, determines the fraction between 0 and 2*pi at which the maximum occurs. The function increases from -1 to 1 on the interval 0 to WIDTH*2*pi, then decreases linearly from 1 back to -1 on the interval WIDTH*2*pi to 2*pi. Thus WIDTH = .5 gives you a triangle wave, symmetric about time instant pi with peak amplitude of one. SAWTOOH(T,1) is equivalent to SAWTOOTH(T). Caution: this function is inaccurate for huge numerical inputs

Phase angle.

ANGLE(H) returns the phase angles, in radians, of a matrix with complex elements.

See also ABS, UNWRAP.

CONV Sin(pi*x)/(pi*x) function.

Convolution and polynomial multiplication.

C = CONV(A, B) convolves vectors A and B. The resulting vector is length LENGTH(A)+LENGTH(B)-1. If A and B are vectors of polynomial coefficients, convolving them is equivalent to multiplying the two polynomials.

See also XCORR, DECONV, CONV2.

SINC(X) returns a matrix whose elements are the sinc of the elements of X, i.e. y = sin(pi*x)/(pi*x) if x ~= 0 = 1 if x == 0

FFTFILT

where x is an element of the input matrix and y is the resultant output element.

SQUARE

See also ANGLE, UNWRAP. ABS(S), where S is a MATLAB string variable, returns the numeric values of the ASCII characters in the string. It does not change the internal representation, only the way it prints. See also SETSTR.

ANGLE

See also SQUARE, SIN, COS

SINC

Absolute value and string to numeric conversion.

ABS(X) is the absolute value of the elements of X. When X is complex, ABS(X) is the complex modulus (magnitude) of the elements of X.

Square wave generation.

SQUARE(T) generates a square wave with period 2*Pi for the elements of time vector T. SQUARE(T) is like SIN(T), only it creates a square wave with peaks of +1 to -1 instead of a sine wave. SQUARE(T,DUTY) generates a square wave with specified duty cycle. The duty cycle, DUTY, is the percent of the period in which the signal is positive. For example, generate a 30 Hz square wave: t = 0:.001:2.5; y = SQUARE(2*pi*30*t), plot(t,y)

Overlap-add method of FIR filtering using FFT.

Y = FFTFILT(B,X) filters X with the FIR filter B using the overlap/add method, using internal parameters (FFT size and block length) which guarantee efficient execution. Y = FFTFILT(B,X,N) allows you to have some control over the internal parameters, by using an FFT of at least N points. If X is a matrix, FFTFILT filters its columns.

See also FILTER. Algorithmic details The overlap/add algorithm convolves B with blocks of X, and adds the overlapping output blocks. It uses the FFT to compute the convolution. Particularly for short filters and long signals, this algorithm is MUCH faster than the equivalent numeric function FILTER(B,1,X). Y = FFTFILT(B,X) -- If you leave N unspecified: (RECOMMENDED) Usually, length(X) > length(B). Here, FFTFILT chooses an FFT length (N) and block length (L) which minimize the number of flops required for a length-N FFT times the number of blocks ceil(length(X)/L). If length(X) size(B).

STRIPS ignores the imaginary part of X if it is complex.

See also PLOT, STEM.

XCORR2

Two-dimensional cross-correlation.

XCORR2(A,B) computes the crosscorrelation of matrices A and B. XCORR2(A) is the autocorrelation function.

CONV2 is fastest when size(A) > size(B).

See also CONV2.

See also XCORR2, CONV, XCORR, DECONV, FILTER2.

CPLXPAIR

STRIPS(X,N) plots vector X in strips that are each N samples long. STRIPS(X,SD,Fs) plots vector X in horizontal strips of duration SD seconds given sampling frequency of Fs samples per second. If X is a matrix, STRIPS(X,N) and STRIPS(X,SD,Fs) plot the different columns of X on the same strip plot.

Sort numbers into complex conjugate pairs.

Y = CPLXPAIR(X) rearranges the elements of vector X so that complex numbers are collected into matched pairs of complex conjugates. The pairs are ordered by increasing real part. Any purely real elements are placed after all the complex pairs. Y = CPLXPAIR(X,TOL) uses a relative tolerance of TOL for comparison purposes. The default is TOL = 100*EPS.

DETREND

Remove a linear trend from a vector, usually for FFT processing.

Y = DETREND(X) removes the best straight-line fit from the data in vector X and returns it in vector Y. If X is a matrix, DETREND removes the trend from each column of the matrix. Y = DETREND(X,0) removes just the mean value from vector X, or the mean value from each column, if X is a matrix.

FFT2

Two-dimensional Fast Fourier Transform.

FFT2(X) returns the two-dimensional Fourier transform of matrix X. If X is a vector, the result will have the same orientation. FFT2(X,MROWS,NCOLS) pads matrix X with zeros to size MROWS-by-NCOLS before transforming.

See also IFFT2, FFT, IFFT, FFTSHIFT.

FFTSHIFT

Move zeroth lag to center of spectrum.

Shift FFT. For vectors FFTSHIFT(X) returns a vector with the left and right halves swapped. For matrices, FFTSHIFT(X) swaps the first and third quadrants and the second and fourth quadrants. FFTSHIFT is useful for FFT processing, moving the zeroth lag to the center of the spectrum.

IFFT2

Two-dimensional inverse discrete Fourier transform.

IFFT2(F) returns the two-dimensional inverse Fourier transform of matrix F. If F is a vector, the result will have the same orientation. IFFT2(F,MROWS,NCOLS) pads matrix F with zeros to size MROWS-by-NCOLS before transforming.

See also FFT2, FFTSHIFT.

POLYSTAB

Polynomial stabilization.

POLYSTAB(A), where A is a vector of polynomial coefficients, stabilizes the polynomial with respect to the unit circle; roots whose magnitudes are greater than one are reflected inside the unit circle.

MATLAB Signal Processing Toolbox

31

MATLAB Signal Processing Toolbox

32

Demonstrations.

Hidden utility functions for toolbox.

CZTDEMO

Demonstrates the FFT and CZT in the Image Processing Toolbox.

FILTDEMO

Demonstrates filter design tools in the Signal Processing Toolbox.

To start the demo, type "filtdemo". For more information, hit the "info" button once the demo is running.

ABCDCHK

Checks dimensional consistency of A,B,C,D matrices.

MSG = ABCDCHK(A,B,C,D) checks the consistency of the dimensions of A,B,C,D. Returns the empty matrix if they are, or an an error message string if they are not. Valid systems with empty matrices are allowed.

Once you've designed a filter that you like, [b,a] = filtdemo('getfilt');

COMB

gives you the filter coefficients.

See also CZTDEMO, MODDEMO, SOSDEMO.

MODDEMO

Plot discrete sequence data.

COMB(Y) plots the data sequence Y as stems from the x-axis terminated with circles for the data value. COMB(X,Y) plots the data sequence Y at the values specified in X.

Demonstrates modulation and demodulation.

There is an optional final string argument to specify a line-type for the stems of the data sequence. E.g. COMB(X,Y,'-.') or COMB(Y,':').

See also CZTDEMO, FILTDEMO, SOSDEMO.

DENF SOSDEMO

Second Order Sections Demontration for the Signal Processing Toolbox.

Compute denominator from covariances.

A = DENF(R,NA) computes order NA denominator A from covariances R(0)...R(nr) using the Modified YuleWalker method. This function is used by YULEWALK.

FILTDEMO

Demonstrates filter design tools in the Signal Processing Toolbox.

To start the demo, type "filtdemo". For more information, hit the "info" button once the demo is running. Once you've designed a filter that you like, [b,a] = filtdemo('getfilt'); gives you the filter coefficients.

See also CZTDEMO, MODDEMO, SOSDEMO.

KRATIO

Utility function for use with ELLIP.

KRATIO is a function used to calculate the zeros of an elliptic filter. It is used with FMINS to find a parameter m satisfying ellipke(m)/ellipke(1-m) = krat.

MLTPLCTY

Multiplicity of a pole.

MLTPLCTY(P,IND,TOL) finds the multiplicity of P(IND) in the vector P with a tolerance of TOL. TOL defaults to .001. Uses MPOLES in the Signal Processing Toolbox. Used by IMPZ.

MPOLES

Identify repeated poles & their multiplicities.

[MULTS, IDX] = mpoles( P, TOL ) P: the list of poles TOL: tolerance for checking when two poles are the "same" MULTS: list of pole multiplicities IDX: indices used to sort P NOTE: this is a support function for RESIDUEZ.

MATLAB Signal Processing Toolbox

33

MATLAB Signal Processing Toolbox

34

NARGCHK

Check number of input arguments.

Return error message if not between low and high. If it is, return empty matrix.

NUMF

Find numerator B given impulse-response h of B/A and denominator A.

NB is the numerator order. This function is used by YULEWALK.

RCUNWRAP

Phase unwrap utility used by CCEPS.

RCUNWRAP(X) unwraps the phase and removes phase corresponding to integer lag.

See also: UNWRAP, CCEPS.

REMEZDD

Lagrange interpolation coefficients.

REMLPORD

IR lowpass filter Length estimator.

L = remLPord(freq1, freq2, dev1, dev2) input: freq1: freq2: dev1: dev2:

passband stopband passband stopband

cutoff freq (NORMALIZED) cutoff freq (NORMALIZED) ripple (DESIRED) attenuation (not in dB)

output: L = filter Length (# of samples) NOT the order N, which is N = L-1 NOTE: Will also work for highpass filters (i.e., f1 > f2) Will not work well if transition zone is near f = 0, or near f = fs/2

SINEINT

Numerical Sine Integral.

Used by FIRLS in the Signal Processing Toolbox.

See also SININT in the Symbolic Toolbox.

VRATIO

Utility function for use with ELLIP.

VRATIO is a function used to calculate the poles of an elliptic filter. It finds a u so sn(u)/cn(u) = 1/epsilon, with parameter mp.

MATLAB Signal Processing Toolbox

35

Suggest Documents