Main Content

isreal

Verify that discrete-time filter System object is real

Description

example

flag = isreal(sysobj) determines if the filter coefficients are real. If the filter coefficients are real, isreal returns a logical 1. If the filter coefficients are complex, isreal returns a logical 0. Complex filters have one or more coefficients with nonzero imaginary parts.

Examples

collapse all

Create a dsp.SOSFilter System object™. Pass a fixed-point input to the object. Test 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);
sosFilter = design(d,'ellip',SystemObject=true)
sosFilter = 
  dsp.SOSFilter with properties:

            Structure: 'Direct form II'
    CoefficientSource: 'Property'
            Numerator: [3x3 double]
          Denominator: [3x3 double]
       HasScaleValues: true
          ScaleValues: [0.6252 0.5432 0.4861 1]

  Use get to show all properties

IsRealBefore = isreal(sosFilter)
IsRealBefore = logical
   1

Pass a fixed-point input to the object.

fiInput = fi(randn(1000,2),1,32,16);
fiOutput = sosFilter(fiInput);
IsRealAfter = isreal(sosFilter)
IsRealAfter = logical
   1

The isreal function returns a value of 1, indicating that the filter coefficients are real.

Output Arguments

collapse all

Flag to determine whether the filter coefficients are real, returned as a logical scalar. If the filter coefficients are real, isreal returns a logical 1, else it returns a logical 0.

Data Types: logical

Version History

Introduced in R2011a

expand all