Comments (6)
in DataserToSpectogram.py line 205
Actually, it is in line 138 :)
What does 50 mean...?
It's an arbitrary number to save the spectrograms in multiple files. Save all the spectrograms together will create huge files so I decided to save them in groups of 50. Every time I created 50 spectrograms I save them in a file.
from cnns-on-chb-mit.
Thank you. I added comments to cause the wrong number of lines.
I'm not very good at processing eeg data.I understand that 50 is batchsize, right?
I want to change 50 to 1, so that I can store one time domain diagram at a time. Is that right? How can I implement it? What are the related parts?
from cnns-on-chb-mit.
50
is the number of spectrograms to save for each files. If you save 1 per file you will have thousands of files. You can use any number but I would suggest not too small(you will have a lot of files) and not too big(you will have a few files but huge ones).
The DataserToSpectogram.py
is used to pre-process the data and produce the spectograms.
from cnns-on-chb-mit.
Thank you.
from cnns-on-chb-mit.
signals = np.zeros((22, 59, 114))
I have another question, thank you. May I ask what represents 59 and 114 respectively in the createSpectrogram function? What do they mean? How do you calculate it๏ผIs 114 the frequency? What does 59 stand for? Should it be 30 seconds? If 59 is time, 114 is frequency, but I don't see where the STFT is used.
Forgive me, I don't understand how to generate the dimensions of 114, if 114 represents frequency then it should be the dimensions generated from the raw data. Please tell me how this part works. Thank you.
from cnns-on-chb-mit.
I suggest you to read Creation of the spectrograms
section of https://smorettini.github.io/general/2020/07/21/CNNs-on-CHB-MIT/ and also the original paper https://www.sciencedirect.com/science/article/pii/S0893608018301485
- 22 = Number of channels
- 59 = It's time. It's 59 because there are two values for each second. I don't remember why is 59 but not 60, maybe if you check the documentation of
signal.spectrogram
you will find out. - 114 = It is obtained by removing some noisy frequency in the code. Originally there are 129 frequencies that are reduced to 114:
Pxx = np.delete(Pxx, np.s_[117:123+1], axis=0)
Pxx = np.delete(Pxx, np.s_[57:63+1], axis=0)
Pxx = np.delete(Pxx, 0, axis=0)
The STFT is computed in:
CNNs-on-CHB-MIT/DataserToSpectogram.py
Line 194 in 62d68f9
P.S.: I'm sorry if I don't remember all the details but this repo is very old and years passed from last time I work on it.
P.P.S.: Read carefully the material I link at the beginning of this answer, they contains most of the info we used to write the code.
from cnns-on-chb-mit.
Related Issues (14)
- chb - mit ANNOTATION FILE HOT 5
- nan HOT 1
- threhold HOT 6
- Creation of the CNN and evaluation of the model on the spectograms - python CNN.py HOT 4
- How long does it takes to train an epoch? HOT 4
- FileNotFoundError: [Errno 2] No such file or directory: '' HOT 5
- CNN's training data HOT 3
- Question about start time of preictal interval HOT 1
- What is the meaning of S variable? HOT 2
- threshold HOT 2
- What does the "real preictal" mean? HOT 1
- notused HOT 1
- About generating spectrogram shapes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cnns-on-chb-mit.