Flickering Stimulus for SSVEP-Experiment

792 views
Skip to first unread message

Markus

unread,
Oct 9, 2012, 11:33:25 AM10/9/12
to psychop...@googlegroups.com
Hi,

as stimulus I use squares of pixels. The pixels can be in one of two colors and thier position is rendomized on each trial (see Code). In PsychoPy I present this Square with visual.PatchStim. For a Study with steady-state visual evoked potentials (SSVEPs) I want to present all pixels of one color at a different rate (e.g. 12.5 Hz vs. 10 Hz).

I have no idea how and where I can enter this Information in psychopy. Ist there a possibility to write a "simple" modification for visual.PatchStim in the Builder or in the Coder. Or do I have to program a new modified version of visual.PatchStim?

Could it be necessary to handle all pixels of one color as different stimuli (forming a square), so that each stimuli can be presented at a certain Hz?

THANKS!

Markus


Code for Square:

def generate_px_image(sizex=128, anteil_l = 0.5, anteil_r = 0.5):

    size = sizex **2

    # n_white_px = round(size * anteil)

    n_black_l = round(size/2.0 * anteil_l)

    n_black_r = round(size/2.0 * anteil_r)



    n_l = np.ones(size/2) * -1

    n_r = np.ones(size/2) * -1

    n_l[0:n_black_l] = 1

    n_r[0:n_black_r] = 1

    n_l = np.random.permutation(n_l).reshape(sizex,sizex/2)

    n_r = np.random.permutation(n_r).reshape(sizex,sizex/2)

    return np.append(n_l,n_r,1)

dani

unread,
Oct 10, 2012, 2:43:16 AM10/10/12
to psychop...@googlegroups.com

Jonathan Peirce

unread,
Oct 10, 2012, 5:45:04 AM10/10/12
to psychop...@googlegroups.com
Markus,

Just to be clear, in case it wasn't obvious from Dani's demo,
presentation rates are not something that PsychoPy handles for you; on
every frame of your monitor you simply have to decide what to draw to
the screen. To have stimulus flicker at 10 Hz (on a 60Hz monitor) you
would draw your stimulus for three frames and then not draw it for 3
frames (the period of the stimulus is 60/10=6 frames and you want half
of that period 'on' and half 'off').

You need to keep this in mind when choosing what rates you're aiming for
as well. On a 60Hz monitor you can't achieve 12.5 Hz because that would
require a period of 4.8 frames; you'd need to have 2.4 frames on and 2.4
frames off, which obviously isn't possible. On a 100Hz monitor this rate
is fine because 100/12.5=8 so you can have 4 frames on, 4 frames off.
(Then again 30Hz is possible on a 60Hz monitor but not a 100Hz monitor!)

These aren't things that PsychoPy, or any other software, can get around.

all the best,
Jon
> --
> You received this message because you are subscribed to the Google
> Groups "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to
> psychopy-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/psychopy-users/-/Pm0TtvqcdfwJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk


This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.
Reply all
Reply to author
Forward
0 new messages