Skip to content

Commit

Permalink
Add missing test signals for AFE DEMO scripts and fixed a few AFE bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Sep 14, 2015
1 parent 753dada commit 798fb12
Show file tree
Hide file tree
Showing 27 changed files with 46 additions and 34 deletions.
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/src/Signals/ModulationSignal.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
% Minimum ratemap floor to limit dynamic range
minValdB = -(maxDynamicRangedB + (0 - maxValdB));

rangedB = [quant(minValdB,5) quant(maxValdB,5)];
rangedB = [round(minValdB/5)*5 round(maxValdB/5)*5];

rsAMS(end+1,:,:) = NaN; % insert borders

Expand Down
7 changes: 6 additions & 1 deletion AuditoryFrontEnd/src/Tools/detectOnsetsOffsets.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@
%
% Extract connected onset or offset fronts which spread across at least
% 'minOnsetSpread' adjacent channels.
[L,nFragments] = bwlabel(bActivity,8);
if ~license('test', 'image_toolbox')
error(['Sorry, but the Image Processing Toolbox is required to ',...
'extract coherent onsets and offsets.']);
else
[L,nFragments] = bwlabel(bActivity,8);
end

% Loop over number of connected fragments
for ii = 1 : nFragments
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_AMS.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on the right ear signal
dObj = dataObject(earSignals(:,2),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_Adaptation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22495,2),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_Autocorrelation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:20E3,2),fsHz);
Expand Down
6 changes: 3 additions & 3 deletions AuditoryFrontEnd/test/DEMO_ChunkBased.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
clear all
close all
clear;
close all;

% This script illustrates the chunk-based compatibility of the AFE framework with
% arbitrary chunk size.
% It goes along the description in section 2.4 of the user manual (Deliverable 2.2)

% Loading a signal
load('TestBinauralCues');
load('Test_signals/AFE_earSignals_16kHz');
sIn = earSignals;
clear earSignals

Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_Crosscorrelation.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the ear signals
dObj = dataObject(earSignals(1:20E3,:),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_DRNL.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Take single channel (1- Left or 2 - Right)
earSignal = earSignals(:,2);
Expand Down
6 changes: 3 additions & 3 deletions AuditoryFrontEnd/test/DEMO_GaborFeatures.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22495,2),fsHz);
Expand Down Expand Up @@ -53,10 +53,10 @@
% Ratemap
dObj.ratemap{1}.plot;
set(gca,'YTick',5:5:20,'YTickLabel',num2str((5:5:20)'))
ylabel('\# channels')
ylabel('# channels')


% Gabor features
dObj.gabor{1}.plot;



2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_Gammatone.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22495,2),fsHz);
Expand Down
4 changes: 2 additions & 2 deletions AuditoryFrontEnd/test/DEMO_IC.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
%
%
% Load anechoic signal
load('DEMO_Speech_Anechoic');
load('Test_signals/DEMO_Speech_Anechoic');

% Create a data object based on the ear signals
dObj1 = dataObject(earSignals(1:22494,:),fsHz);

% Load erverberant signal
load('DEMO_Speech_Room_D');
load('Test_signals/DEMO_Speech_Room_D');

% Create a data object based on the ear signals
dObj2 = dataObject(earSignals(1:22494,:),fsHz);
Expand Down
4 changes: 2 additions & 2 deletions AuditoryFrontEnd/test/DEMO_IHC.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22495,2),fsHz);
Expand Down Expand Up @@ -58,4 +58,4 @@

% Plot IHC responses
dObj.innerhaircell{1}.plot([],p);
title('IHC signal')
title('IHC signal')
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_ILD.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on the ear signals
dObj = dataObject(earSignals(1:22494,:),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_ITD.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on the ear signals
dObj = dataObject(earSignals(1:22494,:),fsHz);
Expand Down
5 changes: 3 additions & 2 deletions AuditoryFrontEnd/test/DEMO_ObjectOriented.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
% - Feedback handling
%

% clear all
clear
close all
clc

Expand All @@ -28,7 +28,8 @@


% Load a signal
load('TestBinauralCues');
load('Test_signals/AFE_earSignals_16kHz');


%% 1- Basic advantages of object-oriented approach:
% Extraction of inner hair-cell envelope for a single audio channel
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_OffsetStrength.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22494,2),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_OnsetOffsetMaps.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22494,2),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_OnsetStrength.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22494,2),fsHz);
Expand Down
6 changes: 3 additions & 3 deletions AuditoryFrontEnd/test/DEMO_Pitch.m
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
clear;
close all
clc
close all;
clc;


%% LOAD SIGNAL
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:20E3,2),fsHz);
Expand Down
4 changes: 2 additions & 2 deletions AuditoryFrontEnd/test/DEMO_PreProcessing.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% clear;
clear;
close all
clc

Expand All @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Replicate signals at a higher level
earSignals = cat(1,earSignals(1:22495,:),5*earSignals(1:22495,:))/5;
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_Ratemap.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22495,2),fsHz);
Expand Down
2 changes: 1 addition & 1 deletion AuditoryFrontEnd/test/DEMO_SpectralFeatures.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
%
%
% Load a signal
load('AFE_earSignals_16kHz');
load('Test_signals/AFE_earSignals_16kHz');

% Create a data object based on parts of the right ear signal
dObj = dataObject(earSignals(1:22495,2),fsHz);
Expand Down
4 changes: 2 additions & 2 deletions AuditoryFrontEnd/test/DEMO_feedback.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
% This script demonstrates feedback capabilities by computing the ratemap of a pure sine
% wave with an auditory filterbank of filters of increasing bandwidth

clear all
close all
clear;
close all;


% Request and parameters for feature extraction
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions AuditoryFrontEnd/test/Test_signals/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Two!Ears Auditory Front-End basic test signals
==============================================

This folder contains a few test signals used in demo
scripts, where actual signals from other Two!Ears model
parts are not required.

0 comments on commit 798fb12

Please sign in to comment.