TENTATIVE SYLLABUS

 

PSYC 892

Computer Programming for Experimental Psychology

Spring 2008

 

Time: 1:30 - 4pm Tuesday

 

Classroom: Arch lab conference room 2073, David King Hall

 

Instructor:       Dr. Matt Peterson

 

Office:     2058 David King Hall

                 Ph: 993-4255

                 email:            (please put PSYC 892 in the subject header)

 

Office Hours:    11-11:50 Wednesdays (tentative) or by appointment.

I fully encourage you to contact me by email if you have any questions about the class.

 

Text: None.  However, if you are new to C/C++, I strongly suggest you pick up an introductory C book.  Although C++ is a superset of C (i.e. it just adds more programming options), the C++ books I've looked at tend to use a different programming philosophy compared to the books on C. Classic C program designs are more suited to programming experiments, and this programming philosophy is the one I will be using in class.

 

Some books I recommend:

Beginning C, Third Edition - Ivor Horton - Apress - ISBN: 1590592530

 

Absolute Beginners Guide To C, Second Edition --  Greg Perry, Howard W Sams & Co. - ISBN: 0672305100

 

C All-in-One Desk Reference for Dummies - Dan Gookin, Wiley(?) - ISBN: 0-7645-7069

 

Fantastic site on C:

                    http://www.eskimo.com/~scs/cclass/notes/

 

Useful sites (more useful later in the course):

                     http://www-ccs.ucsd.edu/c/

                     http://www.acm.uiuc.edu/webmonkeys/book/c_guide/

                     http://www.codepedia.com/1/BeginnersGuideToC           

 

Numerical Recipes in C:

                     http://www.nr.com/

 

Compiler: We will be using Metrowerks' Codewarrior, as it is available on just about every platform under the sun (Mac, Windows, Linux), and has a very friendly user interface.  For those who wish to develop OSX programs for Intel Macs, then you should be using XCode. The code that we are developing in class should work on other compilers (gcc, Xcode, VisualStudio) if you choose to use something else.

 

 

Prerequisites: graduate tudent

 

Objectives: In this course you will be learning to program psychology experiments.  This course will not teach you how to prototype user interfaces, and I will not be discussing how to use GUI widgets.

 

Why C/C++?  Syntactically, many languages resemble C (e.g. Java, Python, Matlab), so learning C can help you to learn those languages.  Secondly, unlike Java, C is extremely fast and deterministic. This is especially important for psychophysical experiments that rely on precise timing, eye movement contingent experiments that make changes to a scene while the eyes are in flight, and ERP experiments, where extra jitter could make the data uninterpretable.

 

What we will be learning:

 

C/C++ language This is the language we will be using for controlling the flow of the program.  The style of programming I will be teaching is old-school procedural C, but we will be covering object-oriented programming.  Note: C/C++ has no way of drawing graphics, getting mouse movements, etc.

 

Psych APIs This is a cross-platform library written by me in C++ (Windows and Mac).  The functions and objects in this library are used for drawing, reading the mouse, getting keyboard inputs, using a voice key (Mac), etc.

 

Programming strategies: Knowing the language and the Psych APIs isn't enough: you also need to know how to program experiments.  That is, designing a program involves a great deal of problem solving in order to come up with the best strategies.

 

Types of programs covered (tentative)

 

 

Attendance Policy: Since much of this class will involve discussion, I expect (barring unforeseen circumstances, conferences, etc.) to see you in class each week.  Skip class at your own peril.

 

GMU Honor Code: George Mason University has a code of Honor that each of you accepts by enrolling as a student. My expectation is that all of the work you do for me in this class will be the work of one individual. Having said that, I fully encourage you to discuss the readings and topics raised in this class with your fellow students.  Don't even think about cheating.

 

Grading:   10% class participation, 40% Homework, 50% final project

 

 

 

Calendar (TBA):

 

Note the calendar will be fluid, as the class will be adapted to the overall experience level.

Last updated 1/8/08


Date
Topics
Examples
Homework
22-Jan Codewarrior
Variables
Functions
Compiling
HelloWorld

Modified HelloWorld
BuggyCode.cpp

29-Jan local and global variables
arrays
extern
pointers
for()
if() else
Files
fprintf
none (1) Filling an array
(2) Generate trials and save to file
5-Feb headers
do{}while;
Timers
More on pointers
scanf()
making random arrays
Experiment Design
Program Design and Flow
Spatial Stroop (text output) Eriksen Flanker (text output)
12-Feb Graphics
GetAKey()
Objects
Tcards
Timer Objects
syncing with retrace
Graphical Color Stroop Graphical Eriksen Flanker
Final Project Ideas
19-Feb fscanf
strings and string functions
block randomization
Arrays of Tcards and simple animation
Lexical Decision RSVP
26-Feb more lexical decision   RSVP
4-Mar timing PRP Interuptions
11-Mar
SPRING BREAK
18-Mar

complex randomization
multidimensional arrays
randomizing hands

visual search - 1 set size, target present Visual search - multiple set sizes, target absent or present
25-Mar images
ABAB designs
change detection search using images, blocks counter balanced
1-Apr - motion
- Making your own objects (sprites)
- Dynamic Arrays
FINST Air Traffic Control task
8-Apr - Projects
- Complex Timing and syncing multiple machines
- fast fMRI
15-Apr -Projects
- Gaze contingent eye tracking
22-Apr - Projects Final Project Demonstrations Final Project Demonstrations
29-Apr Final Project Demonstrations Final Project Demonstrations Final Project Demonstrations