0
$\begingroup$

EEG and Audio data are very similar, both

  1. are numerical samples in continuous sequence
    • have a sample rate
  2. need and can have multiple channels
    • channels for multi-channel audio
    • channels for each electrode
  3. have predictable characteristics that are exploitable for compression.

FLAC is specifically designed for efficient packing of audio data, unlike general-purpose lossless algorithms such as DEFLATE, which is used in ZIP and gzip. While ZIP may reduce the size of a CD-quality audio file by 10–20%, FLAC is able to reduce the size of audio data by 40–50% by taking advantage of the characteristics of audio.

is there a standard loseless compression coding format for EEG data, that takes advantage of the characteristics of EEG, like FLAC takes advantage of the characteristics of audio?

$\endgroup$
3
  • $\begingroup$ This doesn't seem to be a computer science question, to me. I'm not sure of anywhere on Stack Exchange where it would be on-topic. $\endgroup$ Apr 27, 2019 at 12:22
  • $\begingroup$ SO, and SU were eliminated because I reasoned that it's not a programming nor a software recommendation question. and my searches showed only CS research papers and no use or implementations of such coding format. $\endgroup$
    – Wis
    Apr 27, 2019 at 12:26
  • $\begingroup$ You haven't described your EEG data, how many channels, whar frequency, what format, do you keep them raw, frequencies, bands or wavelet form. If you give details, it is valid question about compression, now it is valid only to people who know how EEG signal looks like. Even with that it may be hard to exploit signal characteristics without knowing what is what in the signal. Do you need whole raw signal or clean it beforehand? What lowpass filters are used? What kind of electrodes? (this is not about CS, but will really help me to improve your question and infer signal properties). $\endgroup$
    – Evil
    Apr 27, 2019 at 13:42

2 Answers 2

2
$\begingroup$

For single channel with raw signal, the best option is Elias gamma, for single channel frequency signal, the best option is to use Range encoder. For multiple channels, this is still viable option to compress each channel and then compress them together interleaving signal (one sample from all electrodes, then another sample from all electrodes).

If you have multiple channels, there are inter-channel correlations, which should be used for compresion, standard method is to use DPCM or use DCT-IV for decorrelation (this is the very same transform like in JPEG) and then use arithmetic codding of any kind. For online setting - compress signal as it goes - this is very good idea.

Another standart approach is Karhunen-Loeve transform. Do not use autoregressive methods, use Elias gamma in the pipeline instead.
Another approach is to use DCT transform to remove redundancy of interchannels (decorrelation) and compress in minimal frequency form.

If you need to store volumes of EEG data, my advice is to clear it from noises and store bands you are interested in, otherwise you store mainly hard to compress noise.

$\endgroup$
2
  • $\begingroup$ "Clear it from noises" is a direct contradiction to "lossless encoding". $\endgroup$
    – gnasher729
    Apr 27, 2019 at 15:08
  • $\begingroup$ @gnasher729 My suggestion is to use lossless compression, but overall idea to preserve signal is not optimal, due to EEG internals. Skull is attenuating signals, beyond 500Hz there is nothing to see if you do not do trans-skull reading. Now, reasearch grade EEG with 8kHz and 256 electrodes is mostly noise, my advice is to strip it. Cleared or not, lossless is 1:1 mapping, I advice to use lossless compression on meaningful data, but presented algorithms works disreagarding this piece of info. $\endgroup$
    – Evil
    Apr 27, 2019 at 15:49
0
$\begingroup$

You can use the same principles as FLAC, adapted to the specific data: You write code which given previous samples predicts the next sample as good as possible. Then you just compress enough samples to get the predictor running, followed by the difference between the actual signal and the encrypted signal.

You could of course just use FLAC, adapted to the difference in frequency, and see what happens. For example if you have a file with 360 11-bit samples per second, you can just pretend it is 44100 samples per second in the range -1024 to +1023 with the sample shortened by a factor 44100/360 or 122.5 / 1 and put it through FLAC. (Encoding as mp3 or aac would be useless, because they produce sounds that are very similar to the ear but can be structurally quite different).

$\endgroup$
2
  • $\begingroup$ one issue is that FLAC can have a max of 8 channels, which can encode data for only 8 electrodes. $\endgroup$
    – Wis
    Apr 27, 2019 at 12:30
  • $\begingroup$ Excuse me, but that is really trivial to solve. You are not restricted to one encoding. Split 16 channels in 8 + 8, split 80 channels in 10 times 8. $\endgroup$
    – gnasher729
    Apr 27, 2019 at 15:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.