Main Content

upcoef

Direct reconstruction from 1-D wavelet coefficients

    Description

    upcoef is a one-dimensional wavelet analysis function.

    y = upcoef(o,x,wname) returns the 1-step reconstructed coefficients of type o of the vector x using the wavelet specified by wname.

    y = upcoef(o,x,LoR,HiR) uses the specified lowpass and highpass reconstruction filters LoR and HiR, respectively.

    example

    y = upcoef(o,x,wname,n) returns the n-step reconstructed coefficients.

    y = upcoef(o,x,LoR,HiR,n) uses the specified lowpass and highpass reconstruction filters LoR and HiR, respectively.

    y = upcoef(o,x,wname,n,l) returns the length-l central portion of the n-step reconstruction.

    y = upcoef(o,x,LoR,HiR,n,l) uses the specified lowpass and highpass reconstruction filters LoR and HiR, respectively.

    Examples

    collapse all

    Save the current extension mode, then set the extension mode to zero-padding.

    origMode = dwtmode('status','nodisp');
    dwtmode('zpd','nodisp')

    Reconstruct approximation signals, obtained from a single coefficient at levels 1 to 6. Use the db6 wavelet.

    cfs = 1;
    essup = 10; % Essential support of the scaling filter db6. 
    
    for i=1:6 
        % Reconstruct at the top level an approximation 
        % which is equal to zero except at level i where only 
        % one coefficient is equal to 1. 
        rec = upcoef("a",cfs,"db6",i);
    
        % essup is the essential support of the 
        % reconstructed signal.
        % rec(j) is very small when j is ≥ essup. 
        subplot(6,1,i)
        plot(rec(1:essup))
        xlim([1 325])
        if i<3
            ylim([-1 1])
        elseif i<5
            ylim([-0.5 0.5])
        else
            ylim([-0.2 0.2])
        end
        essup = essup*2; 
    end 
    subplot(6,1,1) 
    title(["Approximation Signals Obtained From a Single " ...
        "Coefficient at Levels 1 to 6"])

    The same can be done for details. Reconstruct details signals, obtained from a single coefficient at levels 1 to 6. Use the db6 wavelet.

    cfs = [1]; 
    mi = 12; ma = 30;   % Essential support of 
                        % the wavelet filter db6. 
                        
    rec = upcoef("d",cfs,"db6",1); 
    figure
    subplot(6,1,1)
    plot(rec(3:12))
    axis tight
    ylim([-1 1])
    for i=2:6 
        % Reconstruct at top level a single detail 
        % coefficient at level i. 
        rec = upcoef("d",cfs,"db6",i);
        subplot(6,1,i)
        plot(rec(mi*2^(i-2):ma*2^(i-2)))
        axis tight
        if i<3
            ylim([-1 1])
        elseif i<5
            ylim([-0.5 0.5])
        else
            ylim([-0.2 0.2])
        end
    end 
    subplot(6,1,1) 
    title(["Detail Signals Obtained From a Single " ... 
        "Coefficient at Levels 1 to 6"])

    Restore the extension mode to the original setting.

    dwtmode(origMode,'nodisp')

    Input Arguments

    collapse all

    Type of reconstructed coefficients, specified as "a" or "d", for approximation or details coefficients, respectively.

    Data Types: string

    Signal, specified as a vector.

    Data Types: double

    Wavelet, specified as a character vector or string scalar. The wavelet must be recognized by wavemngr. See wfilters for the wavelets available in each family.

    Data Types: char | string

    Number of reconstruction steps, specified as a positive integer.

    Data Types: double

    Length of central portion of reconstruction to return, specified as a nonnegative integer. If l = 0, upcoef returns the entire reconstruction.

    Data Types: double

    Wavelet reconstruction filters, specified as a pair of even-length real-valued vectors. LoR is the lowpass reconstruction filter, and HiR is the highpass reconstruction filter. The lengths of LoR and HiR must be equal. See wfilters for additional information.

    Data Types: double

    Output Arguments

    collapse all

    Reconstruction coefficients of x, returned as a vector.

    Data Types: double

    Algorithms

    upcoef is equivalent to an n-time repeated use of the inverse wavelet transform.

    Version History

    Introduced before R2006a

    See Also