Main Content

mswcmptp

Multisignal 1-D compression thresholds and performances

    Description

    [thr_val,l2_perf,n0_perf] = mswcmptp(dec,meth) returns the following output after compressing the wavelet decomposition structure dec using the meth method:

    • thr_val — Thresholds applied to the wavelet coefficients

    • l2_perf — Percentage of energy (L2-norm) preserved

    • n0_perf — Percentage of zeros obtained after compression

    example

    [thr_val,l2_perf,n0_perf] = mswcmptp(dec,meth,param) uses the parameter param associated with meth, if required.

    [___] = mswcmptp(___,s_or_h) applies the threshold rule specified by s_or_h.

    [___] = mswcmptp(___,s_or_h,keepapp) either keeps the approximation coefficients (true) or does not (false).

    [___] = mswcmptp(___,s_or_h,keepapp,idxsig) is a vector, which contains the indices of the initial signals.

    Examples

    collapse all

    Load the 23 channel EEG data Espiga3 [4]. The channels are arranged column-wise. The data is sampled at 200 Hz.

    load Espiga3

    Perform a decomposition at level 2 using the db2 wavelet.

    dec = mdwtdec("c",Espiga3,2,"db2");

    Compute compression thresholds and exact performances obtained after a compression using the method "N0_perf" and requiring a percentage of zeros near 80% for the wavelet coefficients. Plot the thresholds for each channel.

    [thr_val,l2_perf,n0_perf] = mswcmptp(dec,"N0_perf",80); %#ok<*ASGLU>
    stem(thr_val)
    grid on
    title("Thresholds: Percentage of Zeros Near 80%")
    xlabel("Channel")

    Figure contains an axes object. The axes object with title Thresholds: Percentage of Zeros Near 80%, xlabel Channel contains an object of type stem.

    Make the same plot but with the requirement set to 95%.

    [thr_val,l2_perf,n0_perf] = mswcmptp(dec,"N0_perf",95);
    stem(thr_val)
    grid on
    title("Thresholds: Percentage of Zeros Near 95%")
    xlabel("Channel")

    Figure contains an axes object. The axes object with title Thresholds: Percentage of Zeros Near 95%, xlabel Channel contains an object of type stem.

    Input Arguments

    collapse all

    Wavelet decomposition of a multisignal, specified as a structure. dec is the output of mdwtdec.

    Compression method, specified as one of the values listed here. For methods that use an associated parameter, the range of allowable param values is shown.

    For methods listed in the following table, param is a sparsity parameter, and it should be specified such that 1 ≤ param ≤ 10. For the "scarce" method no control is done.

    methDescription
    "scarce"Scarce, param (any number)
    "scarcehi"Scarce high, 2.5 ≤ param ≤ 10
    "scarceme"Scarce medium, 1.5 ≤ param ≤ 2.5
    "scarcelo"Scarce low, 1 ≤ param ≤ 2
    "rem_n0"Remove near 0
    "bal_sn"Balance sparsity-norm
    "sqrtbal_sn"Balance sparsity-norm (sqrt)

    For methods listed in the following table, param is a real number, which represents the required performance: 0 ≤ param ≤ 100.

    methDescription
    "L2_perf"Energy ratio
    "N0_perf"Zero coefficients ratio

    To apply a global threshold for compression, specify the method "glb_thr" and any positive real number param.

    To apply a manual compression method, specify the method "man_thr", and specify param as an NbSig-by-NbLev or an NbSig-by-(NbLev+1) real-valued matrix, where NbSig is the number of signals, and NbLev the number of levels of decomposition.

    • param(i,j) is the threshold for the detail coefficients of level j for the ith signal (1 ≤ jNbLev).

    • param(i,NbLev+1) is the threshold for the approximation coefficients for the ith signal (if keepapp is 0).

    Parameter associated with the compression method meth, specified as a real number or a real-valued matrix. For additional information, see meth.

    Type of thresholding to perform, specified as either of the following:

    • "s" — Soft thresholding

    • "h" — Hard thresholding

    Approximation coefficients option specified as a numeric or logical 1 (true) or 0 (false):

    • 0 — Do not keep the approximation coefficients

    • 1 — Keep the approximation coefficients

    Indices of initial signals, specified as a vector of positive integers or "all".

    Output Arguments

    collapse all

    Threshold values used to compress the wavelet coefficients, returned as a vector or matrix.

    For the ith signal, thr_val(i) is the threshold applied to the wavelet coefficients. For a level-dependent method, thr_val(i,j) is the threshold applied to the detail coefficients at levelj.

    Percentage of energy (L2-norm) preserved after compression. l2_perf(i) is the percentage for the ith signal.

    Percentage of zeros obtained after compression. n0_perf(i) is the percentage for the ith signal.

    References

    [1] Daubechies, I. Ten Lectures on Wavelets, CBMS-NSF Regional Conference Series in Applied Mathematics. Philadelphia, PA: SIAM Ed, 1992.

    [2] Mallat, S.G. “A Theory for Multiresolution Signal Decomposition: The Wavelet Representation.” IEEE Transactions on Pattern Analysis and Machine Intelligence 11, no. 7 (July 1989): 674–93. https://doi.org/10.1109/34.192463.

    [3] Meyer, Y. Wavelets and Operators. Translated by D. H. Salinger. Cambridge, UK: Cambridge University Press, 1995.

    [4] Mesa, Hector. “Adapted Wavelets for Pattern Detection.” In Progress in Pattern Recognition, Image Analysis and Applications, edited by Alberto Sanfeliu and Manuel Lazo Cortés, 3773:933–44. Berlin, Heidelberg: Springer Berlin Heidelberg, 2005. https://doi.org/10.1007/11578079_96.

    Version History

    Introduced in R2007a