Main Content

filters2lp

Filters to Laurent polynomials

Since R2021b

    Description

    [LoDz,HiDz] = filters2lp(Lo) returns the Laurent polynomials LoDz and HiDz that correspond to the z-transform of the lowpass and highpass analysis filters, respectively, associated with the lowpass filter specified by Lo.

    example

    [___,LoRz,HiRz] = filters2lp(Lo) also returns the Laurent polynomials LoRz and HiRz that correspond to the z-transform of the lowpass and highpass synthesis filters, respectively. Use this syntax with any of the output arguments in the previous syntax.

    [___,PRCond,AACond] = filters2lp(Lo) also returns the perfect reconstruction condition PRCond and the anti-aliasing condition AACond.

    [___] = filters2lp(Lo,PmaxLoRz) sets the maximum order of LoRz.

    [___] = filters2lp(Lo,PmaxLoRz,AddPOW) sets the maximum order of the Laurent polynomial HiRz.

    Examples

    collapse all

    Obtain the lowpass filters associated with the biorthogonal bior1.3 wavelet.

    [LoD,~,LoR,~] = wfilters("bior1.3");

    Use filters2lp to obtain the Laurent polynomials associated with the wavelet. Also obtain the perfect reconstruction and anti-aliasing conditions.

    [LoDz,HiDz,LoRz,HiRz,PRC,AAC] = filters2lp({LoR,LoD});

    Verify the perfect reconstruction condition.

    eq(LoRz*LoDz + HiRz*HiDz,PRC)
    ans = logical
       1
    
    

    Verify the anti-aliasing condition. Use the helper function helperMakeLaurentPoly to obtain LoDz(-z), where LoD(z) is the Laurent polynomial LoDz. Use the helper function helperMakeLaurentPoly to obtain HiDz(-z), where HiD(z) is the Laurent polynomial HiDz.

    LoDzm = helperMakeLaurentPoly(LoDz);
    HiDzm = helperMakeLaurentPoly(HiDz);
    eq(LoRz*LoDzm + HiRz*HiDzm,AAC)
    ans = logical
       1
    
    

    Helper Functions

    function polyout = helperMakeLaurentPoly(poly)
    % This function is only intended to support this example.
    % It may change or be removed in a future release.
    
    polyout = poly;
    cflen = length(polyout.Coefficients);
    cmo = polyout.MaxOrder;
    polyneg = (-1).^(mod(cmo,2)+(0:cflen-1));
    polyout.Coefficients = polyout.Coefficients.*polyneg;
    
    end

    Input Arguments

    collapse all

    Wavelet lowpass filter, specified as a cell array. If the wavelet is orthogonal, then Lo is a one-element cell array that corresponds to LoR, the lowpass reconstruction filter. The corresponding highpass filter is HiR = qmf(LoR). For biorthogonal wavelets, Lo is a two-element cell array specified as Lo = {LoR,LoD}. In this case, HiR = qmf(fliplr(LoD)).

    Example: If [LoD,~,LoR,~] = wfilters("bior2.2"), then Lo is specified as Lo = {LoR,LoD}.

    Data Types: double

    Maximum power of the Laurent polynomial LoRz, specified as an integer.

    Example: If [~,~,LoRz,HiRz] = filters2lp(Lo,3), then the maximum power, or order, of the Laurent polynomial LoRz is 3.

    Data Types: double

    Integer to set the maximum order of the Laurent polynomial HiRz. PmaxHiRz, the maximum order of HiRz, is

    PmaxHiRz = PmaxLoRz+length(HiRz.Coefficients)-2+AddPow.

    AddPOW must be an even integer to preserve the perfect reconstruction condition.

    Data Types: double

    Output Arguments

    collapse all

    Laurent polynomial associated with the lowpass analysis filter, returned as a laurentPolynomial object. LoDz is the z-transform of the lowpass analysis filter.

    Laurent polynomial associated with the highpass analysis filter, returned as a laurentPolynomial object. HiDz is the z-transform of the highpass analysis filter.

    Laurent polynomial associated with the lowpass synthesis filter, returned as a laurentPolynomial object. LoRz is the z-transform of the lowpass synthesis filter.

    Laurent polynomial associated with the highpass synthesis filter, returned as a laurentPolynomial object. HiRz is the z-transform of the highpass synthesis filter.

    Perfect reconstruction and anti-aliasing conditions, returned as laurentPolynomial objects. The perfect reconstruction condition PRCond and anti-aliasing condition AACond are:

    • PRCond(z) = LoRz(z) LoDz(z) + HiRz(z) HiDz(z)

    • AACond(z) = LoRz(z) LoDz(-z) + HiRz(z) HiDz(-z)

    The pairs (LoRz, HiRz) and (LoDz, HiDz) are associated with perfect reconstructions filters if and only if:

    • PRCond(z) = 2, and

    • AACond(z) = 0

    If PRCond(z) = 2 zd, a delay is introduced in the reconstruction process.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2021b