Add basic code
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
function y = sft_thd(x, thd)
|
||||
|
||||
if isequal(size(x), size(thd))
|
||||
|
||||
tmp = abs(x);
|
||||
y = x;
|
||||
y(tmp <= thd) = 0;
|
||||
y(tmp > thd) = (tmp(tmp > thd) - thd(tmp > thd)) .* x(tmp > thd) ./ tmp(tmp > thd);
|
||||
|
||||
else
|
||||
|
||||
tmp = abs(x);
|
||||
y = x;
|
||||
y(tmp <= thd) = 0;
|
||||
y(tmp > thd) = (tmp(tmp > thd) - thd) .* x(tmp > thd) ./ tmp(tmp > thd);
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user