【语音去噪】多窗口谱减法语音信号去噪【含Matlab源码 2584期】

✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信。
🍎个人主页:海神之光
🏆代码获取方式:
海神之光Matlab王者学习之路—代码获取方式
⛳️座右铭:行百里者,半于九十。

更多Matlab仿真内容点击👇
Matlab图像处理(进阶版)
路径规划(Matlab)
神经网络预测与分类(Matlab)
优化求解(Matlab)
语音处理(Matlab)
信号处理(Matlab)
车间调度(Matlab)

⛄一、谱减法简介

在语音去噪中最常用的方法是谱减法,谱减法是一种发展较早且应用较为成熟的语音去噪算法,该算法利用加性噪声与语音不相关的特点,在假设噪声是统计平稳的前提下,用无语音间隙测算到的噪声频谱估计值取代有语音期间噪声的频谱,与含噪语音频谱相减,从而获得语音频谱的估计值。谱减法具有算法简单、运算量小的特点,便于实现快速处理,往往能够获得较高的输出信噪比,所以被广泛采用。该算法经典形式的不足之处是处理后会产生具有一定节奏性起伏、听上去类似音乐的“音乐噪声”。

转换到频域后,这些峰值听起来就像帧与帧之间频率随机变化的多频音,这种情况在清音段尤其明显,这种由于半波整流引起的“噪声”被称为“音乐噪声”。从根本上,通常导致音乐噪声的原因主要有:
(1)对谱减算法中的负数部分进行了非线性处理
(2)对噪声谱的估计不准
(3)抑制函数(增益函数)具有较大的可变性
1 原理
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2 流程图
在这里插入图片描述
3 谱减法的缺点
1)由于对负值进行半波整流,导致帧频谱的随机频率上出现小的、独立的峰值,变换到时域上面,这些峰值听起来就像帧与帧之间频率随机变化的多颤音,也就是通常所说的“音乐噪声”(Musical Noise)
2)另外,谱减法还存在一个小缺点就是使用带噪语音的相位作为增强后语音的相位,因此产生语音的质量可能比较粗糙,尤其是在低信噪比的条件下,可能会达到被听觉感知的程度,降低语音的质量。
为了更好的理解谱减法语音增强,这里对该算法进行简单仿真,仿真参数设置如下
在这里插入图片描述

⛄二、部分源代码

function fwseg_dist_noise_AI= AIST(cleanFile, enhancedFile,noiseFile)
% ----------------------------------------------------------------------
% Articulation index_short time(AIST)Objective Speech Quality Measure
% This function implements the AIST Measure
% Usage:AIST=AIST(clean.wav,enhanced.wav,noise.wav)
% clean.wav.wav-clean input file in.wav format
% enhanced.wav-enhanced output file in .wav format
% noise.wav- noise file which is noisy-clean
% AI_ST --computed AIST
% Note that the AIST measure is limited in the range[0,1].
% Example call: AI_ST = AIST(‘sp04.wav’,‘sp04_babble_sn10.wav’,’sp04_babble_sn10.wav-sp04.wav’)
% SNR=Xhat2/D2
% ----------------------------------------------------------------------
if nargin~=3
fprintf(‘USAGE: AIST=AIST(cleanFile.wav, enhancedFile.wav,noiseFile)\n’);
fprintf(‘For more help, type: help comp_fwseg\n\n’);
return;
end
[data0, Srate0]= audioread(noiseFile);
[data1, Srate1]= audioread(cleanFile);
[data2, Srate2]= audioread(enhancedFile);
if ( Srate0~= Srate1)
error( ‘The three files do not match!\n’);
end
len= min(min(length(data0), length( data1)), length( data2));
data0= data0( 1: len)+eps;
data1= data1( 1: len)+eps;
data2= data2( 1: len)+eps;
wss_dist_vec_noisy= fwseg_noise( data0, data1, data2,Srate1);
fwseg_dist_noise_AI=mean(wss_dist_vec_noisy);
% ----------------------------------------------------------------------
function distortion = fwseg_noise(noise_speech, clean_speech, processed_speech,sample_rate)
% ----------------------------------------------------------------------
% Check the length of the noisy,the clean and processed speech.Must be the
% same
% ----------------------------------------------------------------------
noise_length = length(noise_speech);
clean_length = length(clean_speech);
processed_length = length(processed_speech);
if (noise_length ~= clean_length | clean_length ~= processed_length)
disp(‘Error: Files must have same length.’);
return
end
% ----------------------------------------------------------------------
% Global Variables
Len=30;
% ----------------------------------------------------------------------
winlength = round(Lensample_rate/1000); % window length in samples
skiprate = floor(winlength/4); %window skip in samples
max_freq = sample_rate/2; %maximum bandwidth
num_crit = 25; % number of critical bands
USE_25=1;
n_fft = 2^nextpow2(2
winlength);
n_fftby2 = n_fft/2; % FFT size/2
gamma=1; % power exponent
% ----------------------------------------------------------------------
%Critical Band Filter Definitions(Center Frequency and Bandwidths in Hz)
% ----------------------------------------------------------------------
cent_freq(1) = 50.0000; bandwidth(1) = 70.0000;
cent_freq(2) = 120.000; bandwidth(2) = 70.0000;
cent_freq(3) = 190.000; bandwidth(3) = 70.0000;
cent_freq(4) = 260.000; bandwidth(4) = 70.0000;
cent_freq(5) = 330.000; bandwidth(5) = 70.0000;
cent_freq(6) = 400.000; bandwidth(6) = 70.0000;
cent_freq(7) = 470.000; bandwidth(7) = 70.0000;
cent_freq(8) = 540.000; bandwidth(8) = 77.3724;
cent_freq(9) = 617.372; bandwidth(9) = 86.0056;
cent_freq(10) = 703.378; bandwidth(10) = 95.3398;
cent_freq(11) = 798.717; bandwidth(11) = 105.411;
cent_freq(12) = 904.128; bandwidth(12) = 116.256;
cent_freq(13) = 1020.38; bandwidth(13) = 127.914;
cent_freq(14) = 1148.30; bandwidth(14) = 140.423;
cent_freq(15) = 1288.72; bandwidth(15) = 153.823;
cent_freq(16) = 1442.54; bandwidth(16) = 168.154;
cent_freq(17) = 1610.70; bandwidth(17) = 183.457;
cent_freq(18) = 1794.16; bandwidth(18) = 199.776;
cent_freq(19) = 1993.93; bandwidth(19) = 217.153;
cent_freq(20) = 2211.08; bandwidth(20) = 235.631;
cent_freq(21) = 2446.71; bandwidth(21) = 255.255;
cent_freq(22) = 2701.97; bandwidth(22) = 276.072;
cent_freq(23) = 2978.04; bandwidth(23) = 298.126;
cent_freq(24) = 3276.17; bandwidth(24) = 321.465;
cent_freq(25) = 3597.63; bandwidth(25) = 346.136;
% ----------------------------------------------------------------------
% Set up the critical band filters.Note here that Gaussianly shaped
% filter are used.Also, the sum of the filter weights are equivalent
% for each critical band filter.Filter less than -30dB point of filter
% ----------------------------------------------------------------------
bw_min = bandwidth (1); % minimum critical bandwidth
min_factor = exp (-30.0 / (2.0 * 2.303)); % -30 dB point of filter
for i = 1:num_crit
f0 = (cent_freq (i) / max_freq) * (n_fftby2);
all_f0(i) = floor(f0);
bw = (bandwidth (i) / max_freq) * (n_fftby2);
norm_factor = log(bw_min) - log(bandwidth(i));
j = 0:1:n_fftby2-1;
crit_filter(i,:) = exp (-11 (((j - floor(f0)) ./bw).^2) + norm_factor);
crit_filter(i,:) = crit_filter(i,:).
(crit_filter(i,:) > min_factor);
end

⛄三、运行结果

在这里插入图片描述

⛄四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1]韩纪庆,张磊,郑铁然.语音信号处理(第3版)[M].清华大学出版社,2019.
[2]柳若边.深度学习:语音识别技术实践[M].清华大学出版社,2019.

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

🍅 仿真咨询
1 各类智能优化算法改进及应用

生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化

2 机器学习和深度学习方面
卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM、XGBOOST、TCN实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断

3 图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知

4 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划、天线线性阵列分布优化、车间布局优化

5 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配

6 无线传感器定位及布局方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化

7 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化

8 电力系统方面
微电网优化、无功优化、配电网重构、储能配置

9 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长

10 雷达方面
卡尔曼滤波跟踪、航迹关联、航迹融合

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值