Main Content

lp2filters

Laurent polynomials to filters

    Description

    example

    [LoD,HiD,LoR,HiR] = lp2filters(LoDz,HiDz,LoRz,HiRz) returns the filters associated with the Laurent polynomials LoDz, HiDz, LoRz, and HiRz. The polynomials are associated to the filters as follows:

    • LoDzZ(LoD)

    • HiDzZ(HiD)

    • LoRzZ(LoR)

    • HiDzZ(HiD)

    where Z(.) is the z-transform of the corresponding filter.

    [LoD,HiD,LoR,HiR] = lp2filters(___,signFLAG) changes the signs of the two highpass filters, HiD and HiR, when signFLAG is equal to 1. The default value for signFLAG is 0.

    Examples

    collapse all

    Obtain the filters associated with the orthogonal db4 wavelet.

    wv = "db4";
    [LoD,HiD,LoR,HiR] = wfilters(wv);

    Use the filters2lp function to obtain Laurent polynomials associated with the lowpass filter.

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

    Use the lp2filters function to obtain a new set of filters. Confirm the first and second set of filters are identical.

    [LoD2,HiD2,LoR2,HiR2] = lp2filters(LoDz,HiDz,LoRz,HiRz);
    max(abs(LoD-LoD2))
    ans = 0
    
    max(abs(HiD-HiD2))
    ans = 0
    
    max(abs(LoR-LoR2))
    ans = 0
    
    max(abs(HiR-HiR2))
    ans = 0
    

    Confirm that for orthogonal wavelets, the reflection of LoDz is equal to LoRz.

    areEqual = (reflect(LoDz)==LoRz)
    areEqual = logical
       1
    
    

    Input Arguments

    collapse all

    Laurent polynomial, specified as a laurentPolynomial object.

    Laurent polynomial, specified as a laurentPolynomial object.

    Laurent polynomial, specified as a laurentPolynomial object.

    Laurent polynomial, specified as a laurentPolynomial object.

    Change sign flag, specified as 0 or 1. If signFLAG is equal to 1, the signs of the highpass filters HiD and HiR change.

    Output Arguments

    collapse all

    Lowpass filter associated with the Laurent polynomial LoDz, returned as a real-valued vector.

    Data Types: double

    Highpass filter associated with the Laurent polynomial HiDz, returned as a real-valued vector.

    Data Types: double

    Lowpass filter associated with the Laurent polynomial LoRz, returned as a real-valued vector.

    Data Types: double

    Highpass filter associated with the Laurent polynomial HiRz, returned as a real-valued vector.

    Data Types: double

    Extended Capabilities

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

    Version History

    Introduced in R2021b