Software options for this section include Zelscope, Visual Analyser (http://www.sillanumsoft.org/), MacScope II (http://www.physics2000.com/ ) 2 short routines in Chipmunk BASIC (http://www.nicholson.com/rhn/basic /) and Audacity (http://audacity.sourceforge.net/).
1. SETTING UP THE SOFTWARE
Using the Behringer U-Control:
Plug in the Behringer U-Control usb connector, wait until the new hardware is recognized on the PC, and start VA or MacScope II. Connect the AD 620 amplifier to the Behringer U-Control. In Audacity set the sound input device to audio codec. VA should recognize the codec automatically; otherwise set it manually. MacScope ii usually requires that the input be set manually.
For a PC, Zelscope is the simplest way to display data segments fro 50 mS to 10 seconds. VA will run robustly as an oscilloscope, frequency analyzer, and several other things, although it won't show more than about 100 msec chunks of data in real time. Thus it's most useful for EMG. The Capture Scope button on VA can grab long duration samples, and the Zoom Out option will show them, but it has automatic scaling that interferes with optimal display. Despite the name, MacScope II has versions for both Mac and PC, and will show up to 250 msec chunks in real time. All of these programs recognize the Behringer U-control. (Unfortunately, the PC version of MSII crashes on my Samsung netbook. It works fine on my old IBM tablet.) Set the display timebase to about 10 msec for VA, or 250 msec for MacScope II. You will probably need to set the display zoom between 50 and 256 on VA.
After verifying that you have a decent signal with VA or MacScope II, You can also record, save, and review long segments of EMG and EKG with Audacity. But on a PC or a Mac using the U-Control, the Behringer gain is too low to see the signal during live recording. You will have to record a segment blindly and then boost it using the Amplify control, whereas you can sort of monitor the signal while recording in VA and MacScope II.
Using the Macintosh audio line input:
You can use Audacity or MacScope II as above, or download CB. For CB, cut and paste one of the programs below. Open the Sound section of System Preferences, Select Input, and then Line In. Adjust Input volume to about 50-75%. Then go back to CB and enter 'run'. On my Powerbook CB gives an annoying flash every time it cycles, but it provides a decent display that you can modify however you want. Stop CB by typing the Apple key together with the "." key. If the data is either too large to fit on the display or too small, you can adjust it with the Sound input control or by changing the variable "sc" in line 20 of the CB program. CB seems to limit the graphics window to 1024 pixels wide, which corresponds to 93 milliseconds of data.
'CB PROGRAM 1: 93 MILLISECOND DISPLAY
10 ' THIS PROGRAM GRABS AND DISPLAYS 93 MS
11 ' BLOCKS OF EMG FROM THE AUDIO INPUT
12 ' AND DISPLAYS THEM. SOUND INPUT PREFS
13 ' MUST BE SET TO LINE IN, WITH INPUT
14 ' VOLUME AT 50%-100%. CHANGE THE SCALE
15 ' BY CHANGING sc IN LINE 20.
16 ' BECAUSE AUDIO SAMPLING RATE IS 11025,
17 ' 93 MSEC IS 1024 POINTS.
18 ' STOP IT USING [APPLE][PERIOD].
20 n = 1023 : v = 200 : sc = 52
21 ' (# OF SAMPLES: VERT OFFSET: VERT SCALE)
30 dim a(n)' WHERE THE SAMPLES ARE STORED
40 graphics 0 ' SET UP GRAPHICS WINDOW
50 graphics window 200,300,n,400
60 macfunction("record",a(0),n)' GRAB AUDIO
1000 graphics color 0,0,0
1008 graphics fillrect 0,0,n,400,1
1010 graphics color 0,0,100
1020 graphics moveto 220,20
1030 graphics drawtext "93 MSEC PER SCREEN"
1080 graphics color 100,0,0 ' DRAW EEG IN RED
2000 moveto 0,v-a(0)*sc
2010 for i = 0 to n
2020 lineto i,v-a(i)*sc
2030 next i
2035 x = macfunction("wait",1)
2040 goto 60
'CB PROGRAM 2: 5 SECOND DISPLAY FOR
'EEG, EMG, OR EKG
10 ' THIS PROGRAM GRABS AND DISPLAYS 5-SEC
11 ' BLOCKS OF DATA FROM THE AUDIO INPUT
12 ' AND DISPLAYS THEM. SOUND INPUT PREFS
13 ' MUST BE SET TO LINE IN, WITH INPUT
14 ' VOLUME AT 50-100%. CHANGE THE SCALE
15 ' BY CHANGING sc IN LINE 20.
16 ' BECAUSE AUDIO SAMPLING RATE IS 11025,
17 ' WE USE ONLY 1 SAMPLE IN EVERY 55.
18 ' STOP IT USING [APPLE][PERIOD].
20 n = 55225 : v = 200 : sc = 52
21 ' (# OF SAMPLES: VERT OFFSET: VERT SCALE)
30 dim a(n)' WHERE THE SAMPLES ARE STORED
40 graphics 0 ' SET UP GRAPHICS WINDOW
50 graphics window 200,300,1005,400
60 macfunction("record",a(0),n)' GRAB AUDIO
1000 cls ' CLEAR SCREEN, THEN GRAPH NEXT DATA
1010 graphics color 0,0,100
1020 graphics moveto 420,20
1030 graphics drawtext "5 SECONDS PER SCREEN"
1040 ' DRAW BLUE LINES FOR SECONDS
1050 for j = 200 to 800 step 200
1060 moveto j,50 : lineto j,350
1070 next j
1080 graphics color 100,0,0 ' DRAW DATA IN RED
2000 moveto 0,v-a(0)*sc
2010 for i = 0 to n step 55
2020 lineto i/55,v-a(i)*sc
2030 next i
2040 goto 60
To use Audacity on a Mac with line input, start with Input volume at 100%. See if you can also listen to the EMG by checking the playthrough boxes. You should now be able to hear and see the muscle signal. (If you hear/see 60-Hz noise, go back and check your circuit and your leads.) To see the EMG in full detail, you will have to zoom in on the recorded signal and display only 50-100 msec at a time.
Using a PC Microphone input (EMG only):
The preamp output must have the signal from pin 6 connected to the tip of a mini stereo plug, and the neutral reference to the base of the plug. Leave the middle part of the plug unconnected. Set up VA or MacScope II as above. Because mike input gains vary greatly, you may have to play with this. On both my PC laptops, there seems to be some sort of AGC, so if you contract continuously the signal fades away after several seconds. Intermittent contraction works fine.
2. PUTTING ON THE EMG ELECTRODES
If you spread your fingers apart, you should see a small muscle contracting on the back of your hand, between thumb and index finger. This is the first dorsal interosseous (FDI), and a good place to put one active electrode. After wiping the skin over it briskly with a small amount of alcohol and letting it dry, cover the face of an active electrode with a 1-mm layer of electrode paste and stick it on. Prepare the skin and put the other active electrode on the side of the knuckle of the index finger. In the same way, put the neutral electrode on the back of the hand. Hold the electrodes down with whatever tape you consider friendly to your skin. Connect the batteries.
3. PUTTING ON THE EKG ELECTRODES
EKG can be recorded almost anywhere on the body. For fastidious subjects who wish to keep all their clothes on, you can just put one of the active electrodes on each wrist and the neutral lead over the crease on the inside of either elbow. But you will get a larger signal if one electrode is over the heart. Instead of an active electrode on the left wrist, put that one just below the middle of the left pectoralis muscle, over the highest spot where rib is not covered by muscle. Prepare the skin and electrodes as described just above, and then connect the batteries.
4. RECORDING EMG AND EKG
UNPLUG THE LAPTOP POWER SUPPLY. If you have a voltmeter handy, check that the voltage coming from the preamp at the output plug is some value smaller than the voltage of the batteries. Stick the amplifier output plug into the audio input jack. (On a Mac this is the one with the picture of a microphone or tiny triangles, not the one with the earphones). Open the Sound Input Panel and set it to Line input or Audio Codec, depending on what you are using. For Mac line in, turn input volume to between 50 and 75% to start with. Run the CB EMG program, MacScope ii, or Audacity. If you see prominent 60-cycle noise, turn off the power, pull out the audio plug, and check your connections. DO NOT TINKER WITH THE CIRCUIT WHILE THE POWER IS ON. Push down on the electrodes to be sure they are making contact. Turn off and if possible unplug all nearby electrical gadgets, including overhead lights. Pictures of 60-cycle noise and good signals are shown below. If the signal is too big, adjust the input volume on the laptop. (Click on figures to enlarge.)
Good EMG with CB
60-Cycle Noise
Spread and relax your fingers. You should see EMG signals come and go. Try different finger movements and see which ones maximally activate the FDI. With VA, you can easily see the frequency spectrum of the EMG in real time. It moves toward both higher amplitude and higher frequencies as you contract harder. If you contract the FDI long enough to make it fatigued, this will also shift the frequency spectrum.
EMG Bursts Recorded with Audacity
EMG Spread Out with Audacity
EMG for 100 Msec with PC Mike Input and VA
With either a PC or a Mac, you can use Audacity, VA, and MacScope II to do a frequency analysis of the recorded data. If you have a Mac and are truly ambitious, CB also includes fast Fourier analysis routines, with which you can write your own frequency analysis programs.
EKG Recorded With Low-pass Filter and CB
EKG Without Filter on Audacity
EKG With Filter on Audacity
5 Seconds of EKG without Filter Using Zelscope and U-Control Input
To display long-duration signals with Zelscope, set the sampling rate to 11025 and the buffer length to 5000 mS.
5 Seconds of EKG with Filter on MacScope II
The different sizes of the tall narrow QRS complexes are due to undersampling on the display.