-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinal_full_pipeline.py
More file actions
58 lines (55 loc) · 2.45 KB
/
final_full_pipeline.py
File metadata and controls
58 lines (55 loc) · 2.45 KB
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
from auditory_model.src.modules.gammatone_filterbank import GammatoneFilterbank
from auditory_model.src.modules.neurons.izhikevich import MultiChannelIzhikevichModel
from auditory_model.src.modules.neurons.spike_detection import ConstantSpikeThresholding
from auditory_model.src.modules.plots.multi_psth import MultiHistogramPlotter
from auditory_model.src.modules.plots.plot_raw_signal import PlotRawSignal
from auditory_model.src.modules.preprocess import PreprocessLoadAudioLibrosa
from auditory_model.src.modules.utils.aggregation import AggregatePerChannel
from auditory_model.src.modules.utils.caching_module import OutputCachingModule
from auditory_model.src.modules.utils.sample_generator import SampleRunGenerator
from auditory_model.src.runner import Config
from auditory_model.src.modules.hair_cells import HairCellModule
plot_channels = [0, 5, 12, 30]
plot_channel = 5
plot_time_window = (1 / 440) * 10 # 10 ms for a 440 Hz tone
Config(
audio_file="sounds/kuckuck.wav",
run_name="präsi-kuckuck",
pipeline=[
OutputCachingModule(
sub_modules=[
PreprocessLoadAudioLibrosa(
add_empty_sound_before_in_ms=200,
add_empty_sound_after_in_ms=100,
use_db_spl_scaling=True,
db_level=80,
),
PlotRawSignal(file_name="preprocessed_signal.png"),
GammatoneFilterbank(
output_path="basilar_membrane.png",
plot_channels=plot_channels,
plot_time_window=plot_time_window,
),
HairCellModule(
plot_channel=plot_channel,
plot_channels=plot_channels,
plot_time_window=plot_time_window,
output_path="izhikevich_transformation.png",
),
PlotRawSignal(file_name="Mili wolt.png"),
SampleRunGenerator(
sub_modules=[
MultiChannelIzhikevichModel(
plot_channels=plot_channels,
),
ConstantSpikeThresholding(),
],
n_samples=50,
),
AggregatePerChannel(),
]
),
# ProcessSequenceItems(sub_modules=[HistogramPlotter.psth()]),
MultiHistogramPlotter.multi_psth(plot_channels=plot_channels),
],
).run()