Products & Services Solutions Academia Support User Community Company

Learn more about Filter Design Toolbox   

isreal - Determine whether filter uses real coefficients

Syntax

isreal(hd)

Description

isreal(hd) returns 1 (or true) if all filter coefficients for the filter hd are real, and returns 0 (or false) otherwise.

isreal(hd) returns 1 if all filter coefficients in filter hd have zero imaginary part. Otherwise, isreal(hd) returns a 0 indicating that the filter is complex. Complex filters have one or more coefficients with nonzero imaginary parts.

Examples

To demonstrate the isreal test, this example creates a double-precision filter and fixed-point filter, and tests the coefficients of the fixed-point filter to see if they are strictly real.

d=fdesign.lowpass('n,fp,ap,ast',5,0.4,0.5,20);
hd=design(d,'ellip')

hd =
 
 FilterStructure: 'Direct-Form II, Second-Order Sections'  
      Arithmetic: 'double' 
       sosMatrix: [3x6 double]
ScaleValues: [0.362583368859661;0.918321077151039;
              0.496533475964919;1]
PersistentMemory: false   

% Use d to design the fixed-point filter.
hq=design(d,'ellip');  
% Convert to fixed-point arithmetic.
hq.arithmetic='fixed'; 
isreal(hq)

ans =

     1

See Also

isfir, islinphase, ismaxphase, isminphase, issos, isstable, isallpass

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS