【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】

⛄一、自适应小波语音信号去噪

1 引言
在传输过程中,语音信号容易受到环境噪声等语音的干扰,降低了语音通信的质量,影响了语音处理系统的工作。因此,语音净化技术在现代语音通信和数字音频广播系统中发挥着越来越重要的作用。小波变换具有良好的时频局部化分析特性,是处理语音等非平稳时变信号的有效方法。但是,随着尺度的增大,正交小波基函数的空间分辨率越高,频率分辨率越低。小波包具有进一步分割和细化频谱窗口的特点,可以克服正交小波变换的缺点,进一步分解信号,提高频率分辨率。它是一种比多分辨分析更精细的分解方法。它具有较好的时频特性。因此,采用小波包变换去除信号中的噪声,以达到较好的语音净化效果。

[En]

In the process of transmission, the voice signal is easily disturbed by environmental noise and other speech, which reduces the quality of voice communication and affects the work of the speech processing system. Therefore, speech purification technology plays a more and more important role in modern voice communication and digital audio broadcasting system. Wavelet transform has good time-frequency localization analysis characteristics, and it is an effective method to deal with non-stationary time-varying signals such as speech. However, with the increase of the scale, the higher the spatial resolution of the orthogonal wavelet basis function, the lower the frequency resolution. Wavelet packet has the characteristics of further segmentation and thinning of the spectrum window that widens with the increase of scale, which can overcome the shortcomings of orthogonal wavelet transform, further decompose the signal and improve the frequency resolution. it is a more refined decomposition method than multi-resolution analysis. it has better time-frequency characteristics. Therefore, wavelet packet transform is used to remove the noise in the signal to achieve a better speech purification effect.

2 小波包变换理论
在小波变换的基础上进一步提出了小波包变换,它可以在不细分的情况下对小波变换的高频部分进行进一步分解,为信号的分析提供了一种更精确的方法。对于高频成分丰富的语音信号,小波包变换是一种理想的分析工具,它克服了正交小波基的一个主要缺陷,即随着尺度的增大,对应的正交小波基函数的时间分辨率越高。频率分辨率越低。通过空间小波包分解,其实质是使信号经过高通和低通滤波,进行间隔采样,将信号逐层分解到不同的频段。

[En]

The wavelet packet transform is further proposed on the basis of the wavelet transform, which can further decompose the high frequency part of the wavelet transform without subdivision, which provides a more precise analysis method for the signal. For speech signals with rich high frequency components, wavelet packet transform is an ideal analysis tool, which overcomes one of the main defects of orthogonal wavelet basis, that is, with the increase of scale, the higher the time resolution of the corresponding orthogonal wavelet basis function. and the lower the frequency resolution. Through the spatial wavelet packet decomposition, the essence is to make the signal pass through the high-pass and low-pass filter, carry on the interval sampling, and decompose the signal into different frequency bands layer by layer.

小波包分解公式为

【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
小波包重构公式为
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
3 自适应阈值法去噪
3.1 阈值法小波去噪

首先对被噪声污染的语音信号f(t)进行离散序列小波变换,得到带有噪声的小波系数w(j,k),其中,j=0,1,2,…,N;k=0,1,2,…,N;然后用设定的阈值λ作为门限对小波系数进行处理,对低于λ的小波系数作为由噪声引起的,仅让超过λ的那些显著的小波系数来重构原始纯净语音信号s(t)。阈值法小波去噪处理框图如图1所示。
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
图1 阈值法小波去噪处理框图
阈值法小波去噪因容易实现、计算量小,所以得到了广泛应用。Donoho和Johnstone提出的硬阈值和软阈值方法是目前最普遍的方法。硬阈值法采用式(3)的硬阈值函数进行阈值处理,软阈值法采用式(4)的软阈值函数进行阈值处理。
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
3.2 自适应阈值法
Donoho的软阈值法虽然取得了不错的效果,但其基于正交小波基。笔者采用小波包分析的方法,并对其阈值选取进行了进一步研究。由信号的奇异性理论,白噪声具有负的奇异性,其幅度和稠密度随尺度的增大而减小,而信号则相反。因此阈值的选取不能单一,应能根据噪声情况自动调节阈值大小。笔者采用自适应阈值法来克服这种缺点,即下一时刻的阈值λ(k+1)等于现在时刻的阈值λ(k)减去一个扰动项,该扰动项正比于均方误差函数的梯度值Δλ,即
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
公式中α为步长,可根据精度选择。
[En]

In the formula, α is the step size, which can be selected according to the precision.

算法的关键时求出Δλ(k),可设一个关于观测值Y的函数

【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
由式(10)可看出,如采用常用的硬阈值或软阈值函数,由于导数不连续甚至没有导数,无法进行自适应迭代,当然也无法得到最佳阈值。为获得最佳阈值,实现更好的去噪效果,应采用具有连续导数的阈值函数。阈值函数,即
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
这种阈值函数的好处是:当|x|非常接近阈值λ时,不会直接将小于阈值的小波系数置零,而是渐近为零;在|x|≥λ内,该函数对小波系数采取的是缓变地压缩,这样做符合对大于阈值的小波系数的处理,能较好地处理有用信号中存在的噪声分量。

; ⛄二、部分源代码

clear all; close all; clc;

% Audio acquisition
[file,path] = uigetfile(‘./Databases/*.wav’, ‘Select the speech files’, ‘MultiSelect’, ‘on’);
[audio_signal,fs] = audioread([path,file]);
Fs = fs; N = 1024; seqAxis = 0:1:N-1; step = 0;

audio_signal = audio_signal.’/max(abs(audio_signal));
audio_signal = cat(2,zeros(1,N),audio_signal);

% Additive noise + filtering @8KHz
noise = randn(1,length(audio_signal));
nsVar = 0.05;
noise = nsVar * noise/max(abs(noise));

Hd = mylowpass;
audio_noisy = audio_signal + noise;
audio_noisy = filter(Hd,audio_noisy);

% SNR values
Pa = bandpower(audio_signal);
Ps = bandpower(audio_noisy);
Pn = bandpower(noise);
SNR = 10*log10(Pa/Pn);

% Window choice and preparation
h = hann(N); % Hanning
%h = hamming(N); % Hamming
h = h’; weight = sum(abs(h.^2));

% Wiener Filter parameters
umax = 10; u0 = (1+4*umax/5); z = 25/(umax-1);

%% MTS: Sine Tapers + Noise estimation

m = 0:N-1; L = 5; l = 1:L;
a = sqrt(2/(N+1)).*sin((pi * l’ * (m+1))/(N+1));

figure(1); clf
set(gcf,’Name’,’Sine tapers’)
S_k_n = 0.0;

for currentTaper = 1:L
S_k_n = S_k_n + abs(fft(a(currentTaper,:) .* audio_noisy(1:N))).^2;
plot(a(currentTaper,:));
hold on
end

⛄三、运行结果

【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】
【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】

; ⛄四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1]张飞.基于小波包变换的自适应阈值语音去噪净化[J].电声技术. 2009,33(10)

3 备注
本部分摘录自互联网,仅供参考,如有侵权,请联系删除

[En]

Brief introduction this part is extracted from the Internet, for reference only, if infringement, contact to delete

Original: https://blog.csdn.net/TIQCmatlab/article/details/125811602
Author: 海神之光
Title: 【语音增强】基于matlab多维谱自适应小波语音信号去噪【含Matlab源码 1972期】

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/512922/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球