gusucode.com > matlab编程小波变换进行图像去噪处理,包括各种软硬阈值的选取函数 > code/plotthrf.m
%画出各阈值函数图 clear all clc; x=linspace(-1,1,201); t=0.3; yhard=thrfunc(x,'upsoft',t); figure,subplot(221),plot(x,yhard,'k'),xlabel('改进软阈值函数') hold on plot([-1 1],[0 0],':') hold on plot([0 0],[-1 1],':') hold on plot([-1 1],[-1 1],':'),axis square yhssoft=thrfunc(x,'hfsmsoft',t); subplot(223),plot(x,yhssoft,'k'),xlabel('改进阈值函数一') hold on plot([-1 1],[0 0],':') hold on plot([0 0],[-1 1],':') hold on plot([-1 1],[-1 1],':'),axis square ysoft=thrfunc(5*x,'soft',5*t); yhsoft=thrfunc(5*x,'newthr1',5*t); subplot(222),plot(x,yhsoft/5,'k',x,ysoft/5,':'),xlabel('新阈值函数') hold on plot([-1 1],[0 0],':') hold on plot([0 0],[-1 1],':') hold on plot([-1 1],[-1 1],':'),axis square yssoft=thrfunc(5*x,'newthr2',5*t); subplot(224),plot(x,yssoft/5,'k',x,ysoft/5,':'),xlabel('改进阈值函数二') hold on plot([-1 1],[0 0],':') hold on plot([0 0],[-1 1],':') hold on plot([-1 1],[-1 1],':'),axis square