当前位置:网站首页>[pure tone hearing test] pure tone hearing test system based on MATLAB
[pure tone hearing test] pure tone hearing test system based on MATLAB
2022-07-05 00:53:00 【FPGA and MATLAB】
1. Software version
matlab2017b
2. System principle
Voice is the most basic way of human communication , The human ear is the only organ that receives speech signals , But for hearing impaired patients , Because the voice signal from others cannot be received normally , It cannot communicate normally , It has seriously affected their daily life [01]. In the early , Due to various conditions , They are often ignored by society , With the continuous development of economy , The continuous progress of society , People pay more and more attention to the problem of listening , Through research, we found that , The main causes of hearing problems are living in a noisy environment for a long time , Cause hearing loss gradually , Congenital hearing impairment , External influence, injury, damage, etc [02]. up to now , There are more than people with hearing impairment in China 3000 ten thousand , One is mostly the elderly , There are also newborns . And all over the world , Hearing impaired people are more than 6 Hundreds of millions of people , Hearing impairment is becoming an important disease affecting human health , If you don't take the right measures , It will lead to more serious problems in the future . And most of them can be avoided by early detection and treatment of problems through early hearing tests , But for a long time , Due to the lack of various effective testing methods , Many people become hearing impaired . therefore , Developing an effective listening test method is a very important research direction . at present , Listening tests can be divided into pure tone listening tests , Speech audiometry and hearing discrimination test . Pass these tests , Then score the test results according to relevant standards , So as to give an objective and accurate evaluation index of the patient's hearing level , It plays a guiding role in the hearing rehabilitation of later patients . Pure tone listening test is an important listening test project , It plays a decisive role in clinical application . Its main test method is through observation 、 Record the patient's response to different frequencies , The natural response of the sound signal of sound intensity to understand the actual hearing situation of the patient .
Audiometric system based on pure tone audiometry . The whole system has the following functions :
First of all 、 The system can generate different frequencies , Pure tone signals with different sound intensities and durations ;
second 、 For pure tone signals of the same frequency , Can change its sound intensity , Get multiple pure tone signals with different sound intensities ;
Third 、 It can record the test records of different subjects ;
Fourth 、 Good user interface ;
According to the national standard GB-16403, This paper formulates the following overall steps of pure tone hearing threshold test :
First of all 、 Set the starting frequency of pure tone signal to 1000Hz, The initial sound pressure is set to 0dB As the initial sound pressure level , And take 5dB Gradually increase the sound pressure for equal intervals , Until the subject hears the sound , And record the hearing feedback results of the corresponding subjects under different sound pressures .
second 、 Then in order to 5dB Reduce the sound pressure level for the interval , Until the subject can't hear the sound , And then 5dB Gradually increase the sound pressure for equal intervals , Until the subject hears the sound , So send repeated tests 3 More than once , Record the threshold of the sound that the subjects can hear each time .
Third 、 Change the frequency test point , Turn into 2kHz, Then repeat step one and step two, and the result , And record the relevant test results ; Then add frequency test points , Repeat steps one and two , Until the frequency test point increases to 20000Hz until .
Then in the pure tone frequency resolution test , According to international general standards , We set up 11 Two frequency points :125Hz,250Hz,500Hz,,750Hz,1000Hz,1500Hz,2000Hz,3000Hz,4000Hz,6000Hz,8000Hz, The specific test steps are as follows :
First of all 、 Select the first frequency test point , The generation frequency is 125Hz Pure tone signal ;
second 、 And then choose 10 Subjects , Test them separately , Record the hearing feedback of each subject . Then set the frequency point to the second frequency value 250H stay , Repeat for 10 Subjects were tested , Record the hearing feedback of each subject . In this way , In turn 11 Test at frequency points , Until all frequency points are tested .
3. Core source code
· Sound recording module
Sound recording module MATLAB basic GUI The interface is shown in the figure below :
chart 1 Sound recording module
From the picture 1 You know , The sound recording module includes starting recording 、 Stop recording 、 Play 、 Functions such as saving and volume control , While playing , It can automatically display the speaking speed (Speed X). The main function of this module is to record some voice samples that need language testing .
· Music test module
Music test module MATLAB basic GUI The interface is shown in the figure below :
chart 2 Music test module
· Pure tone signal generation module
Of pure tone signal generation module MATLAB basic GUI The interface is shown in the figure below :
chart 3 Pure tone signal generation module
From the picture 3 You know , The pure tone signal generation module includes pure tone signal sampling rate setting , Duration setting , Pure tone signal frequency setting (250Hz,500Hz,,750Hz,1000Hz,1500Hz,2000Hz,3000Hz,4000Hz,6000Hz,8000Hz), Sound intensity setting (10dB HL,15 dB HL,25 dB HL,35 dB HL,45 dB HL,50 dB HL,60 dB HL,70 dB HL,75 dB HL,85 dB HL), Produce pure tone , Play pure tone , Save pure tone and stretch to settings ( Two channel 、 Left voice way 、 Right channel ). The pure tone signal generation module can display the time domain waveform of the pure tone signal at the same time , Frequency domain waveform and sound intensity characteristic curve .
The pure tone signal generation module is also the core module of this system , Through this module , We can test the hearing threshold of the subjects , That is, the perceptible hearing frequency range and sound intensity range . Provide treatment basis for the treatment and rehabilitation of hearing impaired people in the later stage .
· Test result analysis module
Test result analysis module MATLAB basic GUI The interface is shown in the figure below :
chart 4 Test result analysis module
From the picture 4 You know , The test result analysis module includes left ear curve 、 Test result data of right ear curve and binaural curve . The main function of this module is to display the test results of the subjects in the form of data curves .
function varargout = tops(varargin)
% TOPS MATLAB code for tops.fig
% TOPS, by itself, creates a new TOPS or raises the existing
% singleton*.
%
% H = TOPS returns the handle to a new TOPS or the handle to
% the existing singleton*.
%
% TOPS('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in TOPS.M with the given input arguments.
%
% TOPS('Property','Value',...) creates a new TOPS or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before tops_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to tops_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 tops
% Last Modified by GUIDE v2.5 26-Apr-2019 22:46:55
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @tops_OpeningFcn, ...
'gui_OutputFcn', @tops_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 tops is made visible.
function tops_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 tops (see VARARGIN)
% Choose default command line output for tops
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes tops wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = tops_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;
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (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,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (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,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles)
% hObject handle to edit3 (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,'String') returns contents of edit3 as text
% str2double(get(hObject,'String')) returns contents of edit3 as a double
% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- 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)
cla(handles.axes1);
cla(handles.axes2);
global Fs;
global T;
global fc;
global tt;
global y;
global sy;
global LIMIT;
Fs = str2num(get(handles.edit1, 'string'));
T = str2num(get(handles.edit2, 'string'));
sy = LIMIT;
tt = [1/Fs:1/Fs:T];
y = 10^(sy/20)*sin(2*pi*fc*tt);
yfft = abs(fftshift(fft(y)));
N = length(yfft);
ff = Fs*[-N/2:1:N/2-1]/N;
axes(handles.axes1);
plot(tt,y);
xlim([0,0.002]);
xlabel(' Time (s)');
ylabel(' Range (m)');
axes(handles.axes2);
plot(ff,yfft)
xlim([-2*fc,2*fc]);
xlabel(' frequency (Hz)');
ylabel(' Range (m)');
% take x A channel for
x=y';
fs=Fs;
% take x From column vector to row vector
x=x';
LL=length(x);
% Voice framing
framlen = 10;
M = fs*framlen/1000;
%m by Length/M The remainder of the result is
m = mod(LL,M);
if m >= M/2
x = [x,zeros(1,M-m)];
LL = length(x);
else
l = floor(LL/M);
x = x(1,1:M*l);
LL = length(x);
end
N = LL/M;
% Calculate the sound pressure level
s = zeros(1,M);
spl = zeros(1,N);
for k = 1:N
s = x((k-1)*M + 1:k*M);
spl(1,k) = SPLCal(s,fs,framlen);
end
t = 1:LL;
SPL = zeros(1,LL);
for r = 1:N
SPL(1,(r-1)*M+1:r*M) = spl(r);
end
axes(handles.axes3);
stairs(t/Fs,round(100*SPL)/100,'r');
xlabel(' Time (s)');
ylabel(' A strong voice (db)');
% --- 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)
global Fs;
global T;
global fc;
global tt;
global y;
global sy;
global LIMIT;
sound(y,Fs)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global Fs;
global T;
global fc;
global tt;
global y;
global sy;
global LIMIT;
tmps = clock;
Names = ['savewav','---',num2str(Fs),'---',num2str(fc),'---',num2str(tmps(1)),num2str(tmps(2)),num2str(tmps(3)),num2str(tmps(4)),num2str(tmps(5)),num2str(tmps(6)),'.wav'];
wavwrite(y,Fs,Names)
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
clc;
clear;
close all;
function edit4_Callback(hObject, eventdata, handles)
% hObject handle to edit4 (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,'String') returns contents of edit4 as text
% str2double(get(hObject,'String')) returns contents of edit4 as a double
% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (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
global Fs;
global T;
global fc;
global tt;
global y;
global sy;
global LIMIT;
t=(get(handles.slider1,'value'));
LIMIT = 5*round(t*17);
set(handles.text5,'String',num2str(LIMIT));
% --- Executes during object creation, after setting all properties.
function slider1_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider1 (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 slider movement.
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (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 slider2_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider2 (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 slider movement.
function slider3_Callback(hObject, eventdata, handles)
% hObject handle to slider3 (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
global Fs;
global T;
global fc;
global tt;
global y;
global sy;
global LIMIT;
t=(get(handles.slider3,'value'));
t2=floor(8*t)+1;t2
if t2==1
fc = 250;
end
if t2==2
fc = 500;
end
if t2==3
fc = 1000;
end
if t2==4
fc = 2000;
end
if t2==5
fc = 3000;
end
if t2==6
fc = 4000;
end
if t2==7
fc = 6000;
end
if t2==8
fc = 8000;
end
set(handles.text6,'String',num2str(fc));
% --- Executes during object creation, after setting all properties.
function slider3_CreateFcn(hObject, eventdata, handles)
% hObject handle to slider3 (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
4. test result
The pure tone signal to be tested is generated by the pure tone signal generation module , The results are shown in the figure below :
A03-23
边栏推荐
- OpenHarmony资源管理详解
- 2022.07.03 (lc_6111_counts the number of ways to place houses)
- 【C】 (written examination questions) pointer and array, pointer
- 【C】(笔试题)指针与数组,指针
- Hologres Query管理及超时处理
- Paxos 入门
- [untitled]
- Playwright之录制
- The performance of major mainstream programming languages is PK, and the results are unexpected
- [circuit design] optocoupler use and circuit design summary
猜你喜欢
The performance of major mainstream programming languages is PK, and the results are unexpected
程序员SQL数据脚本编码能力弱,BI做不出来怎么办?
leetcode494,474
小程序直播 + 电商,想做新零售电商就用它吧!
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
Grabbing and sorting out external articles -- status bar [4]
Insert sort of sort
leetcode518,377
"Upside down salary", "equal replacement of graduates" these phenomena show that the testing industry has
Recursive execution mechanism
随机推荐
URLs and URIs
lambda表达式
uniapp微信小程序拿来即用的瀑布流布局demo2(方法二)(复制粘贴即可使用,无需做其他处理)
Learn C language from scratch day 024
lambda expressions
P4408 [noi2003] truant children (tree diameter)
P3304 [SDOI2013]直径(树的直径)
Summer challenge brings you to play harmoniyos multi terminal piano performance
Compare whether two lists are equal
[untitled]
【FPGA教程案例9】基于vivado核的时钟管理器设计与实现
Oracle case: SMON rollback exception causes instance crash
Summary of the function and usage of const, volatile and restrict
(script) one click deployment of any version of redis - the way to build a dream
Leetcode70 (Advanced), 322
Playwright之录制
Reasons and solutions of redis cache penetration and avalanche
【报错】 “TypeError: Cannot read properties of undefined (reading ‘split‘)“
IT转测试岗,从迷茫到坚定我究竟付出了什么?
Date time type and format in MySQL