本文有很多例子,各位看官自行取用:
%%%% 对一维带噪信号进行处理
clear all;clc ;close all;
load noissin;
figure;
s=noissin(1:1000);
subplot(211);plot(noissin);
title('含噪生原始信号');
[C,L]=wavedec(s,3,'sym2');
a=[1 2 3 ]; %% 尺度向量
p=[97 98 95]; %% 阈值向量
nc=wthcoef('d',C,L,a,p);
sd=waverec(nc,L,'sym2');
subplot(212); plot(sd);title('消噪后的信号')
%%%%%%% 对信号进行不同的阈值处理
clear all;
clc ;
y=linspace(-1,1,100);
thr=0.4;
%%% 计算软硬阈值
ythard=wthresh(y,'h',thr);
ytsoft=wthresh(y,'s',thr);
figure;
subplot(311);plot(y); grid on; title('原始信号');
subplot(312);plot(ythard);grid on; title('硬阈值信号');
subplot(313);plot(ytsoft);grid on; title('软阈值信号');
%
clear all;
close all;
clc;
%%%% 软阈值处理
load leleccum;
indx = 1:1024;
x = leleccum(indx);
%产生含噪信号
init = 2055615866;
randn('seed',init);
nx = x + 18*randn(size(x));
%将信号nx使用小波函数'sym5'分解到第5层
%使用mimimaxi阈值选择系数进行处理,消除噪声信号 ,
lev = 5;
xd = wden(nx,'minimaxi','s','mln',lev,'sym5');
subplot(221);
plot(x);
title('原始信号');
subpl

最低0.47元/天 解锁文章
8476

被折叠的 条评论
为什么被折叠?



