My self-study plan for electrical engineering

Why?

I’ve been interested in brain-computer interfaces for a while, and last summer I finally decided to do something about it. I’ve read through the Fundamental Neuroscience, The Hippocampus, and a bunch of other books and review papers. Now I think I have a basic grasp of what’s going on in the brain, and enough knowledge to be able to read journals, which I intend to keep doing.

What I really lack now is engineering knowledge. I’ve graduated from university with an applied math degree, and then spent 13 years in the workforce, first as a quant analyst at a hedge fund and then as a software developer and a technical lead. In that time, I had zero opportunity to learn or use electrical engineering, and now I need to make that up.

This is intended to plug that hole.

Read More

Human vision system - a simple description

So when we see something in front of us, like a pencil, how exactly does the brain understand that yep, that’s a pencil?

Like, what is the detailed sequence of steps that happens? The eyes presumably convert the light to neural signals (how?), then these get sent to the brain (where?), and then the brain does… what?

I’ve been reading through a bunch of neuroscience textbooks and papers for the past six months, and I think I’m at the point where I’ve now got the whole picture.

So here are the core pieces of this picture, with a lot of details omitted to fit it into a short blog post.

Let’s start with the input.

Read More

Image stabilization - in humans

As I read more neuroscience, I run into more interesting neural circuits. One of these circuits is the Vestibulo-Ocular Reflex (VOR) that helps us keep the eyes locked on a target when the head moves.

What’s interesting about it are both its simple wiring (at first glance), and the extensive hidden support circuitry that can tell us more about how the brain works.

VOR is not the only circuit that helps us keep our eyes locked on target; there are others that work in parallel. I suspect that they probably use the same underlying principles.

(Note: some links here are behind a paywall. Remember that it’s illegal to go to Sci-Hub and search for the DOI link of the article to get free access to it.)

Read More

Neuron circuits in the retina - more than just pixels

There’s also a YouTube version of this article.

The picture above shows some (far from everything!) of what we know about the cells and neural circuits in the human retina.

What’s interesting is - the retina is not just a light detection organ. It’s a complex electro-chemical calculator with three neural layers, and it uses these layers to extract a number of useful signals from the light that hits our eyes.

Below, we’ll step through some of the more interesting features of the retina, but if you’d like to learn more, the above picture (and this article) are mostly based on this review article published in Feb 2020 in the journal Progress in Retinal and Eye Research, and on chapter 17 of the latest edition of Ryan’s Retina.

Read More

How neurons create electric spikes

And here’s the same content as the last blog post, but now in YouTube format.



The magic of ion channels in the neurons

A few weeks ago, for various reasons I decided to start reading a neuroscience textbook (Fundamental Neuroscience). Though dense, it’s packed with interesting information that filled a lot of gaps in my knowledge about the brain.

One of those gaps was about how exactly the information travels through a neuron. Up to this point, all I knew was “something involving electric pulses”.

The reality, it turns out, is more interesting: neurons use ion channels to create and strengthen electric signals, and propagate information along their lengths.

So here is more or less how I understand this so far.

Read More

Multithreading without locks

Just because you’re sharing data structures between threads doesn’t mean you have to use locks.

Over the years I’ve come across a few approaches that help coordinate work between threads without having to make anyone wait. Here are a couple of them.

WARNING: I stopped using these patterns because they are easy to misunderstand and misuse, which can lead to random hard-to-diagnose bugs. If you use these patterns, you’re not helping the next develper understand the code better or avoid mistakes. You have been warned.

Read More

Newcomen atmospheric engine - an animation

A stylized animation of Newcomen engine that I made a while back.

Newcomen engine is one of the first viable steam engines originally made in 1712 in England to pump water out of mines.

Unlike later steam engines, it was an “atmospheric engine” in which the power stroke was produced by the steam condensing into water and thus creating a vacuum; the atmospheric pressure then pushed the cylinder down, moving the big beam.

It was extremely inefficient by modern standards, but that wasn’t a big deal if it was sitting next to a coal mine.



Read More

Making codebases age well

Why are some systems easy to update after a decade, while others are hard to understand after a year or two? And why are some companies drowning in bugs and need a month to complete a change that takes days in other companies?

Some of the root causes may be organizational, but technical choices also make a big difference.

After seeing plenty of projects on either end of the spectrum, here are the biggest differences between codebases that age well and the ones that don’t.

Read More

TDD is a lot easier with the right tools

I consider myself to be a pragmatic fan of test-driven development (TDD), writing maybe 30-50% of my code using the technique.

Having done it in four different tech stacks over the past few years, I look forward to TDD a lot more in some of them than in others.

Let’s compare a few of the experiences to see what they get right and what they don’t, from best to worst:

  1. .Net: xUnit and NCrunch
  2. JS/TS: Jest and VS Code Jest extension
  3. Python: pytest
  4. Java: IntelliJ and Infinitest

Read More