Soft or hard thresholding
Y = wthresh(X,SORH,T)
input data (vector or matrix)
soft thresholding
hard thresholding
threshold value
output
doing either hard (if SORH = 'h') or soft (if SORH = 's') thresholding
// 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); | ![]() | ![]() |