This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

measure

Measure frequency response characteristics of filter System object

Syntax

measure(sysobj)
M = measure(sysobj)
M = measure(sysobj,'Arithmetic',arithType)
M = measure(sysobj,'freqspec', freqspecvalue)

Description

example

measure(sysobj) displays measurements of various quantities from the frequency response of the filter System object™, sysobj. Measurements include the actual passband ripple, the minimum stopband attenuation, the frequency point at which the filter's gain is 3 dB below the nominal passband gain, etc. You must construct sysobj using fdesign and design with the name-value pair argument 'SystemObject', true. You can optionally specify additional options by one or more Name,Value pair arguments.

M = measure(sysobj) returns the measurements, M, such that the measurements can be queried programmatically. For example, to query the 3 dB point, type M.F3dB. Type get(M) to see the full list of properties that can be queried. Note that different filter responses generate different measurements.

M = measure(sysobj,'Arithmetic',arithType) analyzes the filter System object, sysobj, based on the arithmetic specified in the arithType input. arithType can be set to one of 'double', 'single', or 'fixed'. When the arithmetic input is not specified and the filter System object is in an unlocked state, the analysis tool assumes a double precision filter.

M = measure(sysobj,'freqspec', freqspecvalue) passes the frequency value as an input to measure in order to determine the corresponding magnitude measurements. For designs that do not specify some of the frequency constraints, you can determine the corresponding magnitude measurements using this option.

In the following example, the passband edge, passband ripple, and the transition width of the IIR filter are unknown.

 designLowpass = fdesign.lowpass('N,F3dB,Ast',8,0.5,80);
 chebFilter = design(designLowpass,'cheby2');
 measure(chebFilter)
Sample Rate      : N/A (normalized frequency)
Passband Edge    : Unknown                   
3-dB Point       : 0.5                       
6-dB Point       : 0.51823                   
Stopband Edge    : 0.68727                   
Passband Ripple  : Unknown                   
Stopband Atten.  : 79.9994 dB                
Transition Width : Unknown        
Specify the passband edge to be 0.4, and measure the passband ripple and the transition width of this filter.
 measure(chebFilter,'Fpass',0.4)
Sample Rate      : N/A (normalized frequency)
Passband Edge    : 0.4                       
3-dB Point       : 0.5                       
6-dB Point       : 0.51823                   
Stopband Edge    : 0.68727                   
Passband Ripple  : 0.013644 dB               
Stopband Atten.  : 79.9994 dB                
Transition Width : 0.28727   

Examples

collapse all

Create a lowpass filter and check whether the actual filter meets the specifications. For this case, use normalized frequency for Fs, the default setting.

desigLowpass = fdesign.lowpass('Fp,Fst,Ap,Ast',0.45,0.55,0.1,80)
desigLowpass = 
  lowpass with properties:

               Response: 'Lowpass'
          Specification: 'Fp,Fst,Ap,Ast'
            Description: {4x1 cell}
    NormalizedFrequency: 1
                  Fpass: 0.4500
                  Fstop: 0.5500
                  Apass: 0.1000
                  Astop: 80

designmethods(desigLowpass,'SystemObject',true)
Design Methods that support System objects for class fdesign.lowpass (Fp,Fst,Ap,Ast):


butter
cheby1
cheby2
ellip
equiripple
ifir
kaiserwin
multistage

Use the default equiripple design method.

equiFilter = design(desigLowpass,'SystemObject',true)
equiFilter = 
  dsp.FIRFilter with properties:

            Structure: 'Direct form'
      NumeratorSource: 'Property'
            Numerator: [1x70 double]
    InitialConditions: 0

  Show all properties

Measure the specifications of the designed lowpass filter.

measure(equiFilter)
ans = 
Sample Rate      : N/A (normalized frequency)
Passband Edge    : 0.45                      
3-dB Point       : 0.47798                   
6-dB Point       : 0.48913                   
Stopband Edge    : 0.55                      
Passband Ripple  : 0.095021 dB               
Stopband Atten.  : 80.1164 dB                
Transition Width : 0.1                       
 

Stopband Edge, Passband Edge, Passband Ripple, and Stopband Atten. all meet the specifications.

Now, using Fs in linear frequency, create a bandpass filter, and measure the magnitude response characteristics.

designBandpass = fdesign.bandpass
designBandpass = 
  bandpass with properties:

               Response: 'Bandpass'
          Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
            Description: {7x1 cell}
    NormalizedFrequency: 1
                 Fstop1: 0.3500
                 Fpass1: 0.4500
                 Fpass2: 0.5500
                 Fstop2: 0.6500
                 Astop1: 60
                  Apass: 1
                 Astop2: 60

Convert to Linear Frequency.

normalizefreq(designBandpass,false,1.5e3)
bpFilter = design(designBandpass,'cheby2','SystemObject',true);

Measure the specifications of the designed bandpass filter.

measure(bpFilter)
ans = 
Sample Rate             : 1.5 kHz    
First Stopband Edge     : 262.5 Hz   
First 6-dB Point        : 319.9585 Hz
First 3-dB Point        : 324.9744 Hz
First Passband Edge     : 337.5 Hz   
Second Passband Edge    : 412.5 Hz   
Second 3-dB Point       : 425.0256 Hz
Second 6-dB Point       : 430.0415 Hz
Second Stopband Edge    : 487.5 Hz   
First Stopband Atten.   : 60 dB      
Passband Ripple         : 0.17985 dB 
Second Stopband Atten.  : 60 dB      
First Transition Width  : 75 Hz      
Second Transition Width : 75 Hz      
 

Measure the frequency response characteristics of a highpass filter. Create a dsp.HighpassFilter System object with default properties. Measure the frequency response characteristics of the filter.

HPF = dsp.HighpassFilter
HPF = 
  dsp.HighpassFilter with properties:

               FilterType: 'FIR'
    DesignForMinimumOrder: true
        StopbandFrequency: 8000
        PassbandFrequency: 12000
      StopbandAttenuation: 80
           PassbandRipple: 0.1000
               SampleRate: 44100

  Show all properties

HPFMeas = measure(HPF)
HPFMeas = 
Sample Rate      : 44.1 kHz   
Stopband Edge    : 8 kHz      
6-dB Point       : 10.418 kHz 
3-dB Point       : 10.8594 kHz
Passband Edge    : 12 kHz     
Stopband Atten.  : 81.8558 dB 
Passband Ripple  : 0.08066 dB 
Transition Width : 4 kHz      
 

Measure the frequency response characteristics of a lowpass filter. Create a dsp.LowpassFilter System object with default properties. Measure the frequency response characteristics of the filter.

LPF = dsp.LowpassFilter
LPF = 
  dsp.LowpassFilter with properties:

               FilterType: 'FIR'
    DesignForMinimumOrder: true
        PassbandFrequency: 8000
        StopbandFrequency: 12000
           PassbandRipple: 0.1000
      StopbandAttenuation: 80
               SampleRate: 44100

  Show all properties

LPFMeas = measure(LPF)
LPFMeas = 
Sample Rate      : 44.1 kHz  
Passband Edge    : 8 kHz     
3-dB Point       : 9.1311 kHz
6-dB Point       : 9.5723 kHz
Stopband Edge    : 12 kHz    
Passband Ripple  : 0.08289 dB
Stopband Atten.  : 81.6141 dB
Transition Width : 4 kHz     
 

Input Arguments

collapse all

Input filter, specified as as one of the following filter System objects:

When sysobj is a generic discrete-time filter, for example, a single-rate lowpass filter, measure(sysobj) returns the following filter specifications.

Lowpass Filter Specification

Description

Sample Rate

Filter sampling frequency.

Passband Edge

Location of the edge of the passband as it enters transition.

3-dB Point

Location of the –3 dB point on the response curve.

6-dB Point

Location of the –6 dB point on the response curve.

Stopband Edge

Location of the edge of the transition band as it enters the stopband.

Passband Ripple

Ripple in the passband.

Stopband Atten

Attenuation in the stopband.

Transition Width

Width of the transition between the passband and stopband, in normalized frequency or absolute frequency. Measured between Fpass and Fstop.

When sysobj is a bandstop filter, measure(sysobj) returns these specifications for the resulting bandstop filter.

Bandstop Filter Specification

Description

Sample Rate

Filter sampling frequency.

First Passband Edge

Location of the edge of the first passband.

First 3-dB Point

Location of the edge of the –3 dB point in the first transition band.

First 6-dB Point

Location of the edge of the –6 dB point in the first transition band.

First Stopband Edge

Location of the start of the stopband.

Second Stopband Edge

Location of the end of the stopband.

Second 6-dB Point

Location of the edge of the –6 dB point in the second transition band.

Second 3-dB Point

Location of the edge of the –3 dB point in the second transition band.

Second Passband Edge

Location of the start of the second passband.

First Passband Ripple

Ripple in the first passband.

Stopband Atten

Attenuation in the stopband.

Second Passband Ripple

Ripple in the second passband.

First Transition Width

Width of the first transition region. Measured between the –3 and –6 dB points.

Second Transition Width

Width of the second transition region. Measured between the –6 and –3 dB points.

When sysobj is an interpolator, decimator, or a rate converter, measure(sysobj) returns these specifications for the resulting filter.

Interpolator Filter Specification

Description

Sample Rate

Filter sampling frequency.

First Passband Edge

Location of the edge of the passband as it enters transition.

3-dB Point

Location of the –3 dB point on the response curve.

6-dB Point

Location of the –6 dB point on the response curve.

Stopband Edge

Location of the edge of the transition band as it enters the stopband.

Passband Ripple

Ripple in the passband.

Stopband Atten

Attenuation in the stopband.

Transition Width

Width of the transition between the passband and stopband, in normalized frequency or absolute frequency. Measured between Fpass and Fstop.

Specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double- or single-precision analysis. When you specify 'fixed' , the arithmetic changes depending on the setting of the CoefficientDataType property and whether the System object is locked or unlocked.

Details for Fixed-Point Arithmetic

System Object StateCoefficient Data TypeRule
Unlocked'Same as input'The function assumes that the coefficient data type is signed, 16 bit, and autoscaled. The function performs fixed-point analysis based on this assumption.
Unlocked'Custom'The function performs fixed-point analysis based on the setting of the CustomCoefficientsDataType property.
Locked'Same as input'When the input data type is 'double' or 'fixed', the function assumes that the coefficient data type is signed, 16-bit, and autoscaled. The function performs fixed-point analysis based on this assumption.
Locked'Custom'The function performs fixed-point analysis based on the setting of the CustomCoefficientsDataType property.

When you do not specify the arithmetic for non-CIC structures, the function uses double-precision arithmetic if the filter System object is in an unlocked state. If the System object is locked, the function performs analysis based on the locked input data type. CIC structures only support fixed-point arithmetic.

Frequency specifications are input to measure in order to determine the corresponding magnitude measurements. For designs that do not specify some of the frequency constraints, you can determine the corresponding magnitude measurements using this option.

In the following example, the passband edge, passband ripple, and the transition width of the IIR filter are unknown.

 designLowpass = fdesign.lowpass('N,F3dB,Ast',8,0.5,80);
 chebFilter = design(designLowpass,'cheby2');
 measure(chebFilter)
Sample Rate      : N/A (normalized frequency)
Passband Edge    : Unknown                   
3-dB Point       : 0.5                       
6-dB Point       : 0.51823                   
Stopband Edge    : 0.68727                   
Passband Ripple  : Unknown                   
Stopband Atten.  : 79.9994 dB                
Transition Width : Unknown        
Specify the passband edge to be 0.4, and measure the passband ripple and the transition width of this filter.
 measure(chebFilter,'Fpass',0.4)
Sample Rate      : N/A (normalized frequency)
Passband Edge    : 0.4                       
3-dB Point       : 0.5                       
6-dB Point       : 0.51823                   
Stopband Edge    : 0.68727                   
Passband Ripple  : 0.013644 dB               
Stopband Atten.  : 79.9994 dB                
Transition Width : 0.28727   

Output Arguments

collapse all

Measurements object, returned as an fdesign object. Here is a list of supported input filter objects with their corresponding fdesign measurements objects:

The measurements, M can be queried programmatically. For example, to query the 3 dB point, type M.F3dB. Type get(M) to see the full list of properties that can be queried. Note that different filter responses generate different measurements.

Tips

For designs that do not specify some of the frequency constraints, the function may not be able to determine corresponding magnitude measurements. In these cases, a constraint can be passed in to measure to determine such measurements. For example:

f = fdesign.lowpass('N,F3dB,Ast',8,0.5,80);
H = design(f,'cheby2','SystemObject',true);
measure(H)
returns values of Unknown for the passband edge, passband ripple, and transition width measurements, but

f = fdesign.lowpass('N,F3dB,Ast',8,0.5,80);
H = design(f,'cheby2','SystemObject',true);
measure(H,'Fpass',0.4)
provides measurements for all returned values.

See Also

Functions

Introduced in R2011a