-
Notifications
You must be signed in to change notification settings - Fork 1
/
params_virilis.m
178 lines (131 loc) · 5.74 KB
/
params_virilis.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
function segParams = params_virilis(fs)
%Creates parameters data structure
%Input:
% fs -> Data sampling frequency (default = 10000)
%
%Output:
% segParams -> struct containing parameters used in model building and fitting
%
% (C) Gordon J. Berman, Jan Clemens, Kelly M. LaRue, and Mala Murthy, 2015
% Princeton University
if nargin < 1 || isempty(fs)
fs = 10000;
end
%%%%%%%%%%%%%%ALL USER DEFINED PARAMETERS ARE SET HERE%%%%%%%%%%%%%%%%%%%%%
%frequencies to use (don't change unless you want to re-run the likelihood
%models)
fc = 100:20:900;
%factor for computing window around pulse peak
%(this determines how much of the signal before and after the peak
%is included in the pulse, and sets the parameters w0 and w1.)
pulseWindow = round(fs/25);
%factor times the mean of xempty - only pulses larger than
%this amplitude are counted as true pulses
noiseFactor = 1;
%male pulse carrier frequency
mpf = 350;
%100Hz lowpass filter for male pulse detection
male = 100;
%40Hz lowpass filter for female pulse detection
female = 40;
%20Hz lowpass filter for male song bout detection
bout = 20;
%male bout detection based on IPI, in samples
male_IPI = 250;
%Smoothing parameter for data
filterWindow = 5;
%%%%%%%%%%%%%%%%%%%%%%%
%Threshold for P(both singing | data)
probThreshold = 1;
%Male probability threshold
maleThreshold = .2;
%minimum size of a female pulse in the midst of a male pulse (in data
%points)
minFemalePulseSize = 150;
%number of PCA modes to use in analysis (3 -> 41)
probModes = 20;
%Pnoise < noiseThreshold to count as signal
noiseThreshold = .5;
%minimum percentage of time where p(male) > p(female) in order for the bout
%to be counted as male (***)
minMaleBoutFraction = 1/5;
%Number of time points over which to test male activity (i is called male if
%the number of initially called male frames is greater than
%minMaleBoutFraction*maleTestDuration points over
%(i-maleTestDuration):(i+maleTestDuration)
maleTestDuration = 500;
%minimum duration for a bout to be called a male bout (in time points) (***)
minMaleDuration = 1000;
%Smoothing parameter for male and combination song likelihoods (***)
smoothParameter_male = 25;
%Smoothing parameter for female and nosie song likelihoods (***)
smoothParameter_female = 50;
%Smoothing parameter for female and nosie song likelihoods
smoothParameter_amplitudes = 25;
%Threshold for amplitude
amplitudeThreshold = .1;
%Threshold for for noise likelihood (***)
%(smaller = more stringent, do not make lower than -5490, must be changed if probModes is changed)
noiseLikelihoodThreshold = 0;
%Threshold for calling the posterior value noise (between 0 and 1).
%Closer to 1 implies a more stringent cut-off
ampPostThreshold = .95;
%Maximum noise data set from which to create noise models
maxNumNoise = 500000;
%Maximum number of peaks to create GMM noise distribution PDF
maxNumPeaks = 4;
%Maximum number of peaks to create GMM noise distribution PDF for the first
%mode
maxNumPeaks_firstMode = 6;
%Number of PDF modes used to find female bouts within male bouts
num_male_both_modes = 5;
%Definition of closeness for female peak elimination (in ms)
female_IPI_limit = 26;
%Num of consecutive close female peaks needed for elimination (should be
%odd)
num_female_IPI_limit = 3;
%Length of time (in seconds)
stop_recording_time = 140;
%Whether or not to refine probabilities using the PDF projection theorem
usePDFProjections = false;
%Maximum number of data to use in GMM fitting of projection distributions
maxNumGMM = 10000;
%Number of replicates to use in GMM fits
gmm_replicates = 3;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
segParams.maxNumGMM = maxNumGMM;
segParams.gmm_replicates = gmm_replicates;
segParams.fc = fc;
segParams.fs = fs;
segParams.dt = 1/fs;
segParams.pulsewindow = pulseWindow;
segParams.noiseFactor = noiseFactor;
segParams.mpf = mpf;
segParams.male = male;
segParams.female = female;
segParams.bout = bout;
segParams.male_IPI = male_IPI;
segParams.probThreshold = probThreshold;
segParams.minFemalePulseSize = minFemalePulseSize;
segParams.filterWindow = filterWindow;
segParams.probModes = probModes;
segParams.noiseThreshold = noiseThreshold;
segParams.minMaleBoutFraction = minMaleBoutFraction;
segParams.minMaleDuration = minMaleDuration;
segParams.smoothParameter_male = smoothParameter_male;
segParams.smoothParameter_female = smoothParameter_female;
segParams.smoothParameter_amplitudes = smoothParameter_amplitudes;
segParams.amplitudeThreshold = amplitudeThreshold;
segParams.noiseLikelihoodThreshold = noiseLikelihoodThreshold;
segParams.maleThreshold = maleThreshold;
segParams.ampPostThreshold = ampPostThreshold;
segParams.maxNumNoise = maxNumNoise;
segParams.maxNumPeaks = maxNumPeaks;
segParams.maxNumPeaks_firstMode = maxNumPeaks_firstMode;
segParams.num_male_both_modes = num_male_both_modes;
segParams.female_IPI_limit = female_IPI_limit;
segParams.num_female_IPI_limit = num_female_IPI_limit;
segParams.stop_recording_time = stop_recording_time;
segParams.usePDFProjections = usePDFProjections;
segParams.maleTestDuration = maleTestDuration;