-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats_rate_level.py
47 lines (33 loc) · 947 Bytes
/
stats_rate_level.py
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This demo shows how to calculate rate-level characteristic of a
model.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import matplotlib.pyplot as plt
import cochlea
from cochlea.stats import calc_rate_level
# import cochlea.external
def main():
# rates = calc_rate_level(
# model=cochlea.run_holmberg2007,
# cf=cochlea.get_nearest_cf_holmberg2007(1000),
# model_pars={'fs': 48e3, 'syn_mode': 'quantal'},
# )
rates = calc_rate_level(
model=cochlea.run_zilany2014,
cf=1000,
model_pars={'fs': 100e3, 'species': 'human'}
)
# rates = calc_rate_level(
# model=cochlea.external.run_matlab_auditory_periphery,
# cf=1000,
# model_pars={'fs': 48e3}
# )
print(rates)
rates.plot()
plt.legend()
plt.show()
if __name__ == "__main__":
main()