-2

I am writing a HW neurofeedback app. Which wotks like this: https://www.youtube.com/watch?v=pjCghiq5FoQ

In this case it is a demo which is not actually working. I have data from EEG and I want to plot them on the surface by LEDs. The technique is similar to this output: http://www.fieldtriptoolbox.org/_media/tutorial/natmeg_temp/natmeg_freq11.png?w=400&tok=6e5a3c

But I need to write it on my own because I need to light the LEDs instead to show 2D image. Basically I have no clue where to start.

My goal is to vizualize spectral density for each EEG channel by each LED as you can see demo on youtube. I would appritiate any help, even teoretical one.

I know I need signal and electrodes position in x, y, z e.g. indentifiation of LED number on the sculpture.¨

Thank you,

Michael

Michael Tesař
  • 342
  • 5
  • 15

1 Answers1

1

you have multichannels EEG recordings. I suspect you have the positions of these channels. You also have the (rough) position of your LEDs on the head.

Interpolate your data to find the power at the LED positions.

ledInput = interp2(Xeeg,Yeeg,EEGpower,Xled,Yled),

to find the RGB colors corrisponding to the power values:

ledInput = rand(32); % create fake data for testing
colorResolution = 256; % choose a color resolution
colors = jet(colorResolution); % creates a colorbar of 256 elements. (you can change "jet" with any other colorbar of matlab) 
ledInput = (ledInput-min(ledInput))/range(ledInput); % change range btwn 0 and 1
ledInput = round(ledInput*(colorResolution-1))+1; % turn the power values into index for the colormap
ledInput = colors(ledInput,:); % find the colors for your leds
Valerio Raco
  • 183
  • 6
  • Thank you Valerio for sooo quick reply. Yep you are right. I use 32 channels with possition on sculpture in possition as eeg cap does. Basically I draw dots inside a electorde hole. Does this map me a color? I dont get is :D – Michael Tesař Apr 25 '17 at 10:58
  • Sorry, I thought the problem was to find which value corresponds to which LED. "How do you map the colors?" are you asking us how to change the color of the LED? what input your LED take? – Valerio Raco Apr 25 '17 at 11:08
  • Oh yeah, I need to change LEDs color depending on spectral density at each electorde – Michael Tesař Apr 25 '17 at 13:14
  • So, the code I gave you outputs the spectral density at the LED locations (interpolated). What do you want to know: how to turn the spectral density to RGB values, or how to actually control the LEDs? – Valerio Raco Apr 25 '17 at 13:45
  • I want to know how to turn PSD into RGB values – Michael Tesař Apr 25 '17 at 17:28
  • 1
    @MichaelTesař. Good to know. Next time try to make it easier for us to know what you actually want, please. See the updated answer – Valerio Raco Apr 26 '17 at 12:38
  • @ValierioRaco great I will try this out and post the result in future to complete. Thank you. – Michael Tesař Apr 26 '17 at 12:40