| Filter Design Toolbox | ![]() |
Detect limit cycles in a quantized filter
Syntax
limitcycle(hq) limitcycle(hq, ntrials, inputlength, stopcriterion, displaytype) [limitcycletype, zi, stateperiod, statesequence,... overflowsperstep, trial, section] = limitcycle(hq, ...)
Description
limitcycle(hq) runs 20 Monte Carlo trials with quantized filter hq. Each trial uses a new set of initial states (determined randomly) and zero input vector of length 100. Monte Carlo processing stops if a zero-input limit cycle is detected in quantized filter hq. At completion, limitcycle returns one of the following strings:
'granular' indicating that a granular overflow occurred
'overflow' indicating that an overflow limitcycle occurred
'none' indicating that no limit cycles were detected during the Monte Carlo trials
limitcycle(hq, ntrials, inputlength, stopcriterion, displaytype) lets you set the following arguments:
ntrials -- the number of monte carlo trials (default is 20).
inputLength -- the length of the zero vector used as input to the filter (default is 100).
stopcriterion -- the criterion for stopping the Monte Carlo trials processing. stopcriterion can be set to 'either' (the default), 'granular', 'overflow', or 'none'. If stopcriterion is:displaytype -- the display type. When displaytype is nonzero, limitcycle displays messages about the progress of the Monte Carlo trials.
[LimitcycleType, Zi, StatePeriod, StateSequence, overflowsperstep, trial, section] = limitcycle(hq,...) also returns
limitcycletype -- one of 'granular' to indicate that a granular overflow occurred; 'overflow' to indicate that an overflow limitcycle occurred; or 'none' to indicate that no limit cycles were detected during the Monte Carlo trials.
zi -- the initial condition that caused the limit cycle.
stateperiod -- an integer indicating the repeat period of the limit cycle (-1 if the filter converged and the last state is zero, 0 if the last state is not zero and no limit cycle was detected).
statesequence -- a matrix containing the sequence of states at every time step (one matrix column per time step). The final conditions are in the last column of statesequence zf = statesequence(:,end). The initial conditions of the section are in the first column of statesequence zi = statesequence(:,1).
overflowsperstep -- a cell array that contains one vector of integers for each section of the filter that indicates the total number of overflows that occurred during each time step. The overflows from the kth-section are found in overflowsperstep{k}.
trial -- the number of the trial on which Monte Carlo processing stopped.
section -- the number of the section in which the limitcycle was detected.
Only the parameters of the last limit cycle are returned. If Monte Carlo processing does not detect any limit cycles, the parameters of the last Monte Carlo trial are returned.
Examples
In this example, there is a region of initial conditions in which no limit cycles occur, and a region where they do. If no limit cycles are detected before the Monte Carlo trials are over, the state sequence spirals to zero. When a limit cycle is found, the states do not end at zero. Each time you run this example, it uses a different sequence of random initial conditions, so the plot you get may differ from the one displayed in the following figure.
a = [-1 -1; 0.5 0]; b = [0; 1]; c = [1 0]; d = 0; hq = qfilt('statespace',{a,b,c,d},'overflowmode','wrap'); [limitcycletype, zi, stateperiod, statesequence] = limitcycle(hq); plot(statesequence(1,:), statesequence(2,:),'-o') xlabel('State 1'); ylabel('State 2'); axis([-2 2 -2 2]); axis square; grid title(['Limit cycle type:',limitcycletype])
| length | max | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2010 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |