denormalize - Undo filter coefficient and gain changes caused by normalize

Syntax

denormalize(hq)

Description

denormalize(hq) reverses the coefficient changes you make when you use normalize with hq. The filter coefficients do not change if you call denormalize(hq) before you use normalize(hq). Calling denormalize more than once on a filter does not change the coefficients after the first denormalize call.

Examples

Make a quantized filter hq and normalize the filter coefficients. After normalizing the coefficients, restore them to their original values by reversing the effects of the normalize function.

d=fdesign.highpass('n,fc',14,0.45)
 
d =
 
               Response: 'Highpass'                         
          Specification: 'N,Fc'                             
            Description: {'Filter Order';'Cutoff Frequency'}
    NormalizedFrequency: true                               
            FilterOrder: 14                                 
                Fcutoff: 0.45                               

hd = butter(d)
 
hd =
 
         FilterStructure: 'Direct-Form II, Second-Order Sections'
              Arithmetic: 'double'                               
               sosMatrix: [7x6 double]                           
             ScaleValues: [8x1 double]                           
        PersistentMemory: false                                  

hd.arithmetic='fixed'
 
hd =
 
         FilterStructure: 'Direct-Form II, Second-Order Sections'
              Arithmetic: 'fixed'
               sosMatrix: [7x6 double]
             ScaleValues: [8x1 double]
        PersistentMemory: false

         CoeffWordLength: 16             
          CoeffAutoScale: true           
                  Signed: true           
                                         
         InputWordLength: 16             
         InputFracLength: 15             
                                         
    StageInputWordLength: 16             
     StageInputAutoScale: true           
                                         
   StageOutputWordLength: 16             
    StageOutputAutoScale: true           
                                         
        OutputWordLength: 16             
              OutputMode: 'AvoidOverflow'
                                         
         StateWordLength: 16             
         StateFracLength: 15             
                                         
             ProductMode: 'FullPrecision'
                                         
               AccumMode: 'KeepMSB'      
         AccumWordLength: 40             
           CastBeforeSum: true           
                                         
               RoundMode: 'convergent'   
            OverflowMode: 'wrap'         
hq=hd;
g=normalize(hq)'

g =

     2     2     2     2     2     2     2

hq.SosMatrix

ans =

    0.5000   -1.0000    0.5000    1.0000   -0.2817    0.8008
    0.5000   -1.0000    0.5000    1.0000   -0.2359    0.5081
    0.5000   -1.0000    0.5000    1.0000   -0.2051    0.3110
    0.5000   -1.0000    0.5000    1.0000   -0.1842    0.1776
    0.5000   -1.0000    0.5000    1.0000   -0.1704    0.0892
    0.5000   -1.0000    0.5000    1.0000   -0.1619    0.0350
    0.5000   -1.0000    0.5000    1.0000   -0.1579    0.0093

denormalize(hq)
hq.SosMatrix

ans =

    1.0000   -2.0000    1.0000    1.0000   -0.2817    0.8008
    1.0000   -2.0000    1.0000    1.0000   -0.2359    0.5081
    1.0000   -2.0000    1.0000    1.0000   -0.2051    0.3110
    1.0000   -2.0000    1.0000    1.0000   -0.1842    0.1776
    1.0000   -2.0000    1.0000    1.0000   -0.1704    0.0892
    1.0000   -2.0000    1.0000    1.0000   -0.1619    0.0350
    1.0000   -2.0000    1.0000    1.0000   -0.1579    0.0093

See Also

normalize

  


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