This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.


Soft or hard thresholding


Y = wthresh(X,SORH,T)
Y = wthresh(X,'s',T)
Y = wthresh(X,'h',T)


Y = wthresh(X,SORH,T) returns the soft (if SORH = 's') or hard (if SORH = 'h') thresholding of the input vector or matrix X. T is the threshold value.

Y = wthresh(X,'s',T) returns , soft thresholding is wavelet shrinkage ( (x)+ = 0 if x < 0; (x)+ = x, if x ≥ 0 ).

Y = wthresh(X,'h',T) returns , hard thresholding is cruder.


% Generate signal and set threshold. 
y = linspace(-1,1,100); 
thr = 0.4;

% Perform hard thresholding. 
ythard = wthresh(y,'h',thr);

% Perform soft thresholding. 
ytsoft = wthresh(y,'s',thr);

% Using some plotting commands,
% the following figure is generated.

Extended Capabilities

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

See Also

| |

Introduced before R2006a

Was this topic helpful?