当前位置:网站首页>[speech processing] speech signal denoising based on Matlab GUI Hanning window fir notch filter [including Matlab source code 1711]
[speech processing] speech signal denoising based on Matlab GUI Hanning window fir notch filter [including Matlab source code 1711]
2022-07-05 22:46:00 【Purple light】
One 、 Introduction to speech processing
1 Characteristics of voice signal
Through the observation and analysis of a large number of speech signals, it is found that , Voice signal mainly has the following two characteristics :
① In the frequency domain , The spectral components of speech signals are mainly concentrated in 300~3400Hz Within the scope of . Take advantage of this feature , An anti aliasing band-pass filter can be used to extract the frequency components of the speech signal in this range , Then press 8kHz The voice signal is sampled at the sampling rate of , You can get discrete speech signals .
② In the time domain , The voice signal has “ Short term ” Characteristics , That is, in general , The characteristics of speech signal change with time , But in a short time interval , The voice signal remains stable . In the voiced segment, it shows the characteristics of periodic signal , In the unvoiced segment, it shows the characteristics of random noise .
2 Voice signal acquisition
Before digitizing the voice signal , Anti aliasing pre filtering must be carried out first , There are two purposes of pre filtering :① Suppress the frequency exceeding in each domain component of input signal guidance fs/2 All the components of (fs Is the sampling frequency ), To prevent aliasing interference .② Inhibition 50Hz Power frequency interference of power supply . such , The prefilter must be a bandpass filter , Set on it 、 The lower cut-off color ratio is fH and fL, For most speech codecs ,fH=3400Hz、fL=60~100Hz、 The sampling rate is fs=8kHz; For Ding speech recognition , When used for telephone users , The index is the same as that of speech codec . When used in occasions with high or high requirements fH=4500Hz or 8000Hz、fL=60Hz、fs=10kHz or 20kHz.
In order to change the original analog voice signal into digital signal , It must go through two steps of sampling and quantization , Thus, the digital speech signal with discrete time and amplitude is obtained . Sampling is also called sampling , Is the discretization of the signal in time , That is, according to a certain time interval △t In analog signal x(t) Take its instantaneous value point by point . The Nyquist theorem must be satisfied when sampling , Sampling frequency fs Sampling must be carried out at a speed more than twice the maximum frequency of the signal under test , It is realized by multiplying the sampling pulse and the analog signal .
In the process of sampling, attention should be paid to the selection of sampling interval and signal confusion : The sampling interval of the analog signal should be determined first . How to choose △t Many technical factors need to be considered . generally speaking , The higher the sampling frequency , The denser the number of sampling points , The resulting discrete signal is closer to the original signal . But too high sampling frequency is not desirable , For fixed length (T) The signal of , Excessive amount of data collected (N=T/△t), Add unnecessary calculation workload and storage space to the computer ; If the amount of data (N) limit , The sampling time is too short , It will result in some data information being excluded . The sampling frequency is too low , Sampling points are too far apart , Then the discrete signal is not enough to reflect the waveform characteristics of the original signal , The signal cannot be restored , Cause signal confusion . According to the sampling theorem , When the sampling frequency is greater than twice the bandwidth of the signal , The sampling process does not lose information , The original signal waveform can be reconstructed without distortion from the sampled signal by using the ideal filter . Quantization is the discretization of amplitude , That is, the vibration amplitude is expressed by binary quantization level . The quantization level changes in series , The actual vibration value is a continuous physical quantity . The specific vibration value is rounded to the nearest quantization level .
The speech signal is pre filtered and sampled , from A/D The converter is transformed into a two address digital code . This anti aliasing filter is usually made in an integrated block with analog-to-digital converter , So for now , The digital quality of voice signal is guaranteed .
After collecting the voice signal , The voice signal needs to be analyzed , Such as time domain analysis of speech signal 、 Spectrum analysis 、 Spectrogram analysis and noise filtering .
3 Speech signal analysis technology
Speech signal analysis is the premise and foundation of speech signal processing , Only by analyzing the parameters that can represent the essential characteristics of speech signal , It is possible to use these parameters for efficient voice communication 、 Speech synthesis and speech recognition [8]. and , The sound quality of speech synthesis is good or bad , The level of speech recognition rate , It also depends on the accuracy and accuracy of the speech signal bridge . Therefore, speech signal analysis plays an important role in the application of speech signal processing .
Throughout the whole process of speech analysis is “ Short term analysis technology ”. because , As a whole, the characteristics of speech signal and the parameters characterizing its essential characteristics change with time , So it's an unsteady process , It cannot be analyzed and processed with digital signal processing technology for processing unstable signals . however , Because different speech is the response of a certain shape of the vocal tract formed by the movement of human oral muscles , This kind of oral muscle movement is very slow relative to speech frequency , So on the other hand , Although the phonetic multiple sign has time-varying characteristics , But in a short time range ( It is generally believed that in 10~30ms In a short time ), Its characteristics remain basically unchanged, that is, relatively stable , Because it can be regarded as a quasi steady state process , That is, the speech signal has short-term stability . Therefore, any speech signal analysis and processing must be based on “ short-term ” On the basis of . That is to say “ Short term analysis ”, The speech signal is divided into segments to analyze its characteristic parameters , Each paragraph is called a “ frame ”, The frame length is generally taken as 10~30ms. such , For the overall voice signal , The time series of characteristic parameters composed of characteristic parameters of each frame is analyzed .
According to the different properties of the analyzed parameters , Speech signal analysis can be divided into time domain analysis 、 Frequency domain analysis 、 Inverted domain analysis, etc ; The time domain analysis method is simple 、 A small amount of calculation 、 Clear physical meaning and other advantages , However, because the most important perceptual characteristics of speech signal are reflected in the power spectrum , The phase change only plays a small role , Therefore, compared with time domain analysis, frequency domain analysis is more important .
4 Time domain analysis of speech signal
The time domain analysis of speech signal is to analyze and extract the time domain parameters of speech signal . When performing speech analysis , The first and most intuitive thing is its time domain waveform . Speech signal itself is time domain signal , Therefore, time domain analysis is the earliest use , It is also the most widely used analysis method , This method directly uses the time-domain waveform of speech signal . Time domain analysis is usually used for the most basic parameter analysis and application , Such as speech segmentation 、 Preprocessing 、 Large classification, etc . The characteristics of this analysis method are :① It means that the voice signal is more intuitive 、 The physical meaning is clear .② It's easy to implement 、 Less computation .③ Some important parameters of speech can be obtained .④ Only use general equipment such as oscilloscope , Easy to use, etc .
The time domain parameters of speech signal have short-term energy 、 Short time zero crossing rate 、 Short time white correlation function and short time average amplitude difference function, etc , This is a set of basic short-time parameters of speech signal , It should be applied in various speech signal digital processing technologies [6]. The square window or Hamming window is generally used in calculating these parameters .
5 Frequency domain analysis of speech signal
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 the spectrum of speech signal 、 Power spectrum 、 Cepstrum 、 Spectrum envelope analysis, etc , The commonly used frequency domain analysis method is band-pass filter bank method 、 Fourier transform method 、 Line prediction method, etc .
Two 、 Partial source code
function varargout = wwzl(varargin)
% WWZL M-file for wwzl.fig
% WWZL, by itself, creates a new WWZL or raises the existing
% singleton*.
%
% H = WWZL returns the handle to a new WWZL or the handle to
% the existing singleton*.
%
% WWZL('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in WWZL.M with the given input arguments.
%
% WWZL('Property','Value',...) creates a new WWZL or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before wwzl_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to wwzl_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 wwzl
% Last Modified by GUIDE v2.5 19-Nov-2012 23:20:06
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @wwzl_OpeningFcn, ...
'gui_OutputFcn', @wwzl_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 wwzl is made visible.
function wwzl_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 wwzl (see VARARGIN)
% Choose default command line output for wwzl
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes wwzl wait for user response (see UIRESUME)
% uiwait(handles.my_storage);
% --- Outputs from this function are returned to the command line.
function varargout = wwzl_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 slider movement.
function slider5_Callback(hObject, eventdata, handles)
% hObject handle to slider5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
% --- Executes during object creation, after setting all properties.
function slider5_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end
% --- Executes on button press in noise_in.
function noise_in_Callback(hObject, eventdata, handles)
% hObject handle to noise_in (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
x=getappdata(handles.my_storage,'x');
n=getappdata(handles.my_storage,'n');
t=getappdata(handles.my_storage,'t');
if get(handles.EN_open,'value')==1 % Turn on mode
Xn=x+n;
axes(handles.axes2);
plot(t,Xn);grid on;
elseif get(handles.EN_record,'value')==1 % Recording mode
n=getappdata(handles.my_storage,'n');
Xn=getappdata(handles.my_storage,'data1')+n;
axes(handles.axes2);
plot(getappdata(handles.my_storage,'time'),Xn);grid on;
end
setappdata(handles.my_storage,'Xn',Xn);
% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on selection change in noises.
function noises_Callback(hObject, eventdata, handles)
% hObject handle to noises (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns noises contents as cell array
% contents{
get(hObject,'Value')} returns selected item from noises
Fn=str2num(get(handles.noise_f,'string')); % from edit For information
Mn=str2num(get(handles.noise_M,'string'));
if get(handles.EN_open,'value')==1 % Turn on mode
x=getappdata(handles.my_storage,'x');
fs=getappdata(handles.my_storage,'fs');
elseif get(handles.EN_record,'value')==1 % Recording mode
x=getappdata(handles.my_storage,'data1');
fs=getappdata(handles.my_storage,'Fs');
end
t=1:length(x);
shap=get(handles.noises,'value');
switch shap
case 2
n=(Mn*sin((2*pi*Fn/fs)*t))'; % Variable frequency AC noise
case 3
n=wgn(length(x),1,0.005); % white Gaussian noise
case 4
n=Mn*randn(length(x),1); % Random noise
otherwise
warndlg(' Please select the noise type ',' Tips ');
end
3、 ... and 、 Running results
Four 、matlab Edition and references
1 matlab edition
2014a
2 reference
[1] Han Jiqing , Zhang Lei , Zheng tieran . Voice signal processing ( The first 3 edition )[M]. tsinghua university press ,2019.
[2] Liu ruobian . Deep learning : Speech recognition technology practice [M]. tsinghua university press ,2019.
[3] Song Yunfei , Jiang zhancai , Wei Zhonghua . be based on MATLAB GUI Voice processing interface design [J]. Technology Information . 2013,(02)
边栏推荐
- 从 1.5 开始搭建一个微服务框架——日志追踪 traceId
- Oracle is sorted by creation time. If the creation time is empty, the record is placed last
- Distributed solution selection
- Post-90s tester: "after joining Ali, this time, I decided not to change jobs."
- 链表之双指针(快慢指针,先后指针,首尾指针)
- C language - structural basis
- Nangou Gili hard Kai font TTF Download with installation tutorial
- 509. Fibonacci Number. Sol
- Binary tree (III) -- heap sort optimization, top k problem
- Nanjing: full use of electronic contracts for commercial housing sales
猜你喜欢
First, redis summarizes the installation types
audiopolicy
Overview of Fourier analysis
Postman core function analysis - parameterization and test report
What changes has Web3 brought to the Internet?
Opencv judgment points are inside and outside the polygon
Solutions for unexplained downtime of MySQL services
BFC block level formatting context
Nanjing: full use of electronic contracts for commercial housing sales
Golang writes the opening chapter of selenium framework
随机推荐
Nacos 的安装与服务的注册
Tensor attribute statistics
Exponential weighted average and its deviation elimination
Postman core function analysis - parameterization and test report
Go语言学习教程(十五)
Function default parameters, function placeholder parameters, function overloading and precautions
Paddle Serving v0.9.0 重磅发布多机多卡分布式推理框架
Metasploit (MSF) uses MS17_ 010 (eternal blue) encoding:: undefined conversionerror problem
Platform bus
记录几个常见问题(202207)
谷歌地图案例
ESP32 hosted
航海日答题小程序之航海知识竞赛初赛
Double pointeur de liste liée (pointeur rapide et lent, pointeur séquentiel, pointeur de tête et de queue)
Opencv judgment points are inside and outside the polygon
30 optimization skills about mysql, super practical
Analysis of the problem that the cookie value in PHP contains a plus sign (+) and becomes a space
Thinkphp5.1 cross domain problem solving
一文搞定JVM常见工具和优化策略
Metaverse Ape上线倒计时,推荐活动火爆进行