Main Content

getFilters

Get handles to digital down converter or digital up converter filter cascade objects

Description

S = getFilters(Conv) returns a structure, S, that contains copies of the filter System objects and the CIC normalization factor that form a digital down converter or digital up converter, Conv. The CIC normalization factor equals the inverse of the CIC filter gain. This gain can include a correction factor to ensure that the cascade response meets the ripple specifications.

The converter usually implements the conversion using three filter stages. Sometimes, one of the stages is bypassed and that filter stage is returned as an empty field.

S = getFilters(Conv,'Arithmetic',arithType) specifies the arithmetic type of the filter stages. Set arithType to 'double', 'single', or 'Fixed-point'. When the Conv object is in an unlocked state, you must specify the arithmetic input. When the Conv object is in a locked state, it ignores the arithmetic input argument.

example

Examples

collapse all

Get handles to decimation filter objects of the dsp.DigitalDownConverter System object™.

Create a dsp.DigitalDownConverter System object with the default settings.

dwnConv = dsp.DigitalDownConverter
dwnConv = 
  dsp.DigitalDownConverter with properties:

           DecimationFactor: 100
         MinimumOrderDesign: true
                  Bandwidth: 200000
    StopbandFrequencySource: 'Auto'
             PassbandRipple: 0.1000
        StopbandAttenuation: 60
                 Oscillator: 'Sine wave'
            CenterFrequency: 14000000
        NormalizedFrequency: false
                 SampleRate: 30000000

  Use get to show all properties

Use the getFilters function to obtain the filter System objects and the CIC normalization factor that form the decimation filter cascade.

To use the getFilters function on an unlocked System object, you must specify the filter arithmetic through the 'Arithmetic' input of the getFilters function.

S = getFilters(dwnConv,'Arithmetic','Fixed-point')
S = struct with fields:
              CICDecimator: [1x1 dsp.CICDecimator]
    CICNormalizationFactor: 2.5600e-06
         SecondFilterStage: [1x1 dsp.FIRDecimator]
          ThirdFilterStage: [1x1 dsp.FIRDecimator]

Alternatively, you can lock the System object by passing a valid input to the object algorithm. In this case, you can use the getFilters function without specifying the filter arithmetic.

Get handles to decimation filter objects of the dsp.DigitalUpConverter System object™.

Create a dsp.DigitalUpConverter System object with the default settings.

upConv = dsp.DigitalUpConverter
upConv = 
  dsp.DigitalUpConverter with properties:

        InterpolationFactor: 100
         MinimumOrderDesign: true
                  Bandwidth: 200000
    StopbandFrequencySource: 'Auto'
             PassbandRipple: 0.1000
        StopbandAttenuation: 60
                 Oscillator: 'Sine wave'
            CenterFrequency: 14000000
        NormalizedFrequency: false
                 SampleRate: 300000

  Use get to show all properties

Use the getFilters function to obtain the filter System objects and the CIC normalization factor that form the decimation filter cascade.

To use the getFilters function on an unlocked System object, you must specify the filter arithmetic through the 'Arithmetic' input of the getFilters function.

S = getFilters(upConv,'Arithmetic','Fixed-point')
S = struct with fields:
          FirstFilterStage: [1x1 dsp.FIRInterpolator]
    CICNormalizationFactor: 6.4000e-05
         SecondFilterStage: [1x1 dsp.FIRInterpolator]
           CICInterpolator: [1x1 dsp.CICInterpolator]

The first filter field is empty when the object bypasses the first filter stage.

Alternatively, you can lock the System object by passing a valid input to the object algorithm. In this case, you can use the getFilters function without specifying the filter arithmetic.

Input Arguments

collapse all

Digital down converter or digital up converter, specified as a dsp.DigitalDownConverter or dsp.DigitalUpConverter System object™.

When the Conv object is in an unlocked state, you must specify the arithmetic type. When the Conv object is in a locked state, it ignores the arithmetic input argument.

When Conv is in an unlocked state, and you specify the arithmetic type as 'fixed-point', the getFilters function returns filter System objects. The custom coefficient data type properties of these System objects are set to the values that the dsp.DigitalDownConverter or dsp.DigitalUpConverter objects use to process data when you call the object. All other fixed-point properties are set to their default values.

When Conv is in a locked state, and the input to the object algorithm is of a fixed-point data type, the getFilters function returns filter System objects. All fixed-point properties of these System objects are set to the exact values that the dsp.DigitalDownConverter or dsp.DigitalUpConverter objects use to process the data.

Output Arguments

collapse all

The output is a structure, S, containing three filter object handles and the CICNormalizationFactor. For a digital down converter object, the structure contains these fields:

  • CICDecimator –– Handle to the dsp.CICDecimator object.

  • CICNormalizationFactor –– Inverse of the CIC filter gain.

  • SecondFilterStage –– Handle to the CIC compensation filter stage.

  • ThirdFilterStage –– Handle to the third filter stage. This field is empty if the third filter stage has been bypassed.

For a digital up converter object, the structure contains these fields:

  • FirstFilterStage –– Handle to the first filter stage. This field is empty if the first filter stage has been bypassed.

  • CICNormalizationFactor –– Inverse of the CIC filter gain.

  • SecondFilterStage –– Handle to the CIC compensation filter stage.

  • CICInterpolator –– Handle to the dsp.CICInterpolator object.

Version History

Introduced in R2012a