FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
eeg-101/python_tools/SamplingRateTest.py at master · NeuroTechX/eeg-101 · GitHub
This repository was archived by the owner on Apr 13, 2021. It is now read-only.
NeuroTechX
eeg-101
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
eeg-101
/
python_tools
/
SamplingRateTest.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (26 loc) · 1 KB
Breadcrumbs
eeg-101
/
python_tools
/
SamplingRateTest.py
Copy path
File metadata and controls
33 lines (26 loc) · 1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
pandas
as
pd
import
numpy
as
np
import
matplotlib
.
pyplot
as
plt
import
argparse
import
sys
# Calculates sampling rate and plots 4 channel specgram of EEG data.csv passed in as in command line arg
eegData
=
pd
.
read_csv
(
sys
.
argv
[
1
])
#eegData = pd.read_csv('Filtered_EEG3.csv')
time
=
(
eegData
[
'Timestamp (ms)'
][
eegData
.
shape
[
0
]
-
1
]
-
eegData
[
'Timestamp (ms)'
][
0
])
/
1000
samples
=
eegData
.
shape
[
0
]
-
1
samplingRate
=
samples
/
time
print
(
'estimated sampling rate: '
,
samplingRate
)
plt
.
figure
()
plt
.
subplot
(
2
,
2
,
1
)
plt
.
specgram
(
eegData
[
'Electrode 1'
],
Fs
=
samplingRate
,
interpolation
=
'bilinear'
,
noverlap
=
198
)
plt
.
ylim
(
0
,
65
)
plt
.
subplot
(
2
,
2
,
2
)
plt
.
specgram
(
eegData
[
'Electrode 2'
],
Fs
=
samplingRate
,
interpolation
=
'bilinear'
,
noverlap
=
198
)
plt
.
ylim
(
0
,
65
)
plt
.
subplot
(
2
,
2
,
3
)
plt
.
specgram
(
eegData
[
'Electrode 3'
],
Fs
=
samplingRate
,
interpolation
=
'bilinear'
,
noverlap
=
198
)
plt
.
ylim
(
0
,
65
)
plt
.
subplot
(
2
,
2
,
4
)
plt
.
specgram
(
eegData
[
'Electrode 4'
],
Fs
=
samplingRate
,
interpolation
=
'bilinear'
,
noverlap
=
198
)
plt
.
ylim
(
0
,
65
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL