Tuesday, 8 August 2017

PS3 Controller to move a USB Robot Arm

Guest Blogger Hiren Mistry, Nuffield Research Placement Student working at the University of Northampton.


How to use a PS3 Controller to move a USB Robot Arm on a Raspberry Pi
By Hiren Mistry
This program enables the user to control the robot arm via a PlayStation 3 Controller, through USB connection.
Requirements:
·       PyUSB- This must be installed so the Python Code can interact with the USB Robot Arm. It can be downloaded from https://sourceforge.net/projects/pyusb/files/PyUSB%201.0/1.0.0/pyusb-1.0.0.tar.gz/download
·       PyGame- This module is needed to receive input from the PS3 controller. It can be downloaded from http://www.pygame.org/download.shtml 

How does it Work?


To receive the input from the controller PyGame is used. PyGame is a set of modules used for writing games and contains the necessary modules need to receive the PlayStation controller input.
The input consists of 3 major parts of the controller:
·       Buttons- These have a Boolean on/off state

·       Hats- These are digital inputs and return a 1 or 0. Hats tilt left/right or up/down.

·       Axis- These are your standard joysticks and return a value between 1 and -1. One joystick has two axes- up/down and left/right.

For my input, I have decided to use a combination of Buttons and Axis (Joysticks) to control the Robot Arm.




Next, I found out which input is assigned to which number which will enable me to move the arm once I have mapped each input.
Here are some commands:
Command
Explanation
pygame.joystick.init()
Initialize pygame to read controllers
pygame.joystick.get_count()
Get 1 joystick, number 0
pygame.joystick.Joystick(0)
Assign the first controller
joystick.init()

Initialize the first controller for reading
joystick.get_numaxes()
Return the number of axes on the controller
joystick.get_axis(axis_number)
Get the analogue value (float) of the specified axis
pygame.joystick.Joystick.get_button(i)
Returns the current state of a joystick button.
pygame.joystick.Joystick.quit
This will uninitialize the Joystick.



Axis Number
0 = Left joystick left to right values -1.0 to 1
1 = Left joystick up to down values -1.0 to 1
2 = Right joystick left to right values -1.0 to 1
3 = Right joystick up to down values -1.0 to 1

The picture above illustrates the axis value for each axis number depending on the position of the joystick. For example, if the left joystick was in the bottom left direction, then the axis numbers and values would be ‘Axis Number 0 = -1, Axis Number 1 = 1’.
Button Number
Button
Number
Button
Number
SELECT
0
R2
9
L3
1
L1
10
R3
2
R1
11
START
3
TRIANGLE
12
D-PAD UP
4
CIRCLE
13
D-PAD RIGHT
5
CROSS
14
D-PAD DOWN
6
SQUARE
15
D-PAD LEFT
7
PLAYSTATION LOGO
16
L2
8



Axis numbers and Button numbers were both found using the code below. This code prints the axis values (from -1 to 1) and Button States (1 or 0) if they are pressed. I would then press a button/move an axis and analyse the numbers produced. These may be different depending on how your controller is setup so I would recommend running the code below and test which buttons are assigned to which numbers.


import pygame, sys, time    #Imports Modules
from pygame.locals import *

pygame.init()#Initializes Pygame
pygame.joystick.init()
joystick = pygame.joystick.Joystick(0)
joystick.init()#Initializes Joystick

# get count of joysticks=1, axes=27, buttons=19 for DualShock 3

joystick_count = pygame.joystick.get_count()
print("joystick_count")
print(joystick_count)
print("--------------")

numaxes = joystick.get_numaxes()
print("numaxes")
print(numaxes)
print("--------------")

numbuttons = joystick.get_numbuttons()
print("numbuttons")
print(numbuttons)
print("--------------")

loopQuit = False
while loopQuit == False:

    # test joystick axes and prints values
    outstr = ""
    for i in range(0,4):
        axis = joystick.get_axis(i)
        outstr = outstr + str(i) + ":" + str(axis) + "|"
        print(outstr)

    # test controller buttons
    outstr = ""
    for i in range(0,numbuttons):
           button = joystick.get_button(i)
           outstr = outstr + str(i) + ":" + str(button) + "|"
    print(outstr)

    for event in pygame.event.get():
       if event.type == QUIT:
           loopQuit = True
       elif event.type == pygame.KEYDOWN:
           if event.key == pygame.K_ESCAPE:
               loopQuit = True
             
       # Returns Joystick Button Motion
       if event.type == pygame.JOYBUTTONDOWN:
        print("joy button down")
       if event.type == pygame.JOYBUTTONUP:
        print("joy button up")
       if event.type == pygame.JOYBALLMOTION:
        print("joy ball motion")
       # axis motion is movement of controller
       # dominates events when used
       if event.type == pygame.JOYAXISMOTION:
           # print("joy axis motion")

    time.sleep(0.01)
pygame.quit()
sys.exit()

When running this testing code, I would test each part of the remote separately so detecting the inputs is easier. For example to test the axis, I would comment out everything from '#test controller buttons' to '#print ("joy axis motion")' and run the program.


Building the program
I will require multiple commands to happen at the same time but only one command will be sent to the Robot Arm at once. Therefore, the python file will need to build the command, detecting a range of inputs and compile one output command. To build one command, the commands need to be combined from their binary format into one integer command (See ‘Basic Commands using a USB Robotic Arm with a Raspberry Pi’)

Here is the final program, ps3controller.py with explanations on each line.
import pygame #Import Modules
import usb.core
import time
pygame.init()#Initialize pygame

# Wait for a joystick
while pygame.joystick.get_count() == 0:
  print 'waiting for joystick count = %i' % pygame.joystick.get_count()
  time.sleep(10)
  pygame.joystick.quit()
  pygame.joystick.init()

j = pygame.joystick.Joystick(0)
j.init()#Initialize Joystick

print 'Initialized Joystick : %s' % j.get_name()#Print joystick if present

armFound = False

while not armFound: #Find Robot Arm
  dev = usb.core.find(idVendor=0x1267, idProduct=0x0000)

  if dev is None:#If Robot Arm not found, alert user
    print 'Arm not found. Waiting'
    time.sleep(10)
  else:
    armFound = True
#this arm should just have one configuration
dev.set_configuration()

#Print Controls to user
print("")
print("Joysticks:")
print("LEFT JOY UP/DOWN:    SHOULDER UP/DOWN")
print("LEFT JOY LEFT/RIGHT: BASE CLOCKWISE/ANTICLOCKWISE")
print("RIGHT JOY UP/DOWN:   ELBOW UP/DOWN")
print("R1: WRIST UP")
print("R2: WRIST DOWN")
print("X:  GRIP OPEN")
print("O:  GRIP CLOSE")
print("SELECT: TOGGLE LIGHT ON/OFF")
print("")
print("To Close, press 'Ctrl + C'")

# How far to move the JoyStick before it has an effect (0.60 = 60%)
threshold = 0.50#Sensitivity

# Key mappings
PS3_BUTTON_SELECT = 0


PS3_AXIS_LEFT_HORIZONTAL = 0
PS3_AXIS_LEFT_VERTICAL = 1
PS3_AXIS_RIGHT_HORIZONTAL = 2
PS3_AXIS_RIGHT_VERTICAL = 3
PS3_AXIS_X = 17
PS3_AXIS_CIRCLE = 18
PS3_AXIS_R1 = 15
PS3_AXIS_R2 = 13

# Robot Arm  defaults
Command = (0,0,0)
lightonoff = 0
shoulder = 0
base = 0
elbow = 0
wristup = 0
wristdown = 0
grip_open = 0
grip_close = 0
grip_command = 0
wrist_command = 0
shoulder_command = 0
base_command = 0
elbow_command = 0
           
 # ARM control
def SetCommand(axis_val):#Returns number depending on axis value
    if axis_val > threshold:
        return 1
    elif axis_val < -threshold:
        return 2
    elif abs(axis_val) < threshold:
        return 0


def BuildCommand(shoulc,basec,elbowc,wristc,gripc,lightc):#Builds Command
    byte1 = shoulc + elbowc +  wristc + gripc#Combines instructions for byte1
    list1 = [str(shoulc), str(elbowc), str(wristc), str(gripc), str(basec), str(lightc)]#Compiles commands into 1 command
        
def ProcessArm(event):#Detects input and processes
      global Command, lightonoff, shoulder, base, elbow, wristup, wristdown, grip_open, grip_close, grip_command, wrist_command, shoulder_command, base_command, elbow_command
     
      if event.type == pygame.JOYBUTTONDOWN:
          if event.button == PS3_BUTTON_SELECT:
            if lightonoff == 0:
              lightonoff = 1
            else:
              lightonoff = 0
      elif event.type == pygame.JOYAXISMOTION:
        if event.axis == PS3_AXIS_LEFT_VERTICAL:
          shoulder = event.value
        elif event.axis == PS3_AXIS_LEFT_HORIZONTAL:
          base = event.value
        elif event.axis == PS3_AXIS_RIGHT_VERTICAL:         
          elbow = event.value
        elif event.axis == PS3_AXIS_R1:   
          wristup = event.value
        elif event.axis == PS3_AXIS_R2:
          wristdown = event.value
        elif event.axis == PS3_AXIS_X:         
          grip_open = event.value
        elif event.axis == PS3_AXIS_CIRCLE:         
          grip_close = event.value

        # Open/Close Gripper?
        if grip_open > threshold:
            grip_command = 1
        elif grip_close > threshold:
            grip_command = 2
        else:
            grip_command = 0
       
       
        # Wrist Up/Down?
        if wristup > threshold:
            wrist_command = 1*4
        elif wristdown > threshold:
            wrist_command = 2*4
        else:
            wrist_command = 0

        #Produces final command for each 'body' part
        shoulder_command = SetCommand(shoulder)*64
        base_command = SetCommand(base)
        elbow_command = SetCommand(elbow)*16
       
        # Work out what to send out to the robot
        NewCommand = BuildCommand(shoulder_command,base_command,
                                  elbow_command, wrist_command, grip_command,lightonoff)
                                 
        # If the command has changed, send out the new one
        if NewCommand != Command:
            dev.ctrl_transfer(0x40, 6, 0x100, 0, NewCommand, 1000)
            Command = NewCommand
try:
    # Loop forever
    while True:
        time.sleep(0.1)#time.sleep(0.1)
       
        # read in events
        events = pygame.event.get()
              
        # and process them
        for event in events:
            ProcessArm(event)
except KeyboardInterrupt:
    j.quit()#End joystick input


For more information on the project above, go to:


Acknowledgements
Hiren's time was funded through Nuffield Foundation's Research Placement Scheme. The robot arm is part of Santander UK funding for Robots in Schools.

All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Monday, 7 August 2017

kitronik :Move mini buggy (Python control of LEDs)

In two previous posts I looked at control the :Move buggy using JavaScript Blocks or Python. In this post we are going to look at controlling the LEDs using Python (or more accurately micropython).

Pin 0 controls the LEDs, they are based on5  NeoPixel compatible, RGB, addressable LEDs; so the Neopixel protocols (and library for Neopixels) can be used. 



Code First five colours of the rainbow. The array lig holds the RGB settings for the rainbow colours (more details on the RGB colours can be found at Lorraine Underwood's Halloween Cloud project). In the code below, the five LEDs have a different colour allocated to them.

from microbit import *
import neopixel

np = neopixel.NeoPixel(pin0, 5)
lig=[[255,0,0],[255,127,0],[255,255,0],[0,255,0],[0,0,255],[75,0,136],[139,0,255]]
while True:
    np[0] = lig[0]
    np[1] = lig[1]
    np[2] = lig[2]
    np[3] = lig[3]
    np[4] = lig[4]

    np.show()


Code to cycle through the rainbow
from microbit import *
import neopixel

np = neopixel.NeoPixel(pin0, 5)
lig=[[255,0,0],[255,127,0],[255,255,0],[0,255,0],[0,0,255],[75,0,136],[139,0,255]]
count1=1
count0=0
count2=2
count3=3
count4=4
while True:
        np[0] = lig[count0]
        if count0>=6:
            count0=0;
        else:
            count0=count0+1
        np[1] = lig[count1]
        if count1>=6:
            count1=0;
        else:
            count1=count1+1
        np[2] = lig[count2]
        if count2>=6:
            count2=0;
        else:
            count2=count2+1
        np[3] = lig[count3]
        if count3>=6:
            count3=0;
        else:
            count3=count3+1
        np[4] = lig[count4]
        if count4>=6:
            count4=0;
        else:
            count4=count4+1
        np.show()

        sleep(500)


All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

kitronik :Move buggy (Python controlled servos)

In a previous post I looked at controlling the Kitronik :Move buggy using Javascript based blocks. In this short post I will show controlling the servos of the micro:bit based :Move buggy with Python.

Control is via pin1(left motor) and pin2 (right motor) and the motors have to be driven in opposite directions to move forward or backwards. The direction of the motors is controlled by the analogue value written to the pins; pinX.write_analog(180) - anticlockwise or pinX.write_analog(1) - clockwise (pinX.write_analog(0) - stops the motor). Setting the analog_period seems to work at 20ms; this was found by experiment, discussed in a previous post.

So the initial code below sets up the moves for forward, backward, turn left, turn right all controlled with a move for so many milliseconds.

Code 
from microbit import *

pin1.set_analog_period(20)
pin2.set_analog_period(20)

def forward(N):
    pin1.write_analog(180)
    pin2.write_analog(1)
    sleep(N)
    
def backward(N):
    pin1.write_analog(1)
    pin2.write_analog(180)
    sleep(N)

def turnLeft(N):
    pin1.write_analog(1)
    pin2.write_analog(1)
    sleep(N)

def turnRight(N):
    pin1.write_analog(180)
    pin2.write_analog(180)
    sleep(N)

while True:
    forward(1500)
    backward(1500)
    turnLeft(1500)
    turnRight(1500)   

I would recommend running the :Move buggy on a surface that isn't smooth, I found the wheels slipping on a smooth surface. This is a really nice little robot to play with.

All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Wednesday, 26 July 2017

kitronik :Move mini buggy (JavaScript blocks)

Finally got around to building add playing with the Kitronik :Move https://www.kitronik.co.uk/5624-move-mini-buggy-kit-excl-microbit.html (see below - I decided to put the green sides on the outside - just to be different). One of its features is a vertical set of holes for a pen to be placed in.


Add the blocks (found at https://github.com/KitronikLtd/pxt-kitronik-servo-lite) in blocks editor (https://makecode.microbit.org/) to control the motors. You can do the same thing with writing to the pins, those instructions come with the build instructions, but using the extra blocks  is a little easier to understand. Also add the package for neopixels (type in neopixels in the search box to find them). Two very good tutorials I found useful to start with can be found at:









1. Motor example
I wanted it so that press A on the Micro:bit the robot goes turns right, goes forward, goes back and turns left. 






A stop block does need to be included, without it the :Move will continue moving. The wheels I found can slip on some surfaces reducing the precision, but still fun to play with.

2. At the start and stopping.
I want to use the motors and the 'pixels', but I want to have a known starting position for the motors and set the turning speed; this was possible using the blocks (see below). The pixels are set at this point on pin P0 (see below) as well. 

To stop both the motors and cycling of the pixels - pressing buttons A+B together was set up to this.




3. Rainbow on the pixels.
On pressing button B the pixels rotate through a range of colours.




4. Summary
This is great fun. Having the set of blocks adding for the servos means it is a bit simpler to work with. 








All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Tuesday, 25 July 2017

genetic algorithms to select filters for evoked potential enhancement

Use of evolutionary algorithms to select filters for evoked potential enhancement
Scott Turner
University of Leicester
Published: 2000
http://hdl.handle.net/2381/29366
DOI: 10.13140/RG.2.1.3654.3204

Abstract
Evoked potentials are electrical signals produced by the nervous system in response to a stimulus. In general these signals are noisy with a low signal to noise ratio. The aim was to investigate ways of extracting the evoked response within an evoked potential recording, achieving a similar signal to noise ratio as conventional averaging but with less repetitions per average. In this thesis, evolutionary algorithms were used in three ways to extract the evoked potentials from a noisy background. First, evolutionary algorithms selected the cut-off frequencies for a set of filters. A different filter or filter bank was produced for each data set. The noisy signal was passed through each filter in a bank of filters the filter bank output was a weighted sum of the individual filter outputs. The goal was to use three filters ideally one for each of the three regions (early, middle and late components), but the use of five filters was also investigated. Each signal was split into two time domains: the first 30ms of the signal and the region 30 to 400ms. Filter banks were then developed for these regions separately. Secondly, instead of using a single set of filters applied to the whole signal, different filters (or combinations of filters) were applied at different times. Evolutionary algorithms are used to select the duration of each filter, as well as the frequency parameters and weightings of the filters. Three filtering approaches were investigated. Finally, wavelets in conjunction with an evolutionary algorithm were used to select particular wavelets and wavelet parameters. A comparison of these methods with optimal filtering methods and averaging was made. Averages of 10 signals were found suitable, and time-varying techniques were found to perform better than applying one filter to the whole signal.














Full text versions are available from:

References

Akay M and Daubenspeck JA (1999) Investigating the Contamination of Electroencephalograms by Facial Muscle Electromyographic Activity using Matching Pursuit Brain and Language Vol. 66 p. 184-200.
http://dx.doi.org/10.1006/brln.1998.2030
Aguiar P, David A, Palo S, Rosa A (2000) EEGSolver-Brain Activity and Evolutionary algorithms [on-line] http://thcta.ist.utl.ptl/~142549/nies/paDer/Daper.html Accessed on 7/2/2000
Aminoff MJ (1999) Electrophysiology Ed. Goetz CG, Pappert EJ Textbook of Clinical Neurophysiology Saunders p. 436-457.
Aminoff MJ and Eisen A (1999) Somatosensory Evoked Potentials Ed. Aminoff MJ Electrodiagnosis in Clinical Neurology Churchill Livingston 4th Edition p. 513-536.
Angel A, Linkens DA, Ting CH (1999) Estimation of Latency Changes and Relative Amplitudes in Somatosensory Evoked Potentials Using Wavelets and Regression Computers and Biomedical Research Vol. 32 p. 209-251.
Anziska BJ, Cracco RQ (1981) Short latency SEPs to median nerve stimulation: Comparison o f recording methods and origin o f components Electroencephalography and Clinical Neurophysiology Vol. 52 p. 531-539.
http://dx.doi.org/10.1016/0013-4694(81)91428-0
Bartnik EA, Blinowska KJ, Durka PJ (1992a) Single evoked potential reconstruction by means of wavelet transform Biological Cybernetics Vol. 67 p. 175-181.
http://dx.doi.org/10.1007/BF00201024
Bartnik EA, Blinowska KJ (1992b) Wavelets - A new method of Evoked Potential Analysis Medical and Biological Engineering and Computing Vol. 30 p. 125-126.
Bentley PM, McDonnell JTE (1994) Wavelet Transforms: An Introduction IEE Electronics &amp; Communication Engineering Journal p. 175-186.
Bertrand O, Bohorquez J, Pernier J (1994) Time-frequency Digital Filtering Based on an Invertible Wavelet Transform. An Application to Evoked Potentials IEEE Transactions o f Biomedical Engineering Vol. 41 No 1 p.77-88.
Bezerianos A, Laskaris N, Fotopoulos S, Papathanasopoulos (1995) Data dependent weighted averages for recording evoked potential signals Electroencephalography and Clinical Neurophysiology Vol. 96 p. 468-471.
http://dx.doi.org/10.1016/0168-5597(95)00070-9
Blinowska KJ, Durka PJ (1997) Introduction to wavelet analysis British Journal ofAudiologyVo\. 31 No. 6 p. 449-459.
Braun JC, Hanley DF, Thakor NV (1996) Detection of Neurological Injury Using Time-Frequency Analysis of Somatosensory Evoked Potentials Electroencephalography and Clinical Neurophysiology Vol. 100 No. 4 p. 310- 318.
http://dx.doi.org/10.1016/0168-5597(96)95115-1
leBron Paige A, Ozdamar O, Delegado RE (1996) Two dimensional spectral processing of sequential evoked potentials Medical &amp; Biological Engineering &amp; Computing Vol. 34 p. 239-243.
http://dx.doi.org/10.1007/BF02520080
Cadwell JA and Villarreal (1999) Electrophysiological Equipment and Electrical Safety Ed. Aminoff MJ Electrodiagnosis in Clinical Neurology Churchill Livingston 4thEdition p. 15-33.
Campbell JA (1985) Observations on Somatosensory Evoked Potentials Recorded From Within the Human Spinal Cord , PhD Thesis, University of Liverpool.
Campbell JA and Leandri M (1986) The effects of High-pass Filters on Computer Reconstructed Evoked Potentials Electroencephalography and Clinical Neurophysiology Vol. 57 pp 99-101.
Carlton EH, Katz S (1980) Is Wiener Filtering an Effective Method of Improving Evoked Potential Estimation IEEE Transactions of Biomedical Engineering Vol. 27 No. 4 p. 187-192.
Challis RE, Kitney RI (1990) Biomedical Signal Processing (in four parts) Part 1 Time Domain Methods Medical and Biological Engineering and Computing Vol. 28 p. 509-524.
http://dx.doi.org/10.1007/BF02442601
Choudhry DK, Stayer SA, Rehman MA, Schwartz RE (1998) Electrocardiographic artifact with SSEP monitoring unit during scolios surgery Paediatric Anaesthesia Vol. 8 p. 341-343.
http://dx.doi.org/10.1046/j.1460-9592.1998.00005.x
Clark (1992) The Origin of Biopotentials Medical Instrumentation: Application and Design Ed. Webster JG 2ndEdition Houghton Muffin: Boston
Coifman RR, Wickerhauser MV (1992) Entropy-based Algorithms for best Basis Selection IEEE Transactions on Information Theory Vol. 38 No.2 p. 713-719.
http://dx.doi.org/10.1109/18.119732
Coppla R, Tabor R, Buchsbaum MS (1978) Signal To Noise Ratio Variability Measurements in Single Trial Evoked Potentials Electroencephalography and clinical Neurophysiology Vol. 4 p. 214-222
Darragh GA, Ifeachor EC, Rosen K (1995) Optimal Signal Enhancement of EPs: A Pilot Study Proceedings o f the International Workshop on Medical and Biological Signal Processing p. 47-54.
Daubechies I (1988) Orthonormal Bases of Compact Supported Wavelets Communications on Pure &amp; Applied Mathematics Vol. XLI p. 909-996.
Daubechies I (1990) The Wavelet Transform, Time-frequency Localization and Signal Analysis IEEE Transactions on Information Theory Vol. 36 No. 5 p. 961-1005.
Davilia CE, Mobin MS (1992) Weighted Averaging of Evoked Potentials IEEE Transactions o f Biomedical Engineering Vol. 39 No. 4 p. 338-345.
Davis L (1991) Hybridisation and Numerical Representation Ed. Davis L Handbook ofEvolutionary algorithms p. 61 -71.
Demiralp T, Yordanova J, Kolev V, Ademoglu A, Devrim M, Samar VJ (1999) Time-Frequency Analysis of Single-Sweep Event-Related Potentials by Means o f Fast Wavelet Transforms Brain and Language V ol. 66, p. 129-145.
Dobie RA, Wilson MJ (1990) Optimal ('Wiener') digital filtering of auditory evoked potentials: use of coherence estimates Electroencephalography and Clinical Neurophysiology Vol. 77 p. 205-213.
http://dx.doi.org/10.1016/0168-5597(90)90039-G
Doncarli C, Goering L, Guiheneuc P (1992) Adaptive smoothing of evoked potentials Signal Processing Vol. 28 p. 63-76.
http://dx.doi.org/10.1016/0165-1684(92)90065-5
Donoho DL (1995) De-Noising by Soft Thresholding IEEE Transactions on Information Theory Vol. 41 No. 3 p. 613-627.
http://dx.doi.org/10.1109/18.382009
Donoho DL, Johnstone IM (1994) Ideal spatial Adaptation by Wavelet Shrinkage Biometrika Vol. 81 p. 425
Donoho DL, Johnstone IM, Kerkyacharian G, Picard D (1995) Wavelet Shrinkage: Asymptopia ? Journal o f the Royal Statistical Society B Vol. 57 No. 2 p. 301-369.
Doyle DJ (1975) Some comments on the use of Wiener filtering for estimation of evoked potentials Electroencephalography and Clinical Neurophysiology V ol. 38 p. 533-534.
Eisen A, Roberts F, Low M, Hoirch M, Lawerence P (1984) Questions Regarding the Sequential Neural Generators Theory of the Somatosensory Evoked Potentials Biased by Digital Filtering Electroencephalography and Clinical Neurophysiology Vol. 59 p. 388-395.
http://dx.doi.org/10.1016/0168-5597(84)90040-6
Fung KSM, Chan FHY, Lam K, Poon PWF, Liu JG(1995) Visual Evoked Potential Estimator By Artificial Neural Network Filter: Comparison With The EnsembleAveragingMethod Proceedings of the IEEE Engineering in Medicine and Biology 17thAnnual Conference p. 805-806.
Fung KSM, Chan FHY, Lam K, Liu JG, Poon PWF (1996) Visual Evoked Potential Enhancement by an Artificial Neural Network Filter Bio-Medical Materials and Engineering Vol. 6 p. 1-13.
Furst M, Blau A (1991) Optimal A Posteriori Time Domain Filter for Average Evoked Potentials IEEE Transactions on Biomedical Engineering Vol. 38 No. 9 p. 827-833.
Geva AB, Pratt H, Zeevi YY (1995) Spatio-temporal multiple source localization by wavelet-type decomposition of evoked potentials Electroencephalography and Clinical Neurophysiology Vol96 p. 278-286
http://dx.doi.org/10.1016/0168-5597(94)00294-O
Geva AB, Pratt H, Zeevi YY (1997) Multichannel wavelet-type decomposition of evoked potentials: model-based recognition of generator activity Medical &amp; Biological Engineering &amp; Computing Vol. 35 No. 1 p. 40-45.
http://dx.doi.org/10.1007/BF02510390
Glaser EM and Ruchkin DS (1976) Principles of Neurobiological Signal Analysis Academic Press: New York.
Goldberg DE (1989) Evolutionary algorithms in Search, Optimisation &amp; Machine Learning Addison-Wesley: Reading,Mass.
Green JB, Nelson AV, Michael D (1986) Digital zero-phase-shift filtering of short-latency somatosensory evoked potentials Electroencephalography and Clinical Neurophysiology Vol. 63 p. 384-388.
http://dx.doi.org/10.1016/0013-4694(86)90024-6
Grefenstette JJ (1986) Optimisation of control parameters for genetic algorithms IEEE Transactions on Systems, Man and Cybernetics Vol. 16 No. 1 p. 122-128.
http://dx.doi.org/10.1109/TSMC.1986.289288
Grieve RCW, Parker PA, Hudgins B (1995) Adaptive stimulus Artifact Cancellation in Biological Signals using Neural Networks Proceedings o f the IEEE Engineering in Medicine and Biology 17thAnnual Conference p. 801-802.
Hansson M, Gansler T, Salomonseen G (1996) Estimation of Single Event- Related Potentials Ultizing the Prony Method IEEE Transactions on Biomedical Engineering Vol. 43 No. 10 p. 973-981.
Harrison SAB, Lovely DF (1995) Identification of noise sources in surface recording of spinal somatosensory evoked potentials Medical &amp; Biological Engineering &amp; Computing p. 299-305.
http://dx.doi.org/10.1007/BF02510503
Haupt RL (1995) An introduction to Genetic Algorithms for Electromagnetics IEEE Antennas and Propagation Magazine Vol. 37 No. 2 p. 7-15.
Hayes MH (1996) Statistical Digital Signal Processing and Modelling, John Wiley and Sons, first Edition, p. 335-390.
Heinrich H, Dickhaus H, Rothenberger A, Heinrich V, Moll GH (1999) Single- Sweep Analysis of Event-Related Potentials by Wavelet Networks - Methodological Basis and Clinical Application IEEE Transactions on Biomedical Engineering Vol. 45 No. &amp; p. 867 -879.
Holland JH (1995) Adaptation in Natural and Artificial Systems: An Introduction Analysis with Applications to Biology, Control and Artificial Intelligence MIT Press: Cambridge, Mass.
Isoglu-Alkac U, Baser-Eroglu C, Ademoglu A, Demiralp T, Miener H, Stadler M (1998) analysis of the Electroencephalographic activity during the necker cube reversals by means of the wavelet Transform Biological Cybernetics Vol. 79 p. 437-442.
http://dx.doi.org/10.1007/s004220050492
Journee HL, van der Worp PE, Zeinstra E, Buchtal A, Mooji JJA (1995) Enhancement of the Acquisition Speed of Somatosensory Evoked Potentials By a Response Tuned Wavelet Filter Proceedings of the IEEE Engineering in Medicine and Biology 17thAnnual Conference p. 1065-1066.
Karajalainen PA, Kaipio JP, Koistinen AS, Vauhkonen M (1999) Subspace Regularization Method for the Single-Trial Estimation of Evoked Potentials IEEE Transactions on Biomedical Engineering Vol. 48 No. 7 pp. 849-860.
Khandpur RS (1987) Handbook of Biomedical Instrumentation p.5 Tata McGraw Hill: New Dehli.
Kriss A (1985) Setting up an Evoked Potential (EP) Laboratory Ed. Halliday AM Evoked Potentials in Clinical Testing p. 1-44.
Lange DH, Inbar GF (1996) A Robust Parametric Estimator for Single-Trial Movement Related Brain Potentials IEEE Transactions on Biomedical Engineering Vol. 43 No. 4 p. 341-347.
http://dx.doi.org/10.1109/10.486254
Lange DH, Pratt H, Inbar GF (1997) Modelling and Estimation of Single Evoked Brain Potential Components IEEE Transactions on Biomedical Engineering Vol. 44 No. 9 p. 791-799.
Lankhorst MM, van der Lann MD(1994) Wavelet-based Signal Approximation with Evolutionary algorithms [on-line] ftp://ftp.cs.rug.nl/pub/cs-reports/wavelets.ps.gz Accessed on 24/4/1999
Laskaris N, Bezarianos A, Fotopoulos S, Papathanasopoulos P (1996) A Evolutionary algorithm For the Multidimensional Filtering Process of Visual Evoked Potential Signals Proceedings o f 18th Annual International Conference o f the IEEE Engineering in Medicine and Biology Society p. 1553-1554.
Laskaris N, Fotopoulous S, Papathanasopoulos P, Bezerianos A (1997) Robust moving averages, with Hopfield neural network implementation, for monitoring evoked potential signals, Electroencephalography and Clinical Neurophysiology Vol. 104 p. 151-156.
http://dx.doi.org/10.1016/S0168-5597(97)96681-8

Lewalle J, Peek FW, Murphy SJ (1995) Wavelet Analysis of Olfactory Nerve Responses to Stimulus Journal of Theoretical Biology Vol. 177 No. 3 p. 215- 236.
Lim LM, Akay M, Doubenspeck JA (1995) Identifying Respiratory-Related Evoked Potentials IEEE Engineering in Medicine and Biology Magazine March/April p. 174-178.
http://dx.doi.org/10.1109/51.376756
Maccabee PJ, Pinkhasov El, Cracco RQ (1983) Short latency somatosensory evoked potentials to median nerve stimulation effect of low frequency filter Electroencephalography and Clinical NeurophysiofogyVol 55 p. 34-44.
Maccabee PJ, Hassan NF, Cracco RQ, Schiff JA (1986) Short latency somatosensory evoked potentials: power spectra comparisons between high-pass analog and digital filter Electroencephalography and Clinical NeurophysiologyVol65 p. 177-187.
Maccabee PJ, Hassan NF (1992) AEEM Minimonograph #39: Digital Filtering: Basic Concepts and Applications to Evoked Potentials Muscle &amp; Nerve Vol. 15 p. 865-875.
MacLennan AR and Lovely DF (1995) Reduction of evoked potential measurement time by a TMS320 based adaptive matched filter Med. Eng. Phys. Vol. 17 (4) p. 248-256.
http://dx.doi.org/10.1016/1350-4533(95)90849-7
Makeig S, Jung TP, Bell AJ, Ghahreman D, Sejinowski TJ (1997) Blind Separation of Auditory Event Related Responses into Independent Components Proceedings o f the National Academy o f Science USA Vol. 94 p. 10979-10984.
Mallat SG (1989) A Theory for Multiresolution Signal Decomposition: The wavelet Representation IEEE Transactions on Pattern Analysis and Machine Intelligence Vol. 11 No. 7 p. 674-693.
http://dx.doi.org/10.1109/34.192463
Mallat SG (1998) A Wavelet Tour of Signal Processing Academic Press: San Diego
Mallat SG and Zang Z (1993) Matching pursuit with time-frequency dictionaries IEEE Transactions on Signal Processing Vol. 41 No. 12 p. 3397-3415.
http://dx.doi.org/10.1109/78.258082
McNay D, Michielesen E, Rodgers RL, Taylor SA, Akhatari M, Sutherling WW (1996) Multiple Source Localization using Genetic Algorithms Journal of Neuroscience Methods Vol. 64 pp 163-172.
http://dx.doi.org/10.1016/0165-0270(95)00122-0
Michalewicz Z (1996) Evolutionary algorithms+Data Structures = Evolution Programs 3rd Edition, Springer: Berlin
Misiti M, Misiti Y, Oppenheim G, Poggi JM Wavelet Toolbox For Use with MATLAB TheMathWorksInc.
Morin E, Scott RN, Parker PA (1987) Characterization and Processing of Surface Recorded Spinal Somatosensory Evoked Potentials Electroencephalography and Clinical Neurophysiology Vol. 68 pp.40-44
http://dx.doi.org/10.1016/0168-5597(87)90068-2
Muthuswamy J, Thakor NV (1998) Spectral analysis methods for neurological signals Journal ofNeuroscience Methods Vol. 83 p. 1-14.
Nayak A, Roy RJ (1995) Neural Networks for Predicting Depth of Anesthia From Auditory Evoked Potentials: Comparison of the Wavelet Transform with Autoregressive Modelling and Power Spectrum Proceedings of the IEEE Engineering in Medicine and Biology 17thAnnual Conference p. 797-800.
Nayak A, Roy RJ (1998) Anaesthesia Control Using Midlatency Auditory Evoked Potentials IEEE Transactions on Biomedical Engineering Vol. 45 No. 4 p. 409-421.
http://dx.doi.org/10.1109/10.664197
Nishida S, Nakamura M, Shibasaki H (1993) Method for single-trial Recording of somatosensory evoked potentials Journal of BiomedicalEngineeringVol. 15 p. 255-262.
Norcia AM, Sato T, Shinn P, Mertus J (1986) Methods for identification of evoked response in frequency and combined time/frequency domains Electroencephalography and Clinical Neurophysiology V ol. 65 p. 212-226.
Nuwer MR, Dawson E (1984) Intraoperative evoked potential monitoring of spinal cord: enhanced stability of cortical recordings Electroencephalography and clinical Neurophysiology Vol. 59 p. 318-327
http://dx.doi.org/10.1016/0168-5597(84)90049-2
Olson WH Basic Concepts of Medical Instrumentation Ed. Webster JG Medical Instrumentation Application and Design 2nd Edition p. 10-11, Houghton Mifflin Co: Boston
Paradiso C, De Vito L, Rossi S, Setacci C, Battisini N, Cioni R, Passero S, Giannini F, Rossini PM (1995) Cervical and scalp recorded short latency somatosensory evoked potentials in response to epidural spinal cord stimulation in patients with peripheral vascular disease Electroencephalography and Clinical Neurophysiology V ol. 96 p. 105-113.
Parker PA, Gopalan R (1987) Evoked Potential Signal and System Nonlinearity IEEE Transactions on Biomedical Engineering Vol. 34 No. 10 p. 771-778.
Parsa V, Parker PA (1994) Multireference Adaptive Noise Cancellation Applied to Somatosensory Evoked Potentials IEEE Transactions on Biomedical Engineering Vol. 41 No. 8 p. 792-800.
Parsa V, Parker PA, Scott RN (1998) Adaptive Stimulus Artifact Reduction in Noncortical Somatosensory Evoked Potential Studies IEEE Transactions on Biomedical Engineering Vol. 45 No. 2 p. 161-179.
Quiroga RQ (2000) Obtaining single stimulus evoked potentials with Wavelet Denoising [on-line] http:/Avww.physio.mu-luebeck.de/user/rq/denoisingl.ps.qz accessed on 3/7/2000.
Rossini PM, Cracco RQ, Cracco JB, House WJ (1981) Short latency somatosensory evoked potentials to peroneal nerve stimulation: scalp topography and the effect of different frequency filters Electroencephalography and Clinical Neurophysiology Vol. 52 p. 540-552.
http://dx.doi.org/10.1016/0013-4694(81)91429-2
Rossini PM, Basciani M, DiStefano E, Febbo A, Mercuri N (1985) Short Latency scalp somatosensory evoked potential and central spine to scalp propagation characteristics during peroneal and median nerve stimulation in multiple sclerosis Electroencephalography and clinical Neurophysiology Vol. 60 p. 197-206.
http://dx.doi.org/10.1016/0013-4694(85)90031-8
Saatchi Mr, Gibson C, Rowe JWK, Allen EM (1997) Adaptive Multiresolution Analysis Based Evoked Potential Filtering IEE Proceedings on Science, Measurement and Technology Vol. 144 No. 4 pp. 149-155.
Samar VJ, Swartz KP, Raghuveer (1995) Multiresolution Analysis of Event- Related Potentials by Wavelet Decomposition Brain and Cognition Vol. 27 p. 398-438.
Samar VJ, Begleiter H, Chapa JO, Raghuveer MR, Orlando M, Chorlian D (1996) Matched Meyer Neural Wavelets for Clinical and Experimental Analysis of Auditory and Visual Evoked Potentials Signal Processing: VIII Theories and Applications p. 387-390.
Samar VJ, Bopardikar, Raghuveer R, Swartz K (1999) Wavelet Analysis of Neuroelectric Waveforms: A conceptual Tutorial Brain and Language Vol. 66 p. 7-60.
http://dx.doi.org/10.1006/brln.1998.2023
Schafer RE, Small GW, Arnold A (1996) Evolutionary algorithm-Based Protocol for Coupling Digital Filtering and Partial Least-Squares Regression: Application to the Near-Infrared Analysis of Glucose in Biological Matrices Analytical Chemistry Vol. 68 p. 2663-2675.
Strang G and Nguyen T (1997) Wavelets and Filter Banks Wellesley-Cambridge Press Revised Edition.: Wellesley, MA
Thakor NV (1987) Adaptive filtering of Evoked Potentials IEEE Transactions ofBiomedical Engineering Vol. 32 NO. 1 p. 7-12.
Thakor NV, Guo X, Vaz RA, Laguna P, Jane R, Caminal P, Rix H, Hanley DF (1993a) Orthonormal (Fourier and Walsh) Models of Time-varying Evoked Potentials in Neurological Injury IEEE Transactions o f Biomedical Engineering Vol. 40 No. 3 p. 213-221.
Thakor NV, Xin-rong G, Yi-Chun S, Hanley DF (1993b) Multiresolution Wavelet Analysis of Evoked Potentials IEEE Transactions of Biomedical EngineeringNoX.^ONo.W p. 1085-1094.
Tian J, Juhola M, Gronfors T (1997) Latency Estimation of Auditory Brainstem Response By Neural Networks Artificial Intelligence in Medicine Vol. 10 p. 115-128.
Walter DO (1969) A Posteriori Wiener Filtering of Averaged Evoked Responses Electroencephalography and Clinical Neurophysiology suppl 27 p. 61-70.
Wastell DG (1979) The application of low-pass filtering to evoked potential data: Filtering without phase distortion Electroencephalography and Clinical
Neurophysiology Vol. 46 p. 355-356.
Wasted DG (1981) When wiener filtering is less than optimal: An illustrative application to the brain stem evoked potential Electroencephalography and Clinical Neurophysiology Vol. 51 p. 678-682.
http://dx.doi.org/10.1016/0013-4694(81)90214-5
de Weerd JPC, Kap JI (1981a) A Posteriori Time-varying Filtering of Averaged Evoked Potentials 1 Introduction and Conceptual Basis Biological Cybernetics Vol. 41 p. 211-222.
de Weerd JPC, Kap JI (1981b) A Posteriori Time-varying Filtering of Averaged Evoked Potentials I Mathematical and Computational Aspects Biological Cybernetics Vol. 41 p. 223-234.
de Weerd JPC, Kap JI (1981c) Spectro-temporal representation and time- varying spectra of evoked potentials Biological Cybernetics Vol. 41 p. 101-117
http://dx.doi.org/10.1007/BF00335365
Wiener N (1949) Extrapolation, Interpolation and Smoothing of Stationary Time Series with Engineering Applications cited by Proakis JG and Manolakis DG (1996) Digital Signal Processing Principles, Algorithms and Applications Prentice-Hall.New Jersey 3rdEdition pp. 715.
Yu KB, McGillem CD (1983) Optimum filter for estimating evoked potential waveforms IEEE Transactions on Biomedical Engineering Vol. 30 No. 11 p. 730-373.
http://dx.doi.org/10.1109/TBME.1983.325187
Yu XH, Zhang YS, He ZY (1994) Peak component latency-corrected average method for evoked potential waveform estimation IEEE Transactions on Biomedical Engineering Vol. 41 No. 11 p. 1072-1082.
http://dx.doi.org/10.1109/10.335845
Zhang Q and Benveniste A (1992) Wavelet Networks IEEE Transactions on Neural Networks Vol. 2 p. 889-898
http://dx.doi.org/10.1109/72.165591


All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Sunday, 16 July 2017

Cozmo, Ohbot go to Code Club

I have recently taken two robots to a Code Club, here are a couple of reflections/observations.


Cozmo
This robot produced by Anki is incredibly cute - a cross between Wall-E and a pet in some respects.

The code below was produced by the 'Code-Clubbers' and gets Cozmo to speak move around and operate its forks at the front. Anecdotally, someone was trying to work on something but couldn't resist coming and having another look at what it was doing.







Ohbot






Ohbot provided a different opportunity to play with a robot, getting to move the mouth, speak and track faces. My first impression was some of the children were a bit wary, until they found out they could control what it says and that seemed to break the ice.





All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

Who wants to produce AI produced cartoon strips

Question: How easy is it produce a comic/cartoon using genetative AI? Let's start with  using ChatGPT4o to produce cartoons. The idea wa...