Flavio Frohlich
  • Home
  • Contact
  • Thoughts
  • Book
  • IN THE NEWS
  • ABOUT
  • Speaker

10/25/2020

Collecting EEG Signals with a Raspberry PI and a MUSE 2 headset

4 Comments

Read Now
 
Few weeks ago, I have posted on Twitter that I am interested in examining to what extent consumer-grade EEG headsets could be used in scientific studies. There are few papers out there that test devices but I decided that I need to try them myself to see how good the signal quality is and whether these devices could be suitable for long-term monitoring in clinical trials of our Carolina Center for Neurostimulation.
I will share with you all my insights and thoughts on this journey. Please chime in and share your perspective and tips. This first post summarizes some troubleshooting I had to do to get the MUSE 2 headset to communicate with a Raspberry PI 4, a quite powerful single-board computer (SBC). I felt like back in the days of graduate school (almost twenty years ago!) when compiling code was part of my daily work. As it turns out, there are some fantastic resources out there and please understand that I did not develop anything new here, rather I found the right tools and figured out some quirks to things to work as they should. In the hope that such step-by-step instructions are helpful, here is what I did.
  1. I got a Raspberry PI 4, a high-speed 32GB micro SD card, the matched 7-inch capacitive touchscreen, and a nice enclosure (all links will take you to Amazon, please note that I use affiliate links). The idea is that together this forms a nice stand-alone unit to receive EEG signals (instead of relying on somebody's smart phone that comes with its own privacy challenges etc., more on that in a later post).
  2. I got the MUSE 2 headset, more on the MUSE S in another post.
  3. To download and install Raspberry Pi OS (32-bit), I used the Raspberry PI OS downloader. This tool downloads the OS and copies onto the SD card.
  4. I assembled the device using these instructions, inserted the SD card, and booted the device (I powered it with my cell phone charger, it requires a USB-C connector on the device side).
  5. I answered the few simple questions about language etc and configured it to connect to my wireless.
  6. The OS then automatically checked and installed all upgrades, which then required a reboot.
  7. I then installed the fantastic muselsl python package by Alexandre Barachant. Here is where it got interesting. Muselsl includes some python packages that I only got to properly install on Python 3, thus I used the following command to install it (note that I use sudo to ensure to have the proper privileges for all of the installation steps):
    sudo pip3 install muselsl
  8. At this point everything should work, except it does not! The reason for this that library required for the Raspberry PI is not available, the file is called liblsl32.so. I clicked through some of the super helpful discussion threads on github to learn how to download and compile this file.
  9. Download the LSL folder from the labstreaming layer github.
  10. Change over into that director (after unzipping) and create an additional director where the compiled code will go with the following commands:
    cd labstreaminglayer/LSL/liblsl
    mkdir build
    cd build
  11. Now, before you are ready to compile you need to install the tool cmake that is required for preparing compilation. I used the following command:
    sudo apt install cmake
  12. Now you can compile using the following command (again, a heartfelt thank you to the developers at the SCCN who have developed this tool and provided help with this on their github page):
    make .. -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--allow-multiple-definition"
  13. You will now have the right file in your built folder, it will have the name liblsl.so.1.14.0. Now all you need to do is to copy this into the right folder with the following command:
    sudo cp liblsl.so.1.14.0 /usr/local/lib/python3.7/dist-packages/pylsl/liblsl32.so
  14. Before muselsl works, there is one last step, which is to install one more package to make sure that that scipy package runs. Here is the command:
    sudo apt-get install libatlas-base-dev
  15. At this point, you should be able to connect to your muse device and start streaming data. I used the following sample Python script provided by the authors of muse-lsl:
    from muselsl import stream, list_muses
    uses = list_muses()
    stream(muses[0]['address'])
  16. Done! Please keep me posted if this works for you. I will follow up with more code to test the device and also some sample data, including a discussion of the recording quality. Stay tuned!
      

Share

4 Comments

9/20/2020

Electric Circuits in Neurophysiology

1 Comment

Read Now
 
Learnign cellular neurophysiolgy has the reputation of being the hardest part of the year-long first-year graduate neuroscience course at my university. This is understandable. After all, the generation of action potentials through the interaction of sodium and potassium channels is governed by complex differential equations (Hodgkin-Huxley). Almost ten years ago, when I started out as faculty, I was asked to teach some lectures on the topic. I decided to introduce two new approaches that I have refined over the last decade:

(1) My first idea was that the key concept is the abstraction of biophysics into electric circuit diagrams that are completely foreign to almost all biology students. I had thus decided to formally introduce the students to the basic elements of electric circuits (current source, voltage source, resistors, capacitor) and the "syntax" (Kirchhoff rules) before shifting gears to discussing the passive cell membrane, followed by the action potential itself. I have now produced a series of videos inspired by the lectures I have been teaching. I hope they are of help!
actionpotential_worksheet_flaviofrohlich.pdf
File Size: 384 kb
File Type: pdf
Download File

ipotassium.slx
File Size: 30 kb
File Type: slx
Download File

isodium.slx
File Size: 30 kb
File Type: slx
Download File

hodgkinhuxleypulse.slx
File Size: 35 kb
File Type: slx
Download File

hodgkinhuxleystep.slx
File Size: 36 kb
File Type: slx
Download File

(2) I felt that getting the chance to run simulations will help learners to better grasp the concepts. In fact, I decided that running simulations and plotting the resulting curves by hand will enable an in-depth learning that cannot be achieved by other means. I decided to use Simulink (part of Matlab) for the simulations since it hides the differential equations and yet provides a visualization of how the different elements of a complex set of differential equations come together. Finally, I thought it would be nice to have simulated oscilloscopes to view the resulting traces.  Today, I am sharing with you all these materials in the hope that they are of help to you and your students. Feedback very welcome!​
These materials were the foundation for the chapters on cellular neuroscience (and some of the toolboxes) in my book Network Neuroscience that goes into some more detail (including voltage and current clamp etc). The book covers "network neuroscience" through a wide-angled lens that captures neurophysiology from the level of neurons and synapses all the way to complex large-scale network stuff. Check it out!

Share

1 Comment

9/12/2020

10 Tips to Enhance Your Web Presence as Scientist (Trainee)

0 Comments

Read Now
 
In this week's professional development workshop with the Frohlich Lab, we spoke about the importance of a professional online presence as graduate student / postdoc / faculty. I pitched the idea that marketing matters (also in science!) and that a robust online presence is a potential career catalyst. Here are my ten essential tips how to build an online presence. Here, we focus on the creation of a website, we will discuss social media in a later post.
  1. If you can, get your own URL (around $10 per year). I like the .org extension since .com signals a commercial intent. If you are lucky enough to have an unusual first-last-name combo, I recommend you use that.
  2. Have a portrait picture on the main (home) page to make it personal and start building a connection with your audience from the moment they land on your site.
  3. Include a research statement, a short bio, and list your publications (ideally with links to download them).
  4. Connect your website to your other online platforms (Twitter etc).
  5. Use the powerful and free tools provided by google to market and track the success of your website. Use google web tools to register your site and use google analytics to track the sources of the traffic to your site.
  6. Add a blog if you have the time and interest to share your thoughts.
  7. Make sure to fill in the form fields for "search engine optimization (SEO)", the keywords and summary your provide are used by the search engines which results in better results for when people search the web for your site.
  8. Make sure that (1) you have links that point to your site (for example from the lab's website), (2) there are links that connect the different pages of your website, (3) you have outgoing links to relevant pages.
  9. Regularly update your page, there is nothing less helpful than an outdated page on which the "latest paper" is few years old.
  10. Think carefully about what you want to share about yourself and what you would like to keep private. 
I hope these tips help you to create and optimize your "personal profession" web site/presence. Please drop a link to your site below in case you would like to showcase your site or ask for feedback. I am more than happy to help. You cannot underestimate how important such a website is when you are looking for a job such as a postdoc position. Good luck and enjoy!

Take care,

Flavio

Share

0 Comments

9/5/2020

6 Things every Student Applying for a Position in a Research Lab Should Know

2 Comments

Read Now
 
As a the principal investigator (PI) of the Frohlich Lab, I receive numerous applications from undergraduate students who apply to work in our lab. Unfortunately, there are never as many slots as students interested and we have to make a selection. Today, the number of applicants far outnumbers the slots we have, likely because many labs have decided not to accept undergraduates because of COVID. The applications that land in my inbox differ quite a bit from email to email. I am suspecting that many students have never been taught how to approach a lab. This is of course an issue since it creates privilege and may contribute to biases against students who did not have access to mentoring earlier in their academic journey. Let me share with you the 6 things everyone should know in the hope that many students get to see this and can learn from it. Ideally, this post will be one small but hopefully important step towards leveling the playing field. And, of course, being aware of this issues will help us PIs take this into account when we assess applications. I feel very strongly about this responsibility. Here we go:
  1. Read at least two papers from the lab. It is OK not to understand most of it. Try to get the bigger picture message (often the last sentence of the abstract and the last paragraph of the discussion) and try to have an independent thought about what you have read. Perhaps you have a question or you see a potential connection to your previous (life) experience. Write few sentences about this in your email to the PI. This will separate you from the majority of emails that do not contain any information why the student is interested in this particular lab. Note that specificity is always the winning strategy. So "I am interested in neuroscience" loses against "I am interested in non-invasive brain stimulation since, after reading your paper on auditory hallucinations (Ahn et al 2018), I am curious if the same approach could also work for visual hallucinations".
  2. Explain why you are prepared to take on this responsibility. It is OK not to have had any previous research experience. Perhaps you worked a physically demanding job to fund your studies. I find this is also a strength! You can explain how meeting the demands of this job has demonstrated your willpower to succeed and your ability to handle multiple responsibilities besides being a student.
  3. Make sure your message is tailored to the lab. Sending out a mass email or something that looks like this does not show specific interest, which is what the PIs are looking for.
  4. Ask for a meeting. There is nothing wrong with being assertive and proactive. This demonstrates your true interest. Of course, you will want to be kind in your request for a meeting and demonstrate your understanding of how buys the PI may be. Do not hold back in showing your commitment and interest. Sending messages "and it is OK if you do not have a spot for me" will not get you to the final round.
  5. Do not get frustrated when you get turned down. Rather, inquire specifically of what you can do to strengthen your application and when you can reapply. Learn to accept the rejection but also make sure you leverage it as a tool to get to the next level.
  6. Attach your CV and your unofficial transcript to the initial email such that the PI does not need to loop back and ask for those documents.
I hope these tips will help you strengthen your application. Please post below if you have any questions or thoughts. Mentoring undergraduate students is a win-win for everyone and I sincerely hope that my colleagues will open their labs to undergraduate research assistants again, since lab experience is one of the most important aspects of a college education if you are interested in a career in science or medicine.

Take care,

Flavio

Share

2 Comments

9/4/2020

3 Things I learned about myself when I started using Robinhood

1 Comment

Read Now
 
Investing used to be a complicated process only accessible to rich and privileged  people. Apps such as Robinhood promise easy access to the stock market (and more), which I thought to be a great idea. Briefly, these apps let you buy and sell stocks (and other financial products including cryptocurrencies) without commission (fees). Recently, I have decided to try it. I was not prepared for what expected me. I have only lost money (too be expected, given that most amateur investors do poorly when they start picking stocks instead of being smart and buying index funds). The premise to all this is that I am not a professional investor and know about as much/little about the stock market like any random person (definitely not equipped to give you financial advice). Today, I would like to share with you my experience and the lessons I have learned.

(1) Using the app is (too!) straightforward. It is built to make it as easy as possible for you. You can connect a checking account and are immediately ready to invest. The user interface feels like a game and it is indeed very, very easy to start investing. In that regard, the user interface easily beats whatever I have seen from more established banks. And here is where the problem starts. The app may as well be a slot machine. Once I was in the red (very quickly), it was far too easy to "instant-transfer" more money to keep on buying to make up for the losses. The mental energy required for not falling for this was quite substantial. Lesson 1: Once something feels like a game, we can easily forget what is at stake (your hard earned money!) and get caught up in the moment.

(2) Using this app, I quickly saw myself making many kinds of "think mistakes" that I thought I would be immune to. Having done quite a bit of math in my life, I was ready to throw all this overboard and replace cool reasoning with quick and irrational thoughts. For example, as a particular share started going up, it was easy to convince myself to buy into this as well. I usually see myself as an independent thinker but I guess the worry about missing out on an opportunity quickly drove me to become a follower instead of a leader, which is not a good idea when playing the stock market. Lesson 2: Everyday we experience the pressure to act like everyone around us. Learning how to recognize and manage this pressure sets us free and makes us a better leader.

(3) Emotions win, each time. Having spent most of my life in school, I would have predicted that I know how to use reason instead of emotions. Think twice. Very quickly, I realized that my investment decision were driven by raw emotions such as fear of missing out (FOMO), excitement about (potentially) absurd gains on any given day, and in general my desire for excitement and distraction from the more mundane things in my life.

Overall, I have lost a little bit of money (I set myself a cap that I have not yet passed...) and learned a lot about my own vulnerabilities and how apps are designed to exploit them. Now, not all is bad. I always enjoy learning about myself. Also, I still believe that giving people who do not have investment accounts the chance to invest is a good thing. Note that I am (by far) not equipped to give you financial advice. However, I think there is a broad consensus of experts that you should buy index funds and keep them long-term. 

If all this does not deter you, here is the link to sign up for a free account and try. Note that this is an affiliate link that will give you (and me, at no cost to you) a free stock (small chance to get a fancy one like Amazon, again the gambling marketing strategy!) when you sign up. You have been warned! Please share your thoughts and your own experience.

Take care,

Flavio


Share

1 Comment

9/2/2020

Dealing with Stressors

0 Comments

Read Now
 
This weeks episode of my podcast "The Future with Flavio" looks at different stressors and how to deal with them. You can find the latest episode on your favorite podcast app (if not, please let me know, as I am quite new to this). Here is also a direct link (Episode 9).
I wanted to share with you the 60-second summary in case you are too busy to listen to the entire episode (though I highly recommend it). I am making the distinction between three types of stressors:
  1. The small stuff that feels big to us. For these, I recommend strategies how to change our thinking about them such that they do not stress us anymore (or at least much less). You can think of these stressors as the ones where we focus on our cognition for handling them.
  2. Stressors that cut to the core since they highlight important differences between our values and events. These are the ones that I recommend to turn into calls for action by using rational thought to develop the most effective strategy to fight for your values.
  3. Stressors that feel to big for us to handle. FOr these, I highly recommend getting professional help. i recommend seeing a therapist to deal with the stressors that we need help with. I am advocating for normalizing seeing a therapist!
This classification has helped me to label the different stressors I experience and to take the according action. i hope this is of help to you too! Please check out the podcast for more details and let us know how things are going for you by leaving a comment below.

Share

0 Comments

8/29/2020

My System for Getting Stuff Done (Part II)

0 Comments

Read Now
 
Picture
Welcome back. This is Part II of me sharing with you what works for me to be productive, even during stressful times. You can find Part 1 here. Today, I invite you to focus on few basic yet very important facets of self-care. No productivity system can get you to the next level unless you learn how to take care of yourself. During times of stress, this used to be the first place where I would make cuts. Drop the daily exercise, take a break from practicing the cello, or even step away from meals with the family to work more. All these strategies may give you a little of time today but will negatively impact your productivity and happiness in a more chronic and damaging way. Taking care of your body (and yes, your body is the substrate for your mind) should always come first. Try the following things:
  • Got to bed early and make sure work does not creep into your bed. I am not even asking you to put your phone away (that would be a great idea but surprisingly hard to implement). Rather, give yourself permission not to work when you are in bed (and, no, quickly checking work email is not OK). This is hard since work seems to never end when we are working from home. Tell yourself that you have done enough for the day and that you deserve rest.
  • Exercise in the morning. I am sure exercise physiologists will have opinions on this. For me, getting 15 minutes of exercise done before I start working makes all the difference how the day goes. I feel stronger and more focused after exercising. Mind you, my exercise is very mild and very short. If it more intense I do not succeed in maintaining the routine. Be gentle with yourself!
  • Practice gratitude and offer praise for your spouse, family, friends, and colleagues throughout the day. This helps me to focus on the positive things and strengthens my relationships, which ultimately makes everything easier. Never take anything nice for granted but rather express your appreciation and gratitude.
  • Develop a good yoga or meditation routine to enhance your well-being and health. Short and daily is much better than long and only now and then.
  • Have a non-negotiable beauty/hygiene routine (brush your teeth, floss, pamper your skin, and whatever else is important to you).
  • Have book to read on your nightstand that is not work or school related.
  • Go for a brief walk every day.
  • Check in with your family.
These are the key elements of my self-care routine. What are yours? Please post below in the comments and share your strategies. Remember, taking care of yourself is not egoistic but rather the foundation on which you can build your productivity routine and success!
Picture

Share

0 Comments

8/22/2020

My System for Getting Stuff Done (Part 1)

5 Comments

Read Now
 
I enjoy answering the questions how I get stuff done. First, please let me share that I have learned a lot about how to manage processes, document my work, and get stuff done in general. I used to be a very chaotic person and I was struggling for a long time to get things in place for being productive (and happy). A lot of credit for where I am today goes to my wonderful wife Anita, who homeschools our four kids (check out her resources on how to become a learning family), works as a project manager for the Frohlich Lab, and contributes to the field of international law with her widely-read online encyclopedia of comparative and foreign law CompareLex. I have watched her be productive at an insane level and learned, in fact learned a lot. With some tweaks to my specific circumstances, I have converged on the following three basic principles:
​
  1. Small notepad (like this one) and a high-quality pen next to my computer to write down all the random and fleeting stuff that comes up. There are many moments during a conversation that I do not have the time to go to my electronic systems to add stuff (see below), so that stuff goes into my notepad and gets transferred and crossed out at the end of the day. 
  2. Use a digital notebook (such as Endnote or OneNote, both free!) and have a note for each day. Everything I do gets documented. This keeps me on task and gives me a sense of accomplishment by the time the days ends. Careful note taking did not come naturally to me but, once I developed the habit, this became super helpful. Bonus tip: I start each daily note with a brief reflection statement on the previous day and my plans for the day. I address the questions of what went well and what I want to improved the next day.
  3. Use a project management tool (I personally use Wrike) to keep track of all tasks. Most of my tasks come by email. My trainees have access to directly create tasks and assign them (with a deadline) to me. This saves a lot of unnecessary emails back and forth. By the way, talking about emails, I do not use the inbox as a to-do list, rather I move things that I cannot immediately resolve to Wrike as tasks.
​
These are the three pillars of my productivity system (together with getting enough sleep!). I will expand some more over the next few posts to give you full behind-the-scenes access of how I get stuff done. 

I hope this finds you well and please do share in the comments below if these strategies work for you and whatever productivity systems you have developed for yourself. Let's share. Let's learn, grow, transform together!

Share

5 Comments

8/12/2020

New academic year - welcome back!

0 Comments

Read Now
 
Welcome back! I know it has been a while since I have posted here. 2020 has been brutal, hasn't it? So much destruction, so much suffering, so much violence, so much disruption. I think I may be speaking for many of us when I say that "hanging in there" is about as well as can and should expect us to do during this terrifying year. Personally, I had stepped back from blogging here because there was so much going on. This week, I have decided to come back as the academic school year starts at the university I am professor at. I am greatly privileged to be a mentor for both my research group and my startup company, and I have decided to use this blog (again) to more broadly share my thoughts and advice (you have asked for it!).

Today, I start with sharing my own goals for the semester ahead, in the hope that they inspire you to think about the big picture and your vision for your future:
  1. Be a student as much as I am a teacher. Listen, listen, listen. Read, read, read. It is too easy to get comfortable with what we have achieved and what we know. My goal is to seek out and celebrate opportunities where I can learn and grow.
  2. Focus on anti-racism. This will not need much explanation. As a white person, I understand that I have a great responsibility to put my privilege to work to fight systemic racism and  to educate myself. This applies to me as an individual, to me as professor running a research group, and also to me as the founder of a startup neurotechnology company.
  3. Focus on self-care. I have a long history of neglecting my own well-being for short-term gains. My goal is to be mindful about my psychological and physical health and to develop routines that let me pursue my passions without burning out.
  4. Develop a more consistent online profile to share, interact, and mentor. My goal is to lift up and inspire beyond my immediate circle of mentees.
I will use this blog to hold myself accountable. I do not expect to be perfect but I will be happy if I succeed to work towards these four goals. What are your goals for this semester / 2nd half of 2020?
 

Share

0 Comments

10/11/2019

Week 5: Being real online without oversharing.

2 Comments

Read Now
 
Welcome to Week 5 of our 8-week program! This week, we are talking about how to raise your profile online by being human... Sharing with the world not only your message but also your own story behind the message is a very powerful approach for engaging your audience. Here are the most important do's and don'ts for being real online without oversharing. Now, many of the items below are a matter of style and I expect that not everybody will agree, so let's discuss in the comment section below.

Do's
  • Use a portrait picture (only if you are comfortable). Our brains are wired to be interested in faces!
  • Personal experiences (that you are able and willing to share) help build emotional connections with your audience.
  • Feel free to express your honest emotions (#excited, #frustrated), but see below.
  • Focus on what your audience is interested in and enhance the content with your own personal touch.
  • Find your own voice and proudly carry it. Do not listen to the naysayers. Be authentic!

Dont's
  • Do not share information that could become a safety hazard for you or your family.
  • Do not communicate emotions (especially negative ones) unless you had enough time to reflect and still feel it is important to share.
  • Do not feel pressured to create an "perfect version" of you online. You are perfect the way you are. Pretending to be somebody else online is exhausting and may damage your mental health.
  • Do not brag. No go: #soshumbled #sohonored to be the best and brightest of you all!

Share

2 Comments
<<Previous
Details

    Author

    Flavio.

    Archives

    September 2020
    August 2020
    October 2019
    September 2019
    August 2019
    July 2019
    March 2019
    December 2018
    October 2018
    September 2018
    April 2018
    March 2018
    February 2018
    January 2018
    December 2017
    November 2017
    September 2017
    August 2017
    July 2017
    June 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    February 2016
    January 2016

    Categories

    All

    RSS Feed

Proudly powered by Weebly
  • Home
  • Contact
  • Thoughts
  • Book
  • IN THE NEWS
  • ABOUT
  • Speaker