【语音处理】基于matlab GUI低通滤波器语音信号加噪与去噪【含Matlab源码 1708期】

⛄一、语音处理简介(附课程作业报告)

1 语音信号的特点
通过对大量语音信号的观察和分析,发现语音信号主要具有以下两个特征:

[En]

Through the observation and analysis of a large number of speech signals, it is found that the speech signal mainly has the following two characteristics:

①在频域内,语音信号的频谱分量主要集中在300~3400Hz的范围内。利用这个特点,可以用一个防混迭的带通滤波器将此范围内的语音信号频率分量取出,然后按8kHz的采样率对语音信号进行采样,就可以得到离散的语音信号。
在②的时间域中,语音信号具有时间短的特点,即总体上,语音信号的特征随时间变化,但在短时间间隔内,语音信号保持稳定。它显示了浊音段的周期性信号和清音段的随机噪声的特征。

[En]

In the time domain of ②, the speech signal has the characteristic of “short time”, that is, on the whole, the characteristics of the speech signal change with time, but in a short time interval, the speech signal remains stable. It shows the characteristics of periodic signal in the voiced segment and random noise in the unvoiced segment.

2 语音信号的采集
在将语音信号进行数字化前,必须先进行防混叠预滤波,预滤波的目的有两个:①抑制输入信导各领域分量中频率超出fs/2的所有分量(fs为采样频率),以防止混叠干扰。②抑制50Hz的电源工频干扰。这样,预滤波器必须是一个带通滤波器,设其上、下截止颜率分别是fH和fL,则对于绝人多数语音编译码器,fH=3400Hz、fL=60~100Hz、采样率为fs=8kHz;而对丁语音识别而言,当用于电话用户时,指标与语音编译码器相同。当使用要求较高或很高的场合时fH=4500Hz或8000Hz、fL=60Hz、fs=10kHz或20kHz。
为了将原始模拟语音信号变为数字信号,必须经过采样和量化两个步骤,从而得到时间和幅度上均为离散的数字语音信号。采样也称抽样,是信号在时间上的离散化,即按照一定时间间隔△t在模拟信号x(t)上逐点采取其瞬时值。采样时必须要注意满足奈奎斯特定理,即采样频率fs必须以高于受测信号的最高频率两倍以上的速度进行取样,才能正确地重建波它是通过采样脉冲和模拟信号相乘来实现的。
在采样的过程中应注意采样间隔的选择和信号混淆:对模拟信号采样首先要确定采样间隔。如何合理选择△t涉及到许多需要考虑的技术因素。一般而言,采样频率越高,采样点数就越密,所得离散信号就越逼近于原信号。但过高的采样频率并不可取,对固定长度(T)的信号,采集到过大的数据量(N=T/△t),给计算机增加不必要的计算工作量和存储空间;若数据量(N)限定,则采样时间过短,会导致一些数据信息被排斥在外。采样频率过低,采样点间隔过远,则离散信号不足以反映原有信号波形特征,无法使信号复原,造成信号混淆。根据采样定理,当采样频率大于信号的两倍带宽时,采样过程不会丢失信息,利用理想滤波器可从采样信号中不失真地重构原始信号波形。量化是对幅值进行离散化,即将振动幅值用二进制量化电平来表示。量化电平按级数变化,实际的振动值是连续的物理量。具体振值用舍入法归到靠近的量化电平上。
语音信号经过预滤波和采样后,由A/D变换器变换为二址制数字码。这种防混叠滤波通常与模数转换器做在一个集成块内,因此目前来说,语音信号的数字化的质量还是有保证的。
语音信号采集完成后,需要对语音信号进行时域分析、频谱分析、频谱分析和噪声滤波等处理。

[En]

After collecting the speech signal, it is necessary to analyze the speech signal, such as time domain analysis, spectrum analysis, spectrogram analysis and noise filtering.

3 语音信号分析技术
语音信号分析是语音信号处理的前提和基础,只有分析出可表示语音信号本质特征的参数,才有可能利用这些参数进行高效的语音通信、语音合成和语音识别等处理[8]。而且,语音合成的音质好坏,语音识别率的高低,也都取决于对语音信号分桥的准确性和精确性。因此语音信号分析在语音信号处理应用中具有举足轻重的地位。
贯穿于语音分析全过程的是”短时分析技术”。因为,语音信号从整体来看其特性及表征其本质特征的参数均是随时间而变化的,所以它是一个非乎稳态过程,不能用处理乎稳信号的数字信号处理技术对其进行分析处理。但是,由于不同的语音是由人的口腔肌肉运动构成声道某种形状而产生的响应,而这种口腔肌肉运动相对于语音频率来说是非常缓慢的,所以从另一方面看,虽然语音倍号具有时变特性,但是在一个短时间范围内(一般认为在10~30ms的短时间内),其特性基本保持不变即相对稳定,因面可以将其看作是一个准稳态过程,即语音信号具有短时平稳性。所以任何语音信号的分析和处理必须建立在”短时”的基础上.即进行”短时分析”,将语音信号分为一段一段来分析其特征参数,其中每一段称为一”帧”,帧长一般取为10~30ms。这样,对于整体的语音信号来讲,分析出的是由每一帧特征参数组成的特征参数时间序列。
根据分析参数的不同性质,语音信号分析可分为时域分析、频域分析、逆域分析等。时域分析方法具有计算简单、计算量小、物理意义明确等优点。然而,由于语音信号最重要的感知特征反映在功率谱上,而相位变化只起到很小的作用,所以频域分析比时域分析更重要。

[En]

According to the different properties of the analyzed parameters, speech signal analysis can be divided into time domain analysis, frequency domain analysis, inverse domain analysis and so on. Time domain analysis method has the advantages of simplicity, small amount of calculation and clear physical meaning. However, because the most important perceptual characteristic of speech signal is reflected in the power spectrum, and the phase change only plays a small role, so frequency domain analysis is more important than time domain analysis.

4 语音信号的时域分析
语音信号的时域分析就是对语音信号的时域参数进行分析和提取。在语音分析中,第一次接触和最直观的就是它的时域波形。语音信号本身就是一个时域信号,所以时域分析是最早也是应用最广泛的分析方法,它直接利用语音信号的时域波形进行分析。时间域分析通常用于最基本的参数分析和应用,如语音分割、预处理、大分类等。这种分析方法的特点是用①表达的语音信号更直观,物理意义明确。②实现简单,运算量少。③可以得到一些重要的语音参数。④只使用示波器等通用设备,使用相对简单。

[En]

The time domain analysis of speech signal is to analyze and extract the time domain parameters of speech signal. In speech analysis, the first contact and the most intuitive is its time domain waveform. The speech signal itself is a time-domain signal, so time-domain analysis is the earliest and most widely used analysis method, which directly uses the time-domain waveform of the speech signal. Time domain analysis is usually used for the most basic parameter analysis and applications, such as speech segmentation, preprocessing, large classification and so on. The characteristic of this analysis method is that the speech signal expressed by ① is more intuitive and the physical meaning is clear. ② is easy to implement and has few operations. ③ can get some important parameters of speech. ④ only uses general equipment such as oscilloscope, which is relatively simple to use.

语音信号的时域参数有短时能量、短时过零率、短时白相关函数和短时平均幅度差函数等,这是语音信号的一组最基本的短时参数,在各种语音信号数字处理技术中都要应用[6]。在计算这些参数时使用的一般是方窗或汉明窗。

5 语音信号的频域分析
语音信号的频域分析就是对语音信号的频域特性进行分析。从广义上讲,语音信号的频域分析包括频谱分析、功率谱分析、倒谱分析、频谱包络分析等,而常用的频域分析方法有带通滤波器法、傅里叶变换法、线预测法等。

[En]

The frequency domain analysis of speech signal is to analyze the frequency domain characteristics of speech signal. In a broad sense, the frequency domain analysis of speech signal includes spectrum, power spectrum, cepstrum, spectrum envelope analysis and so on, while the commonly used frequency domain analysis methods include bandpass filter bank method, Fourier transform method, line prediction method and so on.

⛄二、部分源代码

function varargout = untitled(varargin)
% UNTITLED M-file 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_OpeningFunction 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 13-Feb-2022 16:10:31

% 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 & isstr(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)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[y,fs,bits]=wavread(‘6.wav’);
y=y(:,1);
N=length(y);
sound(y,fs,bits);
Y=fft(y,40000);%采样点数40000
axes(handles.axes1);
plot(y);
axis([1600 2000 -1 1]);
axes(handles.axes2);
plot(abs(Y));
axis([0 20000 0 1500]);

% — Executes on button press in pushbutton2.

function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[y,fs,bits]=wavread(‘6.wav’);
y=y(:,1);
N=length(y);
t=(0:N-1)/fs;
n=0:N-1;
f0=3445;
s=sin(2 pi_f0/fs*n);%噪音信号
sound(s);
axes(handles.axes3);
plot(t,s);
axis([0 0.001 -2 2]);
spinpu=fft(s,N);
Pyy=spinpu. _conj(spinpu)/N;
halflength=floor(N/2);
f=fs
(0:halflength)/N;
axes(handles.axes4);
plot(f,Pyy(1:halflength+1));%噪音信号频谱
axis([3000 4000 0 10]);

⛄三、运行结果

【语音处理】基于matlab GUI低通滤波器语音信号加噪与去噪【含Matlab源码 1708期】

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

1 matlab版本
2014a

2 参考文献
[1]韩纪庆,张磊,郑铁然.语音信号处理(第3版)[M].清华大学出版社,2019.

[2]柳若边.深度学习:语音识别技术实践[M].清华大学出版社,2019.

[3]宋云飞,姜占才,魏中华.基于MATLAB GUI的语音处理界面设计[J].科技信息. 2013,(02)

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/122912132
Author: 海神之光
Title: 【语音处理】基于matlab GUI低通滤波器语音信号加噪与去噪【含Matlab源码 1708期】

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

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

(0)

大家都在看

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