Monday, July 14, 2014

More wearable healthy stuff

A friend of mine brought this to my attention.



Aside from being slightly not safe for work, they describe an intriguing product for monitoring heart rate. 

They claim they can get an "extremely accurate ECG" without electrodes contacting the skin.  They pull this off using capacitive electrodes that can be made very small and only have to be very close to the body, but do not need to touch (touching probably works best though).  What really blows me away about this claim is that the device itself is very small and self contained, which means the sensors have to be close together.  They say they use three sensors for detecting heart rate.  Likely one is the ground, while the other two are the left and right leads.  But with the sensors so close together, the potential difference detected between the left and right leads must be very small.  This system can only work if they can record signals with a very high signal to noise ratio. If it works as they advertise, that is very impressive.

Importantly, this is different from the optical sensor that I described in the last post.  That sensor cannot give you direct information about the health of the electrical system of the heart or information about whether or not chambers of the heart are beating in synchrony.  Since this system will have ECG information it could be used for those purposes. 

This system is probably fairly vulnerable to motion artifacts and for exercise you probably will need a strap, but otherwise, it looks like a pretty plausible product. Since this is just in prototype form, we can't know for sure whether or not it really does work as advertised, but in my opinion, the product seems challenging but doable. Their indiegogo page is here.

Thursday, May 29, 2014

Update regarding health tech

So after some googling,  I have to take back some of the things I said yesterday.

There are a few watches out there that can determine your heart rate optically using infra-red light shined through the skin. Some reviews suggest that this method works fairly well.  This changes the equation about what you can do with the watches.

Long term continuous heart rate monitoring becomes feasible, which can give you all kinds of health information including heart rate variability, an area of my research.  It also makes the process of getting continuous heart rate during exercise much more convenient. 

However, a lot of my other points still stand.  The bigger is what can you do with this information and will people really care?  You still can't use this information to diagnose or treat any conditions with FDA approval and studies still show that for most people this kind of data just becomes boring noise.  It might motivate some people to exercise in the short run but long term, it just doesn't happen.

I just don't see this as a big field.  Easy to use home blood pressure monitors have been around for ages and they are not exactly flying off the shelves. 

Wednesday, May 28, 2014

Wearable health tech

Update:   New information changes some of my points, you can read about that here


I don't have a lot of time so this will be very brief, but maybe later in the week I'll expand this post.

My main point is that wearable health technology is pretty much terrible.  There's technological, physiological, legal, and even ethical reasons why they are limited.

Getting a good heart rate requires at least two sensor attachments to the body.  So you can't build a continuous monitoring system that a person would want to wear 24/7.  Polar is the state of the art for watches that do this, and studies have shown that their heart rate detection is inferior to full blown medical grade detectors.

So the best Apple or another phone company could do here is a two point sensor that provides instantaneous heart rate on demand but not continuous monitoring.  This is just not particularly interesting.  There are apps that can give you your on demand heart rate using the camera, but again, this is of limited value medically (and the phone can already do it)

A popular option as a health wearable is a step counter.  Studies show these can help improve activity levels, but they just don't have long term benefits.  People get used to the counts, or get bored of using the pedometers.  This one is very feasible with tech already in the phone, but again, not particularly interesting.

Other measurements, like oxygen saturation, are interesting and perhaps feasible with current tech, but again, the problem is what would you do with this?  Unless you have an illness or you are training extremely intensely, your oxygen saturation is going to be within a normal range.

Which brings me to the last point, it is not legal or ethical for any of these devices to diagnose or treat a medical condition, which fundamentally limits the creative uses for any of these health devices. Because of all of these limitations, I really don't see any sort of wearable health technology ever being more than a niche device.


Wednesday, March 12, 2014

A Math Challenge

OK it's not really a challenge in the traditional sense, but I am curious about the answers that people might give.  There is no single right answer.

Here is the challenge.

I give you two boxes of apples.  One box has 3 apples, it has a giant A on it.  The other box as 9 apples, it has a giant B on it.  Describe how one box is related to the other.  I'll start with an easy one.
Box A has a different letter on it than box B.

Please answer in the comments.

Tuesday, February 11, 2014

Ben's Guide to Moving Off Windows XP

Microsoft is ending long term support for windows XP April 8th.   This means, shortly after April 8th, computers running windows XP that are connected to the internet will be all but guaranteed to be hacked or get a virus.  It will be a really bad idea to keep any computer that uses Windows XP online.
So what is the best thing to do?  Well that really depends on what the computer in question is for, the age of the computer, how much money you are willing to spend, and how computer savvy you are.

Most importantly, no matter what you do, backup your data ASAP.   If you choose to get a new computer, give your old computer to BestBuy or some other computer recycling center.   They will take care of deleting your old files and making sure that dangerous components in your computer are dealt with safely.


The main options are as follows:
1)  Backup any important data and just buy a new computer.  Use the backup to put your old files on the new computer and install the software you need.  This is an attractive option because the odds are that any computer with Windows XP is probably pretty old anyway and worth replacing.



1B)  Maybe you don't even really have demanding computer needs or particularly important files on your computer.  Instead of buying a new PC, you might be better off with an tablet like an iPad or simple PC like a Chrome OS computer.

2)  If your current hardware is near and dear to your heart, you might prefer to upgrade the operating system instead of getting a new computer.  I really don't recommend this unless you know what you are doing.  Here you also have a few options. 

2A)  Buy a Windows Vista license, and upgrade to Vista.  Vista has the most straightforward upgrade path from XP and will preserve your programs and settings.  The cons here are that the license is expensive, VIsta is kinda crappy, and Vista's end of life is sooner rather than later, so this only buys you a couple of years.  It is however, possible to upgrade from windows Vista to Windows 7 directly, so this might be an OK stopgap.

2B) If your computer can handle windows 7 or windows 8, you can install those onto your computer to use instead of Windows XP.  If you upgrade from windows XP to either 7 or 8 (and I would recommend 8, might as well go with the most recent one), your documents will be moved to a folder on the main harddrive called windows_old.  You will have to reinstall all of your old programs but should not lose any data.  You should still backup your files though.  After the install, you wil need to manually move your old documents to right folders that you prefer.

2C)  Install Linux.  This is a whole other can of worms but has the main benefit of being totally free.  If you really want to try this, leave a comment and I will go over those options in a separate email.  However, the process is not too dissimilar to that of 2B, but you end up with Linux instead of windows on your computer. 

3.  Continue using your computer, but disconnect it from the internet.  This is not something I recommend, but it's better than nothing.

Wednesday, February 5, 2014

Simple model of snow accumation

In an effort to learn python and make a model of how quickly and how much snow accumulates, I decided to use python to build and display the results of a model I made up.

The problem:  The ground is generally warmer than snow, and snow will melt when it hits the ground unless it snows faster than the ground will melt it.  Thus this is a rate accumulation problem, where the rate of accumulation of the snow is equal to the rate of snow fall minus the rate of melting.  The one hitch to this model is that the rate of melting is inversely proportional itself to the amount of snow on the ground, but the rate of melting is zero when there is no snow to melt.

It took a little bit of thinking to come up with a mathematical function for the melting that has the properties that we need.  I came up with this.


s is the amount of snow, r_2 is determines the rate at which the snow melts when there is a lot of snow and c determines the rate at which the snow melts when there is very little snow.  This function let's us have a snow removal rate that decreases when the amount of snow increases, but does not explode into infinity when the snow total is zero.  Another way around this problem would have simply been to make the snow removal term r_2/s  and simply put some nonzero number as our initial snow condition, but that isn't reaslistic because there just isn't any snow when it's not snowing.

The next part of the model is the snow accumulation term.  I have no meteorological knowledge at all, so I naively make the assumption that snow typically starts off very lightly, gets worse until it hits a peak, and then tapers off.  So my function for the rate of snowfall was just a Gaussian curve (bell curve).


where sigma is the width of the curve (bigger sigma is a longer lasting storm), r_1 is the maximum rate of snowfall, and u is the time at which the snow fall is at it's peak.

We put these together for our differential equation






Which is a first order nonlinear differential equation of one variable.
Now the fun part, the python code

First we import the libraries we will need, which include the square root function, pi, and the exponential function.
We also import the functions needed to integrate the equation and plot the solution.

from math import sqrt, pi, exp
import matplotlib.pyplot as plt
from scipy.integrate import odeint
from numpy import linspace




Here we define the differential equation and the constants into a function called snowac

def snowac(s,t):
    #function to define the differential equaiton
    #for snow accumalation
    r1 = 10;  #inch/hour
    r2 = .01; #hours/inch
    sigma = 10
    u = 50
    c = .01
    return  r1*(1/(sigma*sqrt(2*pi)))*exp(-(t-u)**2/(2*sigma**2))-s*r2/(s+c)


Here we use odeint to solve the differential equation

tspan = linspace(0,200,10000)
initial_value = 0;
sol = odeint(snowac,initial_value,tspan)



Finally, we use plt to plot the solution.
plt.plot(tspan,sol)
plt.show()

































The solution shows that the snow initially does not accumulate very much, then accumulates very quickly over a short period of time, and then slowly melts.

I have no idea how accurate this model actually is, but this seems reasonable.

Tuesday, January 21, 2014

Some of my favorite albums

These are the albums that I can basically always listen too no matter how many times I've listened.  This is not an exhaustive list and is not in any particular order.

Ghost Reveries - Opeth
This was not my favorite when I first heard it, but I found it improved a lot on multiple listens.  It has some really interesting compositions and typical Opeth heaviness.  Honestly, it was pretty hard to pick between all of the Opeth albums, I could have easily gone with Deliverance or Still Life.

Perpetual Burn - Jason Becker
A must have for any fan of instrumental hard rock.  It's nearly flawless with jaw dropping solos and beautiful melodies.

Number of the Beast - Iron Maiden
A metal classic, can't go wrong.

Paranoid - Black Sabbath
Again, a metal classic, nearly every song is amazing.

Normal - Bumblefoot
Probably the best combination of technical guitar playing and pop song writing ever made.

No Gravity - Kiko Loureiro
Instrumental metal with some latin twists.  Pretty awesome.

Black Light Syndrome - Bozio, Levin, Stevens
A mostly improvisational team up that is one of the more unique instrumental rock albums.