Skip to content

Commit

Permalink
Modified documentations
Browse files Browse the repository at this point in the history
  • Loading branch information
kurokida committed Feb 18, 2021
1 parent 545a1a3 commit 8f995e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/gabor.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

You can present gabor patches using the jspsych-psychophysics plugin.

The calculation method is based on [the Psychtoolbox](http://psychtoolbox.org/), although my plugin doesn't use procedural texture mapping. I also have referenced [the gaborgen-js code](https://github.com/jtth/gaborgen-js).
The calculation method for drawing is almost the same as the one used by [the Psychtoolbox](http://psychtoolbox.org/), although my plugin doesn't use the procedural texture mapping and WebGL. I also have referenced [the gaborgen-js code](https://github.com/jtth/gaborgen-js).

You can choose either [the numeric.js](https://github.com/sloisel/numeric) or [the math.js](https://mathjs.org/) for the method for drawing gabor patches. The numeric.js is considerably faster than the math.js, but the latter is being developed more aggressively than the former.
You can choose either [the numeric.js](https://github.com/sloisel/numeric) or [the math.js](https://mathjs.org/) for the calculation library. The numeric.js is considerably faster than the math.js, but the latter is being developed more aggressively than the former. The default is the numeric.js.

There is still the issue of display calibration. Unfortunately, my plugin does not provide a solution to this problem.

See the Gabor section of [the page on object properties](https://jspsychophysics.hes.kyushu-u.ac.jp/objectProperties.html).
See the Gabor section of [the page on object properties](https://jspsychophysics.hes.kyushu-u.ac.jp/objectProperties.html) to learn how to draw the gabor patches.

# The drifting gabor patch

You are capable of making a gabor patch drift. The Gabor patch drifts more smoothly when it is presented using the numeric.js more than using the math.js. However, its speed is not accurate when using either library.

The psychophysics plugin records the averaged time of a frame in terms of milliseconds (avg_frame_time). When using a display with a refresh rate of 60 Hz, theoretically this would be 16.7 ms. However, in my PC, the avg_frame_time was about 27 ms when the drifting patch was drawn using the numeric.js, and was about 440 ms using the math.js
By checking the averaged time of a frame, you can see how accurately the stimulus has been presented. The psychophysics plugin records the time (avg_frame_time). When using a display with a refresh rate of 60 Hz, theoretically this would be 16.7 ms. However, in my PC, the avg_frame_time was about 27 ms when the drifting patch was drawn using the numeric.js, and was about 440 ms using the math.js.

The avg_frame_time is the value of an elapsed time divided by the number of times the requestAnimationFrame was called. The elapsed time is the time when the requestAnimationFrame was last called minus the time when the requestAnimationFrame was first called.

Expand Down
12 changes: 6 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ This plugin can be used free of charge under the MIT license.

I would appreciate it if you could cite [Kuroki (2020)](https://rdcu.be/b5Nie) as well as [de Leeuw (2015)](https://link.springer.com/article/10.3758/s13428-014-0458-y) when you report your research using this plugin.

If you have any questions, please post them on [the issuues of the GitHub](https://github.com/kurokida/jspsych-psychophysics/issues)
If you have any questions, please post them on [the issuues of the GitHub](https://github.com/kurokida/jspsych-psychophysics/issues).

## What you can do with the jspsych-psychophysics plugin
- You can present multiple stimuli asynchronously, that is, you can set stimulus onset asynchronies (SOAs) in a trial.
- You can present visual stimuli (e.g., [gabor](gabor.md), image, line, rectangle, circle, and text) at intended coordinates in terms of milliseconds and frames. You can also present moving objects and play sound files.
- You can present visual stimuli (e.g., [gabor patches](gabor.md), images, lines, rectangles, circles, and texts) at intended coordinates, and the time duration can be specified in terms of milliseconds and frames. You can also present moving objects and play sound files.
- This plugin presents visual stimuli synchronized with the refresh of the display using the **requestAnimationFrame** method. According to my observation, the SOA between visual stimuli with the plugin was more accurate than that without the plugin ([Kuroki, 2020](https://rdcu.be/b5Nie)).
- You can specify the mouse/keyboard event handler. For example, you can make a program in which a participant change the luminance of a stimulus pressing the ArrowUp/ArrowDown key, and finish the trial pressing the space key. See [the FAQ 7](faq.md).
- Participants' responses can be captured using the keyboard, mouse or buttons. The position of the mouse click can also be recorded as a response.
- Participants' responses can be captured using the keyboard, mouse or buttons. The position of the mouse click can be recorded as a response.

## How to use the jspsych-psychophysics plugin
This is the brief explanation how to use the plugin. Please refer to [the parameters of the plugin](pluginParams.md) and [the properties of objects](objectProperties.md) in detail.
This is a brief explanation how to use the plugin. Please refer to [the parameters of the plugin](pluginParams.md) and [the properties of objects](objectProperties.md) in detail.

This figure illustrates a trial flow to be made by this tutorial.
![tutorial](./images/tutorial.png)

You can see [the sample of this tutorial.](https://www.hes.kyushu-u.ac.jp/~kurokid/jspsychophysics/demos/tutorial.html)

### 1. Download the plugin package.
[Please download the latest files from GitHub.](https://github.com/kurokida/jspsych-psychophysics/releases)
The package includes the comaptible [jsPsych](http://www.jspsych.org/) (de Leeuw, 2015), and released under [the MIT license](https://opensource.org/licenses/MIT).
[Please download the latest plugin files from GitHub.](https://github.com/kurokida/jspsych-psychophysics/releases)
The package includes the comaptible [jsPsych](http://www.jspsych.org/) (de Leeuw, 2015). The psychophysics plugin is released under [the MIT license](https://opensource.org/licenses/MIT).


### 2. Include the plugin file using the `<script>` tag
Expand Down

0 comments on commit 8f995e8

Please sign in to comment.