ROV
利用方差比率找到纯背景噪声范围:通过计算在不同位置的方差比率来确定噪声的范围。
noise = zeros(1, id);
start_s = floor(id / nrs);
end_s = start_s;
for i = start_s + 1: id - end_s
noise(i) = var(s(1:i)) / var(s(i:end));
end
[~,noise_t] = min(noise(start_s + 1: end - end_s));
noise_tt = noise_t + start_s + 1; % The range of pure background noise: 0~ noise_tt
dn.rov = noise; % saving the ROV curve
nrs:表示用于计算方差比率的窗口的大小。
通过循环遍历信号中每个位置,计算当前位置之前和之后子信号的方差并计算它们的比率,在noise向量的对应位置存储。最后找到noise向量中最小值的索引,以确定纯背景噪声的范围,这个索引加上srart_s+1得到了纯背景噪声的结束索引noise_tt.
CDF基于累积分布函数
%% The denoising method based on CDF thresholding
f_x = zeros(size(Tx, 1), size(Tx, 2));
thres = zeros(size(Tx, 1), 1);
for i = fi1 : 1 : fi2
scal = Tx(i,:);
x = abs(scal);
y = sort(x);
len = id;
ii = floor(id * nnum); %
x1 = x(1: noise_tt);
[ecdf_f, xx] = ecdf(x1);
ii = find(ecdf_f >= ECDF_threshold);
thre = xx(min(ii));
thres(i) = thre;
x(find(abs(x) < thre)) = 0;
x(find(abs(x) >= thre)) = 1;
f_x(i,:) = x;
end
dn.nr = noise_tt;
dn.thres = thres; % saving wavelet coefficient threshold for each frequency
Tx1 = Tx.*f_x;
s_0 = iwsst(Tx1, f, [f(1), f(end)]); % denoising waveform after hard thresholding based on ECDF threshold
dn.ecdf_tf = Tx1; % saving denoising time-frequency spectrum after hard thresholding based on ECDF threshold
dn.ecdf_dw = s_0; % saving denoising waveform after hard thresholding based on ECDF threshold