Recent Entries

You have 1539290 hits.

Latest Comments

You are currently viewing archive for January 2009
Posted By Peter Bentley

I spent a bit of time over xmas updating my iStethoscope iphone application (which links to The Undercover Scientist book) and adding many of the features requested by users. As usual, for those interested in the gory details, I'll explain how it works here.

The core features of the program remain unchanged, although I optimized the code to make it a little more stable. Please see the entry for version 1.1 and versio n 1.0 for details of how the audio processing works.

In version 2.0 I've added several major new features. The first and most significant is a shake-activated phonocardiogram. This appears if you give your iphone a left-right shake (that's a sharp movement in the x-axis accelerometer). It then replays the last 8 seconds of audio in a loop, while displaying the wave form and animating a grey bar to show which part is currently being played. The waveform is automatically scaled to fit, so eight seconds of quiet sounds will show a nice wobbly waveform, but a single loud noise may cause such a big spike that the rest of the pattern is scaled to nothing. To stop this happening when you've been listening to your heart and then remove the device causing a loud noise, the scaling ignores the last second of audio. So for best results when viewing the waveform corresponding to your heartbeat, hold the mic in place for 8 or more seconds when you can hear a clear sound, then remove and shake within one second. The phonocardiogram is cancelled with a second shake, and recording of audio begins again. Inevitably the resolution and sampling of the waveform is not perfect (there is only room to display 920 spikes out of 352800) so the display should be regarded as an approximation. Not all information can be shown, so the absence of a spike on the display does not mean there is none there. (The animation uses Layers - the waveform is written once into a bitmap called a layer and then that bitmap is redrawn over the new grey rectangle.)

Note that there's an iphone bug which affects all apps - if the iphone goes into standby for more than a minute while the program is running, the accelerometer is switched off. If you find the program does not respond to movements, restart the program and it should work again.

Another major new feature is a new mode: "Accelerometer." I added this mainly for ipod touch users who have no microphone and so can't use the other modes of the program. In "Accelerometer" mode, front-back vibrations (z-axis forces) are mapped to audio tones. A small movement gives a low tone, a bigger movement gives a higher tone. Sensitivity automatically changes according to the average movements, so several seconds of small movements will result in the iphone becoming more sensitive. This mode is more for fun than anything serious - there are too many interfering subsonic vibrations everywhere for you to detect your heart reliably in this mode. Because it uses the accelerometer to make noises, the shake-activated phonocardiogram is deactivated in this mode (the shaking iphone symbol disappears in the corner to tell you this).

The final change to the program is the addition of help images on the first screen (press the undercover scientist) and more hints in the pop up window about making the most from the program. I've done another youtube video below, enjoy! If you need help, leave a comment here and I'll post a reply.

Posted By Peter Bentley
The US version of The Undercover Scientist is different to all the others around the world. They changed the title to Why Sh*t Happens. We'll have to see whether people appreciate this - here's the first review of the book in USA anyway:

Why Sh*t Happens: The Science of a Really Bad Day

Peter J. Bentley. Rodale, $16.95 (304p) ISBN 978-1-59486-956-3

Everyone has one of those days when nothing seems to go right, but why? Unlike others who have broached the question, British computer science guru Bentley (Digital Biology) actually escorts readers through a really bad day, exploring the science behind all the little things that can go wrong: he looks at why you slept through the alarm (to explain the nature of sleep); why you then slipped on the spilled shampoo (a look at the nature of cleansers and lubricants); why that torrential downpour soaked you on your way to work (a look at the cycle of water in nature). This journey through the day, if sometimes strained (getting chewing gum stuck in one’s hair on the bus), is a neat device for explaining the science behind everyday things such as how clothing is woven and why fabric is so strong (until it rips when you bend over) and how capsaicin in chilis fool the body and provoke a burning sensation. Each chapter ends with a brief tip on how to avoid future mishaps. Hopefully, readers and librarians won’t be put off by the title and miss Bentley’s reader-friendly explanations of the science behind everyday life. (Apr.)