Again, numerous changes.
Mostly figure polishing and fixing. Crucial fix to "short" invariance analysis.
This commit is contained in:
@@ -17,7 +17,7 @@ target_species = [
|
||||
'Gomphocerippus_rufus',
|
||||
'Omocestus_rufipes',
|
||||
'Pseudochorthippus_parallelus',
|
||||
][5]
|
||||
][6]
|
||||
example_file = {
|
||||
'Chorthippus_biguttulus': 'Chorthippus_biguttulus_GBC_94-17s73.1ms-19s977ms',
|
||||
'Chorthippus_mollis': 'Chorthippus_mollis_DJN_41_T28C-46s4.58ms-1m15s697ms',
|
||||
@@ -31,7 +31,7 @@ data_paths = search_files(target_species, dir='../data/processed/')
|
||||
noise_path = '../data/processed/white_noise_sd-1.npz'
|
||||
ref_path = '../data/inv/short/ref_measures.npz'
|
||||
pre_stages = ['filt', 'env']
|
||||
stages = pre_stages + ['conv', 'feat']
|
||||
stages = pre_stages + ['inv', 'conv', 'feat']
|
||||
save_path = '../data/inv/short/'
|
||||
|
||||
# ANALYSIS SETTINGS:
|
||||
@@ -98,6 +98,7 @@ for data_path, name in zip(data_paths, crop_paths(data_paths)):
|
||||
measures = dict(
|
||||
measure_filt=np.zeros(shape_low, dtype=float),
|
||||
measure_env=np.zeros(shape_low, dtype=float),
|
||||
measure_inv=np.zeros(shape_low, dtype=float),
|
||||
measure_conv=np.zeros(shape_high, dtype=float),
|
||||
measure_feat=np.zeros(shape_high, dtype=float)
|
||||
)
|
||||
@@ -108,6 +109,7 @@ for data_path, name in zip(data_paths, crop_paths(data_paths)):
|
||||
snippets = dict(
|
||||
snip_filt=np.zeros(shape_low, dtype=float),
|
||||
snip_env=np.zeros(shape_low, dtype=float),
|
||||
snip_inv=np.zeros(shape_low, dtype=float),
|
||||
snip_conv=np.zeros(shape_high, dtype=float),
|
||||
snip_feat=np.zeros(shape_high, dtype=float)
|
||||
)
|
||||
@@ -124,7 +126,9 @@ for data_path, name in zip(data_paths, crop_paths(data_paths)):
|
||||
signal=scaled, rate=rate)
|
||||
|
||||
# Process mixture further:
|
||||
signals['conv'] = convolve_kernels(signals['env'], config['kernels'], config['k_specs'])
|
||||
signals['inv'] = sosfilter(signals['env'], rate, config['inv_fcut'], 'hp',
|
||||
padtype='constant', padlen=config['padlen'])
|
||||
signals['conv'] = convolve_kernels(signals['inv'], config['kernels'], config['k_specs'])
|
||||
signals['feat'] = sosfilter((signals['conv'] > config['feat_thresh']).astype(float),
|
||||
rate, config['feat_fcut'], 'lp',
|
||||
padtype='fixed', padlen=config['padlen'])
|
||||
|
||||
Reference in New Issue
Block a user