Write a program with the aim of performing an audiometry test at MATLAB. The pro
ID: 2078986 • Letter: W
Question
Write a program with the aim of performing an audiometry test at MATLAB. The program should be as interactive as possible. For example, at first, which ear is to be tested should be chosen so that the sound is only given to that channel of the ear. In addition, whether the test frequency increases automatically or manually should be asked as a parameter. The frequencies of the person being tested should be entered by the user as well as whether they are hearing or not. The sound intensity setting for each test frequency must be present in dB, and the audiometric chart should be displayed at the end of the test. The program should be prepared with MATLAB GUI.
In GUI your group name must be appear, also the frequency should be select as: [750 1000 1250 1500 1750 2000]
can you help me i want to solve this question by matlab program
Explanation / Answer
% Program for audiometry test
% You may test each ear individually and compare them.
% 1. Lower the volume on your computer until the tone prduced by the first
% push button is no longer audible. Headphones are recommended.
% 2. Click "begin test", and click the third push button whenever you hear a tone.
% 3. You can save the plot and data for comparison with others later on.
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @eartest_OpeningFcn, ...
'gui_OutputFcn', @eartest_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
clear
%clc
warning off
global heard
freqs = [750,1000,1250,1500,1750,2000];
amps = 10./(10.^((3/20)*(0:6)));
handles.response = zeros(1,6);
for f = 1:length(freqs)
for a = 1:length(amps)
if(f>1 && a < handles.response(f-1)-6)
handles.response(f)=handles.response(f-1);
continue;
end
heard = 0;
plot(freqs,handles.response)
pause(0.2+rand*0.7) %% wait for duration of tone
for wait = 1:20
pause(2/20) %% wait 2 seconds in total
if(heard == 1)
handles.response(f)=a;
break;
end
end
if(heard == 0) break; end
end
end
response_2000 = handles.response(find(freqs == 2000));
response_db = 3*(response_2000-handles.response)-4; %% threshold of hearing plot
%%semilogx(freqs,response_db) %%without polinomial fit
[P,S] = polyfit(freqs,response_db,7);
handles.smooth_response_x = 10:10:16000;
handles.smooth_response_y = polyval(P,handles.smooth_response_x);
semilogx(handles.smooth_response_x,handles.smooth_response_y)
xlabel('Frequency (Hz)')
ylabel('Threshold of Heading (dB)')
grid on
fs=4000; %sample freq in Hz
t = [0:1/fs:.5];
amp = 10./(10.^((3/20)*(0:2000)));
wave=amp.*sin(2*pi*fs*t);
envilope = sin(pi*t/t(length(t)));
wave = wave .* envilope;
%play sound
sound(wave,fs);
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.