⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 white_noise.m

📁 matlab实现信号分类
💻 M
字号:
Atten_Coef = 1.8e-6;
fs = 10e6;
fc = 1e6;
i = 1/fs:1/fs:2048/fs;
s = exp(-i/Atten_Coef);
s1 = SignalDelay(s,300,2.0);
s  = exp(-1.3*i/Atten_Coef) - exp(-2.2*i/Atten_Coef);
s2 = SignalDelay(s,600,12.0);
s  = exp(-i/Atten_Coef).*sin(2*pi*fc*i);
s3 = SignalDelay(s,1000,4.0);
s  = (exp(-1.3*i/Atten_Coef) - exp(-2.2*i/Atten_Coef)).*sin(2*pi*fc*i);
s4 = SignalDelay(s,1600,6.0);
write_noise = sqrt(0.6*0.6)*randn(1,length(s));
s = s1 + s2 + s3 + s4 + write_noise;
plot(s);

% s_relation = zeros(1,6);
[c,l] = wavedec(s,1,'db8');
s_temp = detcoef(c,l,1);
thr = std(s_temp);
for i = 1:length(s_temp)
    if abs(s_temp(i))<3*thr
      s_temp(i) = 0;
    end
end
c1 =  [appcoef(c,l,'db8',1),s_temp,s];
s = waverec(c1,l,'db8');
figure(2)
subplot(211)
plot(c)
subplot(212)
plot(c1);
figure(3)
plot(s)

% thr_value = 1.95/sqrt(length(s_temp))
% flag = 1;
% s_temp = s;
% for j = 1:100
%   [c,l] = wavedec(s_temp,1,'db8');
%   s_temp = detcoef(c,l,1);
%   thr_value = 1.95/sqrt(length(s_temp));
%   for i = 1:6
%      s_relation(i) = self_relation_dection(s_temp,i);
%      if abs(s_relation)>thr_value
%         flag = 3;
%         break;
%      else
%         continue;
%      end
%   end
%   if flag >2
%       j
%       break;
%   end
% end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -