Name
wtresh — Soft or hard thresholding
Calling Sequence
Y = wthresh(X,SORH,T)
Parameters
- X
-
: input vector or matrix
- SORH
: (if SORH = 's') - soft thresholding
: (if SORH = 'h') - hard thresholding
- T
-
: threshold value
Description
doing either hard or soft thresholding
Examples
// 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);