Skip to content

Commit e4ffc49

Browse files
committed
+ donate link
1 parent d02f3a9 commit e4ffc49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+714
-74
lines changed

Diff for: .ipynb_checkpoints/HH_functions-checkpoint.py

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import numpy as np
2+
import math
3+
4+
def alphaM(V):
5+
return (2.5-0.1*(V+65)) / (np.exp(2.5-0.1*(V+65)) -1)
6+
7+
def betaM(V):
8+
return 4*np.exp(-(V+65)/18)
9+
10+
def alphaH(V):
11+
return 0.07*np.exp(-(V+65)/20)
12+
13+
def betaH(V):
14+
return 1/(np.exp(3.0-0.1*(V+65))+1)
15+
16+
def alphaN(V):
17+
return (0.1-0.01*(V+65)) / (np.exp(1-0.1*(V+65)) -1)
18+
19+
def betaN(V):
20+
return 0.125*np.exp(-(V+65)/80)
21+
22+
def HH(I0,T0):
23+
dt = 0.01;
24+
T = math.ceil(T0/dt) # [ms]
25+
gNa0 = 120 # [mS/cm^2]
26+
ENa = 115; # [mV]
27+
gK0 = 36; # [mS/cm^2]
28+
EK = -12; # [mV]
29+
gL0 = 0.3; # [mS/cm^2]
30+
EL = 10.6; # [mV]
31+
32+
t = np.arange(0,T)*dt
33+
V = np.zeros([T,1])
34+
m = np.zeros([T,1])
35+
h = np.zeros([T,1])
36+
n = np.zeros([T,1])
37+
38+
V[0]=-70.0
39+
m[0]=0.05
40+
h[0]=0.54
41+
n[0]=0.34
42+
43+
for i in range(0,T-1):
44+
V[i+1] = V[i] + dt*(gNa0*m[i]**3*h[i]*(ENa-(V[i]+65)) + gK0*n[i]**4*(EK-(V[i]+65)) + gL0*(EL-(V[i]+65)) + I0);
45+
m[i+1] = m[i] + dt*(alphaM(V[i])*(1-m[i]) - betaM(V[i])*m[i]);
46+
h[i+1] = h[i] + dt*(alphaH(V[i])*(1-h[i]) - betaH(V[i])*h[i]);
47+
n[i+1] = n[i] + dt*(alphaN(V[i])*(1-n[i]) - betaN(V[i])*n[i]);
48+
return V,m,h,n,t

Diff for: 01.ipynb

+9
Original file line numberDiff line numberDiff line change
@@ -32472,6 +32472,15 @@
3247232472
"ylabel('Voltage [$\\mu$ V]') # Wrap latex characters in $..$\n",
3247332473
"show()"
3247432474
]
32475+
},
32476+
{
32477+
"cell_type": "markdown",
32478+
"metadata": {},
32479+
"source": [
32480+
"<a id=\"donate\"></a>\n",
32481+
"## Donate\n",
32482+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
32483+
]
3247532484
}
3247632485
],
3247732486
"metadata": {

Diff for: 01.md

+4
Original file line numberDiff line numberDiff line change
@@ -952,3 +952,7 @@ xlabel('Time [s]')
952952
ylabel('Voltage [$\mu$ V]') # Wrap latex characters in $..$
953953
show()
954954
```
955+
956+
<a id="donate"></a>
957+
## Donate
958+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.

Diff for: 02.ipynb

+11-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
" * [Comparing ERPs](#comparing-erps)\n",
3838
" * [Confidence Intervals for the ERP (Method 2)](#cis-m2)\n",
3939
" * [A Bootstrap Test to Compare ERPs](#bootstrap)\n",
40-
"* [Summary](#summary)"
40+
"* [Summary](#summary)\n",
41+
"* [Donate](#donate)"
4142
]
4243
},
4344
{
@@ -2329,6 +2330,15 @@
23292330
"source": [
23302331
"[Return to top](#introduction)"
23312332
]
2333+
},
2334+
{
2335+
"cell_type": "markdown",
2336+
"metadata": {},
2337+
"source": [
2338+
"<a id=\"donate\"></a>\n",
2339+
"## Donate\n",
2340+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
2341+
]
23322342
}
23332343
],
23342344
"metadata": {

Diff for: 02.md

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ _**Synopsis**_
4040
* [Confidence Intervals for the ERP (Method 2)](#cis-m2)
4141
* [A Bootstrap Test to Compare ERPs](#bootstrap)
4242
* [Summary](#summary)
43+
* [Donate](#donate)
4344

4445
+++
4546

@@ -997,3 +998,9 @@ Finally, we assessed whether the two ERPs from condition A and condition B diffe
997998
+++
998999

9991000
[Return to top](#introduction)
1001+
1002+
+++
1003+
1004+
<a id="donate"></a>
1005+
## Donate
1006+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.

Diff for: 03.ipynb

+10
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
" 5. [Decibel scaling](#decibel-scaling)\n",
4444
" 6. [The spectrogram](#the-spectrogram)\n",
4545
"* [Summary](#summary)\n",
46+
"* [Donate](#donate)\n",
4647
"---\n",
4748
"* [Supplements](#supplements)\n",
4849
" 1. [Biased versus unbiased autocovariance](#supplement-acv)\n",
@@ -1969,6 +1970,15 @@
19691970
"[Return to top](#top)"
19701971
]
19711972
},
1973+
{
1974+
"cell_type": "markdown",
1975+
"metadata": {},
1976+
"source": [
1977+
"<a id=\"donate\"></a>\n",
1978+
"## Donate\n",
1979+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
1980+
]
1981+
},
19721982
{
19731983
"cell_type": "markdown",
19741984
"metadata": {},

Diff for: 03.md

+7
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ _**Synopsis**_
4545
5. [Decibel scaling](#decibel-scaling)
4646
6. [The spectrogram](#the-spectrogram)
4747
* [Summary](#summary)
48+
* [Donate](#donate)
4849
---
4950
* [Supplements](#supplements)
5051
1. [Biased versus unbiased autocovariance](#supplement-acv)
@@ -910,6 +911,12 @@ In this notebook, we only touched the surface of spectral analysis; many details
910911

911912
+++
912913

914+
<a id="donate"></a>
915+
## Donate
916+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.
917+
918+
+++
919+
913920
---
914921

915922
+++

Diff for: 04.ipynb

+10
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
" 4. [Beyond the Hanning Taper—the Multitaper Method](#multitaper)\n",
3838
" 5. [Confidence Intervals of the Spectrum](#ci)\n",
3939
"* [Summary](#summary)\n",
40+
"* [Donate](#donate)\n",
4041
"* [Appendix: Multiplication and Convolution in Different Domains](#appendix)"
4142
]
4243
},
@@ -1298,6 +1299,15 @@
12981299
"[Return to top](#top)"
12991300
]
13001301
},
1302+
{
1303+
"cell_type": "markdown",
1304+
"metadata": {},
1305+
"source": [
1306+
"<a id=\"donate\"></a>\n",
1307+
"## Donate\n",
1308+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
1309+
]
1310+
},
13011311
{
13021312
"cell_type": "markdown",
13031313
"metadata": {},

Diff for: 04.md

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ _**Synopsis**_
3939
4. [Beyond the Hanning Taper—the Multitaper Method](#multitaper)
4040
5. [Confidence Intervals of the Spectrum](#ci)
4141
* [Summary](#summary)
42+
* [Donate](#donate)
4243
* [Appendix: Multiplication and Convolution in Different Domains](#appendix)
4344

4445
+++
@@ -774,6 +775,12 @@ and <a href="http://www.cambridge.org/us/catalogue/catalogue.asp?isbn=9780521880
774775

775776
+++
776777

778+
<a id="donate"></a>
779+
## Donate
780+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.
781+
782+
+++
783+
777784
<a id="appendix"></a>
778785
## Appendix: Multiplication and Convolution in Different Domains
779786

Diff for: 05.ipynb

+11-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
" * [Visualizing the Phase Difference across Trials](#Visualizing_the_Phase_Difference)\n",
4747
" * [Single-Trial Coherence](#single_trial_coherence)\n",
4848
"* [Relation between Statistical Modeling and Coherence](#Relation_between_Statistical_Modeling_and_Coherence)\n",
49-
"* [Summary](#summary)"
49+
"* [Summary](#summary)\n",
50+
"* [Donate](#summary)"
5051
]
5152
},
5253
{
@@ -1550,6 +1551,15 @@
15501551
"\n",
15511552
"- <a href=\"http://numerical.recipes/\" rel=\"external\">Numerical recipes</a>"
15521553
]
1554+
},
1555+
{
1556+
"cell_type": "markdown",
1557+
"metadata": {},
1558+
"source": [
1559+
"<a id=\"donate\"></a>\n",
1560+
"## Donate\n",
1561+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
1562+
]
15531563
}
15541564
],
15551565
"metadata": {

Diff for: 05.md

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ _**Synopsis**_
4949
* [Single-Trial Coherence](#single_trial_coherence)
5050
* [Relation between Statistical Modeling and Coherence](#Relation_between_Statistical_Modeling_and_Coherence)
5151
* [Summary](#summary)
52+
* [Donate](#summary)
5253

5354
+++
5455

@@ -1078,3 +1079,9 @@ As is true for the Fourier transform and spectrum, there exists a vast literatur
10781079
- <a href="https://www.elsevier.com/books/spectral-analysis-and-time-series-two-volume-set/priestley/978-0-08-057055-6" rel="external">Priestly, 1982</a>
10791080

10801081
- <a href="http://numerical.recipes/" rel="external">Numerical recipes</a>
1082+
1083+
+++
1084+
1085+
<a id="donate"></a>
1086+
## Donate
1087+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.

Diff for: 06.ipynb

+8-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
" 4. [More Sophisticated Filtering](#advanced-filters)\n",
4141
" 5. [What’s Phase Got to Do with It?](#phase)\n",
4242
" 6. [Analysis of the Filtered EEG Data](#analysis)\n",
43-
"* [Summary](#summary)"
43+
"* [Summary](#summary)\n",
44+
"* [Donate](#donate)"
4445
]
4546
},
4647
{
@@ -2233,11 +2234,13 @@
22332234
]
22342235
},
22352236
{
2236-
"cell_type": "code",
2237-
"execution_count": null,
2237+
"cell_type": "markdown",
22382238
"metadata": {},
2239-
"outputs": [],
2240-
"source": []
2239+
"source": [
2240+
"<a id=\"donate\"></a>\n",
2241+
"## Donate\n",
2242+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
2243+
]
22412244
}
22422245
],
22432246
"metadata": {

Diff for: 06.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ _**Synopsis**_
4343
5. [What’s Phase Got to Do with It?](#phase)
4444
6. [Analysis of the Filtered EEG Data](#analysis)
4545
* [Summary](#summary)
46+
* [Donate](#donate)
4647

4748
+++
4849

@@ -1226,6 +1227,8 @@ The design and application of filters is an enormous and rich field of study. Th
12261227

12271228
[Back to Top](#top)
12281229

1229-
```{code-cell} ipython3
1230+
+++
12301231

1231-
```
1232+
<a id="donate"></a>
1233+
## Donate
1234+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.

Diff for: 07.ipynb

+10-7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
" 3. [Determine if the phase and amplitude are related](#step3)\n",
3636
" * [The phase-amplitude plot](#m1) \n",
3737
"* [Summary](#summary)\n",
38+
"* [Donate](#donate)\n",
3839
"* [Appendix](#appendix)"
3940
]
4041
},
@@ -1277,6 +1278,15 @@
12771278
"In developing these approaches, we utilized expertise and procedures developed in other modules. In particular, we relied on the notions of frequency and power, amplitude and phase, filtering, and resampling. Such a multifaceted approach is typical in analysis of neural data, where we leverage the skills developed in analyzing other datasets."
12781279
]
12791280
},
1281+
{
1282+
"cell_type": "markdown",
1283+
"metadata": {},
1284+
"source": [
1285+
"<a id=\"donate\"></a>\n",
1286+
"## Donate\n",
1287+
"If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href=\"https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U\">here</a>."
1288+
]
1289+
},
12801290
{
12811291
"cell_type": "markdown",
12821292
"metadata": {},
@@ -1328,13 +1338,6 @@
13281338
"\n",
13291339
"This time domain representation of the HIlbert Transform is equivalent to the frequency domain representation. However, the time domain representation is much less intuitive. Compare the previous equation to the statement, \"*The Hilbert Transform is a 90-degree phase shift in the frequency domain.*\" The latter, we propose, is much more intuitive."
13301340
]
1331-
},
1332-
{
1333-
"cell_type": "code",
1334-
"execution_count": null,
1335-
"metadata": {},
1336-
"outputs": [],
1337-
"source": []
13381341
}
13391342
],
13401343
"metadata": {

Diff for: 07.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ _**Synopsis**_
4040
3. [Determine if the phase and amplitude are related](#step3)
4141
* [The phase-amplitude plot](#m1)
4242
* [Summary](#summary)
43+
* [Donate](#donate)
4344
* [Appendix](#appendix)
4445

4546
+++
@@ -591,6 +592,12 @@ In developing these approaches, we utilized expertise and procedures developed i
591592

592593
+++
593594

595+
<a id="donate"></a>
596+
## Donate
597+
If you enjoy Case-Studies-Python, and would like to share your enjoyment with us, sponsor our coffee consuption <a href="https://www.paypal.com/donate/?hosted_button_id=DL8P5ZGS9962U">here</a>.
598+
599+
+++
600+
594601
<a id="appendix"></a>
595602
## Appendix: Hilbert Transform in the Time Domain
596603

@@ -637,7 +644,3 @@ $$
637644
$$
638645

639646
This time domain representation of the HIlbert Transform is equivalent to the frequency domain representation. However, the time domain representation is much less intuitive. Compare the previous equation to the statement, "*The Hilbert Transform is a 90-degree phase shift in the frequency domain.*" The latter, we propose, is much more intuitive.
640-
641-
```{code-cell} ipython3
642-
643-
```

0 commit comments

Comments
 (0)