nstates - Number of filter states
Syntax
n = nstates(hd)
n = nstates(hm)
Description
Discrete-Time Filters
n = nstates(hd) returns
the number of states n in the discrete-time filter hd.
The number of states depends on the filter structure and the coefficients.
Multirate Filters
n = nstates(hm) returns
the number of states n in the multirate filter hm.
The number of states depends on the filter structure and the coefficients.
Examples
Check the number of states for two different filters, one a
direct form FIR filter, the other a multirate filter.
h=firls(30,[0 .1 .2 .5]*2,[1 1 0 0])
hd=dfilt.dffir(h)
hd =
FilterStructure: 'Direct-Form FIR'
Arithmetic: 'double'
Numerator: [1x31 double]
PersistentMemory: 'on'
States: [30x1 double]
n=nstates(hd)
n =
30
hm=mfilt.firfracdecim(2,3)
hm =
FilterStructure: [1x46 char]
Numerator: [1x72 double]
RateChangeFactors: [2 3]
PersistentMemory: false
States: [35x1 double]
n=nstates(hm)
n =
35See Also
mfilt
 | normalizefreq | | order |  |
How much time do you spend on testing to ensure implementation meets system-level requirements?
Learn more