Author Topic: Pictures within microcontrollers  (Read 22657 times)

0 Members and 1 Guest are viewing this topic.

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Pictures within microcontrollers
« Reply #25 on: December 04, 2014, 04:14:47 pm »
The problem isn't your MCU choice at this point, as others have stated. The problem is you don't know enough about your project requirements to even be thinking of an MCU at this point.

You need to take this idea to a professional cardiologist or academic in this field and work with them to figure out simple, basic stuff like: What formats are ECG readouts stored in.

You can't even answer that question, yet you want to know the best MCU to use for processing them? It makes no sense.


Sent from my Tablet
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: Pictures within microcontrollers
« Reply #26 on: December 04, 2014, 04:15:07 pm »
...
The reason for my question is im trying to find a way to compare the ECG readout whether it be graph mathematics algorithms, and when i say compare i mean the heart reading of a person having a heart attack to the person who is actually using it.
Now i have tested it on myself but i dont have any heart conditions so a little hard to test, and im not willing to put anyone else in danger, so i will only test it on me.

The article I linked to in my first reply mentions a database of ECG recordings that they used to evaluate the classification performance of their device. You could see if you could can get access to these data as well to work on yours.

Quote
... Im trying to find what would be the best micro-controller  for this project.

For a prototype you can always go with a more powerful controller. Once things are working OK, you'll have a better estimate of actual memory and processing requirements, and you can then optimize to see if a less powerful device would work as well. Since the detection and classification algorithms will probably involve some pretty sophisticated math, you will probably want a decent ARM processor, maybe one that can do HW floating point operations such as the Cortex M4.


my random ramblings mind-dump.net
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1080
  • Country: au
Re: Pictures within microcontrollers
« Reply #27 on: December 04, 2014, 04:21:29 pm »
Wow! I work in medical electronics, so this is kind of my area. But I take no responsibility for you following any of my advice ;) Of course, I agree with everyone here, but you asked the question so I think you at least deserve a real answer.

First of all, you shouldn't connect an oscilloscope to you without an isolation transformer on the mains or optical isolator on the output of the frontend. Whether or not you feel safe doing it, it's against medical safety regulations to do so. You should look at IEC60601 for more information (but it isn't free unfortunately).

Secondly, a good source of information for you would be an article named "The Principles of Software QRS Detection" by some chaps at the Berlin University of Technology. It's a good overview of the sort of technologies used in this area. Note though that this only goes into detection of the QRS complex, not the P or T waves which would probably be needed for diagnostic purposes. Be prepared for a lot of mathematics.

Generally, the methods of detection other than simple thresholding are very heavy in DSP, so you would probably want a Cortex M4 or a true DSP like a Blackfin. I don't think an 8/16bit micro is a good idea (AVR, PIC, MSP430, STM8S, etc).

And just one question for you before I go: why do you think the device you're designing hasn't been invented yet?
 

Offline warnerTopic starter

  • Contributor
  • Posts: 48
  • Country: gb
    • UADV
Re: Pictures within microcontrollers
« Reply #28 on: December 04, 2014, 04:22:26 pm »
thanks timb, and andreasF
yes i do agree, i need to speak with a professional cardiologist, snf s good point to i can always change the mcu
Jules
 

Offline Codemonkey

  • Regular Contributor
  • *
  • Posts: 235
  • Country: gb
Re: Pictures within microcontrollers
« Reply #29 on: December 04, 2014, 04:22:56 pm »
If I were you I would find a simple way of hooking up your ECG circuit up to a PC (soundcard input or something), and develop your software on a PC. Once complete, you'll have a better idea of the resources required to implement your solution, then you can look at cramming it all into a microcontroller. Probably not what you want to hear, but you'll be a lot more productive and it will be MUCH easier to debug the thing. Save the ECG traces in WAV files or something, then you can use a WAV file editor to create example traces to simulate the conditions you want to detect. Quite how you're going to compare the live data against all the condition traces I don't know, but its not going to be trivial or a simple case of overlaying things.

To be honest, I think you're way out of your depth. The very fact that the thing is going to be used to potentially diagnose some sort of medical condition means that it will be subject to more stringent testing even if it can't directly cause any harm to the wearer. I believe some other product recently fell foul of the same regulations and release to the market had to be delayed until more testing had been completed (sorry, can't remember what it was now).
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1080
  • Country: au
Re: Pictures within microcontrollers
« Reply #30 on: December 04, 2014, 04:25:53 pm »
"the trick is to pick problems that are hard but soluble within a reasonable time"

(bold mine)

Oh man this made my day. I think I'm going to start saying that.
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1080
  • Country: au
Re: Pictures within microcontrollers
« Reply #31 on: December 04, 2014, 04:29:25 pm »
... you will probably want a decent ARM processor, maybe one that can do HW floating point operations such as the Cortex M4.

Just for the record, the M4 can't do hardware floating point, only the M4F. The F stands for "Floating point" I think ;) But they both have DSP extensions. In general, I don't think there are any reasons that you couldn't do this with fixed-point math.
« Last Edit: December 04, 2014, 04:31:24 pm by jeremy »
 

Offline warnerTopic starter

  • Contributor
  • Posts: 48
  • Country: gb
    • UADV
Re: Pictures within microcontrollers
« Reply #32 on: December 04, 2014, 04:29:36 pm »
thanks jeremy
i have looked into QRS complex, and the timing with this.
thank you all for your comments, highly appreciated,
i have gone into the maths side although i find it hard, but i have still done it, ive gone into all or alot of the different types of heart conditions, looked at ecg images ( from google).

I have arranged an appointment to see a cardiologist
Jules
 

Offline warnerTopic starter

  • Contributor
  • Posts: 48
  • Country: gb
    • UADV
Re: Pictures within microcontrollers
« Reply #33 on: December 04, 2014, 04:32:56 pm »
i am aware, i probably am out of my depth, but i want to learn, this is something im passionate about.
Jules
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Re: Pictures within microcontrollers
« Reply #34 on: December 04, 2014, 05:36:23 pm »

... you will probably want a decent ARM processor, maybe one that can do HW floating point operations such as the Cortex M4.

Just for the record, the M4 can't do hardware floating point, only the M4F. The F stands for "Floating point" I think ;) But they both have DSP extensions. In general, I don't think there are any reasons that you couldn't do this with fixed-point math.

Yes I do see your point.  But I will add this for you consideration.  The op seems to want this device to be closer to an ECG monitor that a Heart rate monitor.  ECG characteristics are much more varied in the infant and child. 

Performing a usable comparison would require floating point math.  If the sample and example are normalized for integer math many features will be lost.  The reason the most common answer says he will need to use floating point math, unless the op gives indication he is looking to build something much closer to a heart rate monitor. 

Besides requiring a floating point math dose not make the project unfeasible.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2625
  • Country: 00
    • My random blog.
Re: Pictures within microcontrollers
« Reply #35 on: December 04, 2014, 05:43:09 pm »
there is always https://www.google.com/search?q=ecg+compressed+sensing


Whole thread reads like Nigerian scam chain mail. Im impressed how everyone is so nice and accommodating, Im barely able to stop myself.
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline mtdoc

  • Super Contributor
  • ***
  • Posts: 3575
  • Country: us
Re: Pictures within microcontrollers
« Reply #36 on: December 04, 2014, 06:09:56 pm »
Warner-

I commend your enthusiasm and intentions but irregardless of the technical difficulties (which others have described well) I don't think your planned device makes sense from a medical perspective.   ECGs are of marginal use for most pediatric heart problems.  Most pediatric heart conditions are structural (valves, heart chambers, etc) that affect the heart's pump function and oxygenation of lungs and the rest of the body.  These problems are best monitored by an echocardiogram (basically an ulstrasound of the heart).

Conditions causing fatal arrhythmias are extremely rare and in most cases not easily identified by ECGs ahead of time.  The exception is bradycardia (slowed heart rate). There already exists several commercial infant heart rate monitors - yet even this simple type of home monitor has been found to be of little benefit - causing lots of parental anxiety with false alarms, etc.  They have not been shown to save lives.

The bottom line is that even if you could create a device to be used at home which would monitor a childs ECG and compare it to previous ones - it would be of little or no benefit medically except perhaps to give overly anxious parents something else to worry about....

Good luck and keep thinking outside the box.  If your interested in medical device design, I'd recommend some education (formal or informal) in biomedical engineering to better identify where the need is for new innovative devices.
 

Offline warnerTopic starter

  • Contributor
  • Posts: 48
  • Country: gb
    • UADV
Re: Pictures within microcontrollers
« Reply #37 on: December 04, 2014, 06:14:25 pm »
Warner-

I commend your enthusiasm and intentions but irregardless of the technical difficulties (which others have described well) I don't think your planned device makes sense from a medical perspective.   ECGs are of marginal use for most pediatric heart problems.  Most pediatric heart conditions are structural (valves, heart chambers, etc) that affect the heart's pump function and oxygenation of lungs and the rest of the body.  These problems are best monitored by an echocardiogram (basically an ulstrasound of the heart).

Conditions causing fatal arrhythmias are extremely rare and in most cases not easily identified by ECGs ahead of time.  The exception is bradycardia (slowed heart rate). There already exists several commercial infant heart rate monitors - yet even this simple type of home monitor has been found to be of little benefit - causing lots of parental anxiety with false alarms, etc.  They have not been shown to save lives.

The bottom line is that even if you could create a device to be used at home which would monitor a childs ECG and compare it to previous ones - it would be of little or no benefit medically except perhaps to give overly anxious parents something else to worry about....

Good luck and keep thinking outside the box.  If your interested in medical device design, I'd recommend some education (formal or informal) in biomedical engineering to better identify where the need is for new innovative devices.





Thank you, much appreciated, this is something i am highly interested within, and thank you for the information,
and i will certainly look into biomedical engineering, thank you so much
Jules
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Pictures within microcontrollers
« Reply #38 on: December 04, 2014, 06:16:54 pm »
i am aware, i probably am out of my depth, but i want to learn, this is something im passionate about.

In reading this thread I think the biggest concern is that you need to know the costs.  I know several people that have lost their houses because they stepped into the medical device field unprepared. 
The points I want you to consider are: 
1:  The medical device field is very regulated, and layers of regulation costs you money.  Ie many years ago a friend paid $30,000.00 for a preliminary design review and received the answer "design criterial not met" answer.  After allot of head scratching he figured out he didn't specify the specific type suffix on one cap. 
2:  Your device does not need to cause death for you to loose everything.  It is possible to be sued for perceived harm.  Everyone want to help an infant, but few can risk the legal dangers.  The biggest reason only the well connected huge companies enter this area for the huge profits, less the cost of a huge legal team of course.  After all a hot cup of coffee cost one company big just because the hot coffee was actually hot. 
3:  Just because this project is medical device it will take you years to get it out there.  But it will take a big company much less time to like your idea and make their own. 
4:  testing of any sort of a medical device has many regulation.  Please don't even use the device on your own kid, and tell anyone about it.  If child welfare finds out from the wrong people you could have a battle you don't want.  Technically testing the device on your self is not allowed but Darwinism is an accepted concept.

The advice given is advised options. 
If you only want the device created and no money back.  Pitch your uncertified unfinished device to a medical device company.  Who knows they may hire you to develop it for them.  This has happened before. 
If you do not want to give up control, and still not get profit.  Go back to your school and see if you can make it under a fellowship.  The easiest way I know of to be classified as research for a medical device. 

Your options are endless.  Just understand the medical device field is very different in many ways (legally, technically and psychologically).  My personal choice was to stay away, but you are free to make your choice.  I just want you to enter it with as much information you can get. 

The rest of the comments about process are valid but also but not the purpose of my response.
« Last Edit: December 04, 2014, 06:18:42 pm by WarSim »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Pictures within microcontrollers
« Reply #39 on: December 04, 2014, 06:18:15 pm »
when i say images, im talking jpeg.

ignoring liability and medical issues for now i suspect a microcontroller is not the best tool for this job. a full size pc may have a shot. certainly the easiest first iteration. comparing "pictures" is not  trivial. programming, not circuit design, will most likely eat up virtually all the development time and money.

also appears this must be farmed out. judging from comments i estimate 20-30 year learning curve for diy.
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1080
  • Country: au
Re: Pictures within microcontrollers
« Reply #40 on: December 04, 2014, 06:24:20 pm »

... you will probably want a decent ARM processor, maybe one that can do HW floating point operations such as the Cortex M4.

Just for the record, the M4 can't do hardware floating point, only the M4F. The F stands for "Floating point" I think ;) But they both have DSP extensions. In general, I don't think there are any reasons that you couldn't do this with fixed-point math.

Yes I do see your point.  But I will add this for you consideration.  The op seems to want this device to be closer to an ECG monitor that a Heart rate monitor.  ECG characteristics are much more varied in the infant and child. 

Performing a usable comparison would require floating point math.  If the sample and example are normalized for integer math many features will be lost.  The reason the most common answer says he will need to use floating point math, unless the op gives indication he is looking to build something much closer to a heart rate monitor. 

Besides requiring a floating point math dose not make the project unfeasible.

Well unfortunately this is not true, and I know because I have previously done the exact thing you have said is not possible. I can't give any sources, but it's anecdote vs anecdote here anyway. Sorry!  ^-^
 

Offline warnerTopic starter

  • Contributor
  • Posts: 48
  • Country: gb
    • UADV
Re: Pictures within microcontrollers
« Reply #41 on: December 04, 2014, 06:25:20 pm »
when i say images, im talking jpeg.

ignoring liability and medical issues for now i suspect a microcontroller is not the best tool for this job. a full size pc may have a shot. certainly the easiest first iteration. comparing "pictures" is not  trivial. programming, not circuit design, will most likely eat up virtually all the development time and money.

also appears this must be farmed out. judging from comments i estimate 20-30 year learning curve for diy.


yes, you are right, there are alot of different ways and methods this could be built and alot of ways i could get sued or in legal problems, but this is why i test it on ME, i refuse to test on anyone else but me,  and thank you for pointing out all the legal side, this is something i need to go deeper into once i have completed the build and got it all working ( second circuit).
Jules
 

Online Jeroen3

  • Super Contributor
  • ***
  • Posts: 4658
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Pictures within microcontrollers
« Reply #42 on: December 04, 2014, 06:25:48 pm »
I've seen someone walk around with a device like this. It was powered by some small batteries, and it could beep and store any anomalies it measured in the heartbeat.
Then you go to the hospital, they read it, and voila an basic ecg from when something did actually happen.
These are used to investigate arrhythmia. Because when you're hooked up to the hospital ecg, everything looks fine...
Another feature was that you were able to push a button when it detected something. Because some physical activities might trigger a false-alarm.

For educational purposes this is a great project, and part of my last university year had to develop such device. For elderly people.
Detect basic life signs, and detect when they fall. The problem was is that elderly people might fall, and are not able to get up due to weakness or hip fractures.
Some groups used this: http://people.csail.mit.edu/mrub/vidmag/
 

Offline mtdoc

  • Super Contributor
  • ***
  • Posts: 3575
  • Country: us
Re: Pictures within microcontrollers
« Reply #43 on: December 04, 2014, 06:35:09 pm »
I've seen someone walk around with a device like this. It was powered by some small batteries, and it could beep and store any anomalies it measured in the heartbeat.
Then you go to the hospital, they read it, and voila an basic ecg from when something did actually happen.
These are used to investigate arrhythmia. Because when you're hooked up to the hospital ecg, everything looks fine...
Another feature was that you were able to push a button when it detected something. Because some physical activities might trigger a false-alarm.


Yes, "Holter monitors" which record continuously (usually for 48 hours) and "Cardiac event monitors" ( which record and store a buffer then only keep the data immediately before and after an "event" which is marked by the patient pushing a button, have been around for years. Traditionally, these were kept for a short period by patients and the data was later downloaded for review by a physician.

Now the trend is to use small, one time use, devices which are mailed by the patient into the company that makes them for preliminary data review which is then passed on to  a physician locally.

The "Zio Patch" is the leading brand which I use for my patients.

These are useful for adults (where cardiac arrhythmias are common) but rarely used in children for reasons I described above.
« Last Edit: December 04, 2014, 06:40:47 pm by mtdoc »
 

Offline warnerTopic starter

  • Contributor
  • Posts: 48
  • Country: gb
    • UADV
Re: Pictures within microcontrollers
« Reply #44 on: December 04, 2014, 06:38:38 pm »
good to know, thank you
Jules
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Pictures within microcontrollers
« Reply #45 on: December 04, 2014, 06:58:05 pm »
Cardiac event monitors" ( which record and store a buffer then only keep the data immediately before and after an "event" which is marked by the patient pushing a button

A perfect application for MCU. Pushing a button a lot easier to detect than analyzing EKG data for anomalies or comparing pictures. Several orders of magnitude easier.
 

Offline WarSim

  • Frequent Contributor
  • **
  • Posts: 514
Pictures within microcontrollers
« Reply #46 on: December 04, 2014, 06:58:49 pm »

... you will probably want a decent ARM processor, maybe one that can do HW floating point operations such as the Cortex M4.

Just for the record, the M4 can't do hardware floating point, only the M4F. The F stands for "Floating point" I think ;) But they both have DSP extensions. In general, I don't think there are any reasons that you couldn't do this with fixed-point math.

Yes I do see your point.  But I will add this for you consideration.  The op seems to want this device to be closer to an ECG monitor that a Heart rate monitor.  ECG characteristics are much more varied in the infant and child. 

Performing a usable comparison would require floating point math.  If the sample and example are normalized for integer math many features will be lost.  The reason the most common answer says he will need to use floating point math, unless the op gives indication he is looking to build something much closer to a heart rate monitor. 

Besides requiring a floating point math dose not make the project unfeasible.

Well unfortunately this is not true, and I know because I have previously done the exact thing you have said is not possible. I can't give any sources, but it's anecdote vs anecdote here anyway. Sorry!  ^-^
Cool,  BTW I did not intend that it was "not possible".  I meant to say that I agree with the previous post saying an FPU maybe required.  I am just making my opinion based on information I received from prenatal medical persons. 
I spent the last 8 years of my career doing things that was deemed impossible.  I would never intentional say something was not possible.  I added that even if it did need a FPU doesn't mean the project is not possible, to emphasize that the project is still possible.  I guess I did not stress that point enough.
« Last Edit: December 04, 2014, 11:00:08 pm by WarSim »
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: Pictures within microcontrollers
« Reply #47 on: December 04, 2014, 07:27:08 pm »
I have a strong suspicion that real time detection of EKG anomalies, specially comparing with JPGs, without an FPU is VIRTUALLY impossible. The real question is whether any off the shelf MCUs would provide a cost effective solution.
 

Online nali

  • Frequent Contributor
  • **
  • Posts: 901
  • Country: gb
Re: Pictures within microcontrollers
« Reply #48 on: December 04, 2014, 08:43:29 pm »
I've seen someone walk around with a device like this. It was powered by some small batteries, and it could beep and store any anomalies it measured in the heartbeat.
Then you go to the hospital, they read it, and voila an basic ecg from when something did actually happen.
These are used to investigate arrhythmia. Because when you're hooked up to the hospital ecg, everything looks fine...
Another feature was that you were able to push a button when it detected something. Because some physical activities might trigger a false-alarm.


Yes, "Holter monitors" which record continuously (usually for 48 hours) and "Cardiac event monitors" ( which record and store a buffer then only keep the data immediately before and after an "event" which is marked by the patient pushing a button, have been around for years. Traditionally, these were kept for a short period by patients and the data was later downloaded for review by a physician.

Now the trend is to use small, one time use, devices which are mailed by the patient into the company that makes them for preliminary data review which is then passed on to  a physician locally.

The "Zio Patch" is the leading brand which I use for my patients.

These are useful for adults (where cardiac arrhythmias are common) but rarely used in children for reasons I described above.

I used to work for a company making Holter recorders/analysers back in the '90s. For the analysis we used a bunch of analogue filters to isolate & separate the component parts of the waveform (P-wave, QRS, T-wave) then once the ECG had been broken down into basic digital data a couple of 8-bit micros looked for misshapen, early/late beats, tachycardia etc. One of the biggest challenges was separating the ECG from EMG (electrical noise produced by muscles).

Even then, the ECG was just replayed and detected events just highlighted for a human to decide whether they were of real concern or an artifact...

It's a noble enough project, but more sited for a Uni degree or something like that IMHO.

 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1080
  • Country: au
Re: Pictures within microcontrollers
« Reply #49 on: December 04, 2014, 08:51:16 pm »

...
Well unfortunately this is not true, and I know because I have previously done the exact thing you have said is not possible. I can't give any sources, but it's anecdote vs anecdote here anyway. Sorry!  ^-^
Cool,  BTW I did not intend that it was "not possible".  I meant to say that I agree with the previous post saying an FPU you me required.  I am just making my opinion based on information based on information received from prenatal medical persons. 
I spent the last 8 years of my career doing things that was deemed impossible.  I would never intentional say something was not possible.  I added that even if it did need a FPU doesn't mean the project is not possible, to emphasize that the project is still possible.  I guess I did not stress that point enough.

No biggie, wasn't trying to be argumentative, just saying that I've done it already, that's all  ^-^. The trouble with FPUs I have found is floating point ops can get tricky when you have hardware interrupts. I believe this is the reason the linux kernel has a blanket ban on floating point operations (or at least it did the last time I checked).

I have a strong suspicion that real time detection of EKG anomalies, specially comparing with JPGs, without an FPU is VIRTUALLY impossible. The real question is whether any off the shelf MCUs would provide a cost effective solution.

Ok, well if you're going to be like that, then please be kind enough to explicitly define what you mean by "real time", "detection", "EKG" (number of leads, position?) and "EKG anomalies". Also, please read this: http://link.springer.com/chapter/10.1007%2F978-3-642-53862-9_31 (title is: "Using Fixed Point Arithmetic for Cardiac Pathologies Detection Based on Electrocardiogram")
« Last Edit: December 04, 2014, 09:02:46 pm by jeremy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->