Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DOA4Seminars
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joanna Luberadzka
DOA4Seminars
Commits
e6100f38
Commit
e6100f38
authored
Nov 14, 2017
by
Joanna Luberadzka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjusting levels!
parent
9564d0d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
4 deletions
+39
-4
afc/compute_snr_signals.m
afc/compute_snr_signals.m
+27
-0
afc/experimentDOA_cfg.m
afc/experimentDOA_cfg.m
+3
-0
afc/experimentDOA_set.m
afc/experimentDOA_set.m
+2
-2
afc/experimentDOA_user.m
afc/experimentDOA_user.m
+7
-2
No files found.
afc/compute_snr_signals.m
0 → 100644
View file @
e6100f38
function
[
sig
,
noise
]
=
compute_snr_signals
(
SNR
,
signal
,
noise
,
L_sig
)
% INPUT:
% SNR - desired SNR
% signal - target signal
% noise - noise signal
% L_sig - desired level of the target signal
% what is the rms level of the original signal
L_old
=
20
*
log10
(
rms
(
signal
)/(
2
*
10
^-
5
));
% change the level to desired level
v_signal_new
=
signal
*
10
^
((
L_sig
-
L_old
)/
20
);
% compute gain for the noise
P_sig
=
sum
(
mean
(
v_signal_new
.^
2
));
P_noise
=
sum
(
mean
(
noise
.^
2
));
G
=
P_sig
/(
10
^
(
SNR
/
10
));
G
=
sqrt
(
G
/
P_noise
);
noise
=
noise
*
G
;
sig
=
v_signal_new
;
% L_sig=20*log10(rms(sig)/(2*10^-5));
% L_noise=20*log10(rms(noise)/(2*10^-5));
end
\ No newline at end of file
afc/experimentDOA_cfg.m
View file @
e6100f38
...
...
@@ -2,6 +2,9 @@
%
% This matlab skript is called by afc_main when starting
% the experiment 'experimentDOA_cfg'.
%
% afc('main','experimentDOA','joa','10deg','ollo_male','white');
%
% experimentDOA_cfg constructs a structure 'def' containing the complete
% configuration for the experiment.
% To design an own experiment, e.g., 'myexperiment'
...
...
afc/experimentDOA_set.m
View file @
e6100f38
...
...
@@ -62,7 +62,7 @@ end
% define the calibration level (assume 90 dB SPL for 0 dB FS)
work
.
currentCalLevel
=
90
;
setup
.
level
=
4
0
;
setup
.
level
=
5
0
;
% define signals in structure setup
% setup.modsine = sin([0:def.intervallen-1]'*2*pi*work.exppar1/def.samplerate);
...
...
@@ -78,7 +78,7 @@ addpath(genpath(def.hrirdir))
% create a cell array which has the same lenght as
% the number of referece angles that we want to test
setup
.
HRIRs
=
cell
(
length
(
def
.
exppar1
),
1
)
setup
.
HRIRs
=
cell
(
length
(
def
.
exppar1
),
1
)
% [0 45 90];
for
k
=
1
:
length
(
setup
.
HRIRs
)
%load the hrir for the reference angle
setup
.
HRIRs
{
k
}
.
hrir_ref
=
loadHRIR
(
'Anechoic'
,
80
,
0
,
def
.
exppar1
(
k
),
'in-ear'
)
...
...
afc/experimentDOA_user.m
View file @
e6100f38
...
...
@@ -50,8 +50,13 @@ fullWavFileName = fullfile([setup.filedir, baseWavFileName]);
% resample the signal
[
P
,
Q
]
=
rat
(
def
.
samplerate
/
fssig
);
sig
=
resample
(
sig
,
P
,
Q
);
sig_level
=
work
.
expvaract
;
sig
=
sig
.*
10
^
((
sig_level
-
work
.
currentCalLevel
)/
20
);
% sig=sig.*10^((sig_level - work.currentCalLevel)/20);
L_rms
=
(
20
*
log10
(
rms
(
sig
(:,
1
)
+
sig
(:,
2
))/(
2
*
10
^-
5
)));
L_des
=
work
.
expvaract
;
sig
=
sig
*
10
^
((
L_des
-
L_rms
)/
20
);
L_rms_check1
=
(
20
*
log10
(
rms
(
sConf
.
sig11
(:,
1
)
+
sConf
.
sig11
(:,
2
))/(
2
*
10
^-
5
)));
% choose hrir:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment