🚅座右铭:行百里者,半于九十。
🏆代码获取方式:
CSDN Matlab武动乾坤—代码获取方式
更多Matlab语音处理仿真内容点击👇
①Matlab语音处理(进阶版)
⛳️关注CSDN Matlab武动乾坤,更多资源等你来!!
0 引言
语音信号在传输过程中, 会不可避免地受到外界环境噪声的干扰, 从而影响人们之间的相互交流与沟通。如何从含噪语音信号中将原始信号提取出来, 提高信号信噪比, 是现代语音信号处理领域的研究热点之一。小波阈值去噪法因其实现简单, 运算量小等优点被广泛应用于信号处理领域。
小波阈值去噪法的关键是阈值函数的选取。常规的阈值函数选取过于简单, 考虑不全面, 去噪效果受到限制。针对这些不足做了大量研究, 提出了一些改进方法。本文在软阈值函数的基础上, 提出了一种优化的参数阈值函数, 使得去噪效果得到较大提升。基于对实验结果的分析, 又提出了一种最优参数选择法, 进一步提升了去噪效果。
1 小波阈值语音去噪原理
小波阈值语音去噪可分为以下三个步骤:
function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing singleton*.
%
% UNTITLED(‘CALLBACK’,hObject,eventData,handles,…) calls the local
% function named CALLBACK in UNTITLED.M with the given input arguments.
%
% UNTITLED(‘Property’,‘Value’,…) creates a new UNTITLED or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before untitled_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to untitled_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE’s Tools menu. Choose “GUI allows only one
% instance to run (singleton)”.
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help untitled
% Last Modified by GUIDE v2.5 20-Mar-2022 22:34:59
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct(‘gui_Name’, mfilename, …
‘gui_Singleton’, gui_Singleton, …
‘gui_OpeningFcn’, @untitled_OpeningFcn, …
‘gui_OutputFcn’, @untitled_OutputFcn, …
‘gui_LayoutFcn’, [] , …
‘gui_Callback’, []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% — Executes just before untitled is made visible.
function untitled_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to untitled (see VARARGIN)
% Choose default command line output for untitled
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes untitled wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% — Outputs from this function are returned to the command line.
function varargout = untitled_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% — Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
fs=audioread(‘Ring01.wav’);
y=fs(40000:120000);
N=length(y);
axes(handles.axes1);
plot(y);
ylabel(‘幅值 A’);
title(‘原始信号’);
s=awgn(y,15,‘measured’);%加入高斯白噪声
axes(handles.axes2);
plot(s);
ylabel(‘幅值 A’);
title(‘加噪信号’);
wname=‘db3’;%选db3小波基
lev=5;%5层分解
[c,l]=wavedec(s,lev,wname);
a5=appcoef(c,l,wname,lev);
d5=detcoef(c,l,5);
d4=detcoef(c,l,4);
d3=detcoef(c,l,3);
d2=detcoef(c,l,2);
d1=detcoef(c,l,1);
cD=[d1,d2,d3,d4,d5];
a=8500;b=13;
sigma=median(abs(cD))/3.647
thr1=(sigmasqrt(2(log10(N))))/(log10(2));
cD1=wthresh(d1,‘s’,thr1);
thr2=(sigmasqrt(2(log10(N))))/(log10(3));
cD2=wthresh(d2,‘s’,thr2);
thr3=(sigmasqrt(2(log10(N))))/(log10(4));
cD3=wthresh(d3,‘s’,thr3);
thr4=(sigmasqrt(2(log10(N))))/(log10(5));
cD4=wthresh(d4,‘s’,thr4);
thr5=(sigmasqrt(2(log10(N))))/(log10(6));
cD5=wthresh(d5,‘s’,thr5);
cd=[a5,cD5,cD4,cD3,cD2,cD1];
c=cd;
ys=waverec(c,l,wname);
axes(handles.axes3);
plot(ys);
title(‘软阈值处理’);
thr1=(sigmasqrt(2(log10(N))))/(log10(2));
cD1=wthresh(d1,‘h’,thr1);
thr2=(sigmasqrt(2(log10(N))))/(log10(3));
cD2=wthresh(d2,‘h’,thr2);
thr3=(sigmasqrt(2(log10(N))))/(log10(4));
cD3=wthresh(d3,‘h’,thr3);
thr4=(sigmasqrt(2(log10(N))))/(log10(5));
cD4=wthresh(d4,‘h’,thr4);
thr5=(sigmasqrt(2(log10(N))))/(log10(6));
cD5=wthresh(d5,‘h’,thr5);
cd=[a5,cD5,cD4,cD3,cD2,cD1];
c=cd;
yh=waverec(c,l,wname);
axes(handles.axes4);
plot(yh);
title(‘硬阈值处理’);
thr1=(sigmasqrt(2(log10(length(d1)))))/(log10(1+1));
for i=1:length(d1)
if(abs(d1(i))>=thr1)
cD1(i)=sign(d1(i))(abs(d1(i))-bthr1/(a^(abs(abs(d1(i))-thr1))+b-1));%估计第一层小波系数
else
cD1(i)=0;
end
end
1 matlab版本
2014a
2 参考文献
[1]韩纪庆,张磊,郑铁然.语音信号处理(第3版)[M].清华大学出版社,2019.
[2]柳若边.深度学习:语音识别技术实践[M].清华大学出版社,2019.
[3]张宝,魏连鑫.基于参数阈值函数的小波阈值语音去噪[J].信息技术. 2017,(08)
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 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长