Lissajous figures using Phoenix (and ONE line of Python)

Published on: 2005-11-11

Home | Archive

Lissajou's figures using Phoenix (and ONE line of Python)


The Phoenix box now comes with a sample/hold implemented using CD4066 switch - the number of analog input channels has been reduced to 4. It is now possible to sample simultaneously from all the channels - the idea is simple; take a snapshot of the voltage on each channel in parallel and store them on capacitors - then digitize each one individually. It's now possible to do very interesting things like plot Lissajous curves. Here are two plots I obtained - one when two equal sine's were combined: and another when two phase shifted sines were combined: A single statement: a = p.multi_read_block(NPOINTS, nchan = 2, delay = 0, bip = 1) gets you data from two channels in the form of a list: [(timestamp, adval1, adval2), (timestamp, adval1, adval2) ....] Another statement: cords = map(lambda x: CENTRE_X + x[1]*xscale, CENTRE_Y - x[2]*yscale, a) extracts adval1 and adval2 from each sublist, does proper scaling and generates the ist of coordinates to be plotted! Another line (a Tkinter statement) does the plotting! So it's 3 lines, not ONE!