📄 fg_08_19.m
字号:
% fg_08_19 Noise, and correlated noise.
K=40000; T=1/40000;
% Copy the speech signal.
fid=fopen(['signal_3.txt']);
s=fscanf(fid,'%7d%8d%8d%8d%8d%8d%8d%8d%8d%8d\n',K);
fclose(fid);
s=127*s'/max(abs(s));
% Generate the rock drill noise.
b=[1 zeros(1,99) -.99];
a=[1 -2*.99*cos(2*pi*2/100) .99^2];
randn('seed',0);
noise=filter(b,a,10*rand(1,40000));
% Generate the corellated noise.
theta=[0 3 4 5 6];
zer=.9*[exp(j*theta) exp(-j*theta)];
nc=.01*filter(1,poly(zer),noise);
% Plot both noises.
sp_fig(1,9,5.5);
subplot(2,1,1);
set(gca,'fontsize',16);
line([0:K-1]*T,noise,'color','r'); grid on;
axis([.2 .3 -500 500]);
xlabel('t (s)'); ylabel('Noise n(t)');
subplot(2,1,2);
set(gca,'fontsize',16);
line([0:K-1]*T,nc,'color','b'); grid on;
axis([.2 .3 -500 500]);
xlabel('t (s)'); ylabel('Correlated noise f(t)');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -