# random noise frametiming

**URL:** <https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006>\
**Category:** Uncategorized\
**Created:** [September 22, 2008, 3:29pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006 "2008-09-22T15:29:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tudorcb](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tudorcb](https://psychtoolbox.discourse.group/u/tudorcb)\
**Post date:** [September 22, 2008, 3:29pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006/1 "2008-09-22T15:29:35Z")

</div>

Hi Mario (or anyone that has tried this),  
  
i am trying to deliver a random noise to a retina in a multielectrode  
array set up. It appears that going at the refresh rate of the screen  
(75 HZ in my case), may be too fast for the RGCs to "get it" and  
respond. Therefore i want to prolong the presentation of each frame.   
Is Waitsecs (delay), before flip the way to go ?  
  
  
Thanks for your help, you guys have enabled a molecular biologist to  
do physiology.  
  
Tudor

---

<div class="post-metadata">

**Author:** ![anblick](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anblick](https://psychtoolbox.discourse.group/u/anblick)\
**Post date:** [September 22, 2008, 7:16pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006/2 "2008-09-22T19:16:13Z")

</div>

Hi Tudor,  
  
The third (optional) argument to the flip function is "when", see the   
help file for the function by doing Screen('Flip?')  
  
If you're using a CRT, the RCGs will still be entrained to 75 Hz,   
because that flicker frequency is still present even if multiple   
sequential frames are identical.  
  
keith  
  

> On Sep 22, 2008, at 11:29 AM, tudorcb wrote:  
>    
> \> Hi Mario (or anyone that has tried this),  
> \>  
> \> i am trying to deliver a random noise to a retina in a multielectrode  
> \> array set up. It appears that going at the refresh rate of the screen  
> \> (75 HZ in my case), may be too fast for the RGCs to "get it" and  
> \> respond. Therefore i want to prolong the presentation of each frame.  
> \> Is Waitsecs (delay), before flip the way to go ?  
> \>  
> \>  
> \> Thanks for your help, you guys have enabled a molecular biologist to  
> \> do physiology.  
> \>  
> \> Tudor

---

<div class="post-metadata">

**Author:** ![tudorcb](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tudorcb](https://psychtoolbox.discourse.group/u/tudorcb)\
**Post date:** [September 22, 2008, 8:37pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006/3 "2008-09-22T20:37:59Z")

</div>

Hi Keith,  
  
 if i get this right, then, perhaps it is easier to tell the program  
to repeat flip the needed amount of times.  
Say my frame rate is 75 Hz, which amounts to roughly 13 msec/frame.   
If i ask for a fixed time, like 60 msec, it will come up with the  
closest estimate which is either 4 or 5 screen redraws, and it may  
completely screw up the overall timing. Might as well settle for 65  
msec presentations and tell it to redraw the screen 5 times or 52 msec  
for 4 redraws.  
  
Thanks for pointing that out to me.  
  
Tudor  
  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Keith Schneider \<ks@...\> wrote:  
> \>  
> \> Hi Tudor,  
> \>   
> \> The third (optional) argument to the flip function is "when", see the   
> \> help file for the function by doing Screen('Flip?')  
> \>   
> \> If you're using a CRT, the RCGs will still be entrained to 75 Hz,   
> \> because that flicker frequency is still present even if multiple   
> \> sequential frames are identical.  
> \>   
> \> keith  
> \>   
> \> On Sep 22, 2008, at 11:29 AM, tudorcb wrote:  
> \>   
> \> \> Hi Mario (or anyone that has tried this),  
> \> \>  
> \> \> i am trying to deliver a random noise to a retina in a multielectrode  
> \> \> array set up. It appears that going at the refresh rate of the screen  
> \> \> (75 HZ in my case), may be too fast for the RGCs to "get it" and  
> \> \> respond. Therefore i want to prolong the presentation of each frame.  
> \> \> Is Waitsecs (delay), before flip the way to go ?  
> \> \>  
> \> \>  
> \> \> Thanks for your help, you guys have enabled a molecular biologist to  
> \> \> do physiology.  
> \> \>  
> \> \> Tudor  
> \>

---

<div class="post-metadata">

**Author:** ![anblick](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anblick](https://psychtoolbox.discourse.group/u/anblick)\
**Post date:** [September 22, 2008, 9:02pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006/4 "2008-09-22T21:02:09Z")

</div>

That's right, you have to determine which is more important, either   
having the exact same number of screen refreshes, or keeping the   
overall timing precise. For example, if you want a stimulus that   
alternates every 60 ms, is it more important that every alternation   
period includes 4 screen refreshes, or do you want to keep the time as   
close as possible to 60 ms, in which case subsequent periods might   
include either 4 or 5 refreshes? If you include the "when" argument,   
the screen will flip on the next refresh that is later than the time   
you specify. Keep in mind that the refresh rate isn't \*precisely\* 75   
Hz, it's just some number close to that, which the PTB can estimate   
accurately.  
  
By the way, you can only give the flip function a timing arguments,   
not an integer number of frames. That is, you can't tell it to wait 4   
frames, you would have to (knowing your exact refresh rate) calculate   
the time this would take.  
  
keith  
  

> On Sep 22, 2008, at 4:37 PM, tudorcb wrote:  
>    
> \> Hi Keith,  
> \>  
> \> if i get this right, then, perhaps it is easier to tell the program  
> \> to repeat flip the needed amount of times.  
> \> Say my frame rate is 75 Hz, which amounts to roughly 13 msec/frame.  
> \> If i ask for a fixed time, like 60 msec, it will come up with the  
> \> closest estimate which is either 4 or 5 screen redraws, and it may  
> \> completely screw up the overall timing. Might as well settle for 65  
> \> msec presentations and tell it to redraw the screen 5 times or 52 msec  
> \> for 4 redraws.  
> \>  
> \> Thanks for pointing that out to me.  
> \>  
> \> Tudor  
> \>  
> \>  
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Keith Schneider \<ks@...\> wrote:  
> \>\>  
> \>\> Hi Tudor,  
> \>\>  
> \>\> The third (optional) argument to the flip function is "when", see the  
> \>\> help file for the function by doing Screen('Flip?')  
> \>\>  
> \>\> If you're using a CRT, the RCGs will still be entrained to 75 Hz,  
> \>\> because that flicker frequency is still present even if multiple  
> \>\> sequential frames are identical.  
> \>\>  
> \>\> keith  
> \>\>  
> \>\> On Sep 22, 2008, at 11:29 AM, tudorcb wrote:  
> \>\>  
> \>\>\> Hi Mario (or anyone that has tried this),  
> \>\>\>  
> \>\>\> i am trying to deliver a random noise to a retina in a   
> \>\>\> multielectrode  
> \>\>\> array set up. It appears that going at the refresh rate of the   
> \>\>\> screen  
> \>\>\> (75 HZ in my case), may be too fast for the RGCs to "get it" and  
> \>\>\> respond. Therefore i want to prolong the presentation of each   
> \>\>\> frame.  
> \>\>\> Is Waitsecs (delay), before flip the way to go ?  
> \>\>\>  
> \>\>\>  
> \>\>\> Thanks for your help, you guys have enabled a molecular biologist to  
> \>\>\> do physiology.  
> \>\>\>  
> \>\>\> Tudor  
> \>\>  
> \>  
> \>  
> \>  
> \> ------------------------------------  
> \>  
> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> Please indicate OS9, OSX, or WIN version, and include your full name.  
> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \> Yahoo! Groups Links  
> \>  
> \>  
> \>  
> \>

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [September 22, 2008, 10:04pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006/5 "2008-09-22T22:04:36Z")

</div>

DriftWaitDemo and VBLSyncTest show nicely how  
to achieve this "flip every n frames".  
  
The PTB overview PDF in Psychtoolbox/PsychDocumentation  
subfolder contains useful info and examples as well.  
  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Keith Schneider \<ks@...\> wrote:  
> \>  
> \> That's right, you have to determine which is more important, either   
> \> having the exact same number of screen refreshes, or keeping the   
> \> overall timing precise. For example, if you want a stimulus that   
> \> alternates every 60 ms, is it more important that every alternation   
> \> period includes 4 screen refreshes, or do you want to keep the time as   
> \> close as possible to 60 ms, in which case subsequent periods might   
> \> include either 4 or 5 refreshes? If you include the "when" argument,   
> \> the screen will flip on the next refresh that is later than the time   
> \> you specify. Keep in mind that the refresh rate isn't \*precisely\* 75   
> \> Hz, it's just some number close to that, which the PTB can estimate   
> \> accurately.  
> \>   
> \> By the way, you can only give the flip function a timing arguments,   
> \> not an integer number of frames. That is, you can't tell it to wait 4   
> \> frames, you would have to (knowing your exact refresh rate) calculate   
> \> the time this would take.  
> \>   
> \> keith  
> \>   
> \> On Sep 22, 2008, at 4:37 PM, tudorcb wrote:  
> \>   
> \> \> Hi Keith,  
> \> \>  
> \> \> if i get this right, then, perhaps it is easier to tell the program  
> \> \> to repeat flip the needed amount of times.  
> \> \> Say my frame rate is 75 Hz, which amounts to roughly 13 msec/frame.  
> \> \> If i ask for a fixed time, like 60 msec, it will come up with the  
> \> \> closest estimate which is either 4 or 5 screen redraws, and it may  
> \> \> completely screw up the overall timing. Might as well settle for 65  
> \> \> msec presentations and tell it to redraw the screen 5 times or 52 msec  
> \> \> for 4 redraws.  
> \> \>  
> \> \> Thanks for pointing that out to me.  
> \> \>  
> \> \> Tudor  
> \> \>  
> \> \>  
> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Keith Schneider \<ks@\> wrote:  
> \> \>\>  
> \> \>\> Hi Tudor,  
> \> \>\>  
> \> \>\> The third (optional) argument to the flip function is "when", see the  
> \> \>\> help file for the function by doing Screen('Flip?')  
> \> \>\>  
> \> \>\> If you're using a CRT, the RCGs will still be entrained to 75 Hz,  
> \> \>\> because that flicker frequency is still present even if multiple  
> \> \>\> sequential frames are identical.  
> \> \>\>  
> \> \>\> keith  
> \> \>\>  
> \> \>\> On Sep 22, 2008, at 11:29 AM, tudorcb wrote:  
> \> \>\>  
> \> \>\>\> Hi Mario (or anyone that has tried this),  
> \> \>\>\>  
> \> \>\>\> i am trying to deliver a random noise to a retina in a   
> \> \>\>\> multielectrode  
> \> \>\>\> array set up. It appears that going at the refresh rate of the   
> \> \>\>\> screen  
> \> \>\>\> (75 HZ in my case), may be too fast for the RGCs to "get it" and  
> \> \>\>\> respond. Therefore i want to prolong the presentation of each   
> \> \>\>\> frame.  
> \> \>\>\> Is Waitsecs (delay), before flip the way to go ?  
> \> \>\>\>  
> \> \>\>\>  
> \> \>\>\> Thanks for your help, you guys have enabled a molecular biologist to  
> \> \>\>\> do physiology.  
> \> \>\>\>  
> \> \>\>\> Tudor  
> \> \>\>  
> \> \>  
> \> \>  
> \> \>  
> \> \> ------------------------------------  
> \> \>  
> \> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> \> Please indicate OS9, OSX, or WIN version, and include your full name.  
> \> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \> \> Yahoo! Groups Links  
> \> \>  
> \> \>  
> \> \>  
> \> \>  
> \>

---

<div class="post-metadata">

**Author:** ![tudorcb](https://avatars.discourse-cdn.com/v4/letter/t/91b2a8/32.png) [@tudorcb](https://psychtoolbox.discourse.group/u/tudorcb)\
**Post date:** [September 22, 2008, 10:59pm UTC](https://psychtoolbox.discourse.group/t/random-noise-frametiming/2006/6 "2008-09-22T22:59:23Z")

</div>

Thanks Keith and Mario,  
  
i have read through the DriftWaitDemo and it does seem the best you  
can get this to work if you have a given precise timing in mind.   
  
In my case though, the delay is somewhat arbitrary (or my knowledge of  
it, anyways) so i think i will just loop the presentation x times to  
get something closer to my timing. As i am trying to reverse  
correlate spikes from the random noise, and, obviously have to run  
many iterations, even after the calibration, the error may be  
important enough so that, after say 80,000 frames the timing will be  
off. I have enough trouble with delays induced by filters and  
recording software. So yeah, i will go with 4 screen refreshes.  
Anyway, each trouble i run into is a learning experience.  
Thanks a lot for the pointers and the explanations.  
  
tudor  
  
  
  
--- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "Mario Kleiner"  
\<mario.kleiner@...\> wrote:  

> \>  
> \> DriftWaitDemo and VBLSyncTest show nicely how  
> \> to achieve this "flip every n frames".  
> \>   
> \> The PTB overview PDF in Psychtoolbox/PsychDocumentation  
> \> subfolder contains useful info and examples as well.  
> \>   
> \> -mario  
> \>   
> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Keith Schneider \<ks@\> wrote:  
> \> \>  
> \> \> That's right, you have to determine which is more important, either   
> \> \> having the exact same number of screen refreshes, or keeping the   
> \> \> overall timing precise. For example, if you want a stimulus that   
> \> \> alternates every 60 ms, is it more important that every alternation   
> \> \> period includes 4 screen refreshes, or do you want to keep the

time as   

> \> \> close as possible to 60 ms, in which case subsequent periods might   
> \> \> include either 4 or 5 refreshes? If you include the "when"

argument,   

> \> \> the screen will flip on the next refresh that is later than the time   
> \> \> you specify. Keep in mind that the refresh rate isn't \*precisely\*

75   

> \> \> Hz, it's just some number close to that, which the PTB can estimate   
> \> \> accurately.  
> \> \>   
> \> \> By the way, you can only give the flip function a timing arguments,   
> \> \> not an integer number of frames. That is, you can't tell it to

wait 4   

> \> \> frames, you would have to (knowing your exact refresh rate)

calculate   

> \> \> the time this would take.  
> \> \>   
> \> \> keith  
> \> \>   
> \> \> On Sep 22, 2008, at 4:37 PM, tudorcb wrote:  
> \> \>   
> \> \> \> Hi Keith,  
> \> \> \>  
> \> \> \> if i get this right, then, perhaps it is easier to tell the program  
> \> \> \> to repeat flip the needed amount of times.  
> \> \> \> Say my frame rate is 75 Hz, which amounts to roughly 13 msec/frame.  
> \> \> \> If i ask for a fixed time, like 60 msec, it will come up with the  
> \> \> \> closest estimate which is either 4 or 5 screen redraws, and it may  
> \> \> \> completely screw up the overall timing. Might as well settle for 65  
> \> \> \> msec presentations and tell it to redraw the screen 5 times or

52 msec  

> \> \> \> for 4 redraws.  
> \> \> \>  
> \> \> \> Thanks for pointing that out to me.  
> \> \> \>  
> \> \> \> Tudor  
> \> \> \>  
> \> \> \>  
> \> \> \> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), Keith Schneider \<ks@\> wrote:  
> \> \> \>\>  
> \> \> \>\> Hi Tudor,  
> \> \> \>\>  
> \> \> \>\> The third (optional) argument to the flip function is "when",

see the  

> \> \> \>\> help file for the function by doing Screen('Flip?')  
> \> \> \>\>  
> \> \> \>\> If you're using a CRT, the RCGs will still be entrained to 75 Hz,  
> \> \> \>\> because that flicker frequency is still present even if multiple  
> \> \> \>\> sequential frames are identical.  
> \> \> \>\>  
> \> \> \>\> keith  
> \> \> \>\>  
> \> \> \>\> On Sep 22, 2008, at 11:29 AM, tudorcb wrote:  
> \> \> \>\>  
> \> \> \>\>\> Hi Mario (or anyone that has tried this),  
> \> \> \>\>\>  
> \> \> \>\>\> i am trying to deliver a random noise to a retina in a   
> \> \> \>\>\> multielectrode  
> \> \> \>\>\> array set up. It appears that going at the refresh rate of the   
> \> \> \>\>\> screen  
> \> \> \>\>\> (75 HZ in my case), may be too fast for the RGCs to "get it" and  
> \> \> \>\>\> respond. Therefore i want to prolong the presentation of each   
> \> \> \>\>\> frame.  
> \> \> \>\>\> Is Waitsecs (delay), before flip the way to go ?  
> \> \> \>\>\>  
> \> \> \>\>\>  
> \> \> \>\>\> Thanks for your help, you guys have enabled a molecular

biologist to  

> \> \> \>\>\> do physiology.  
> \> \> \>\>\>  
> \> \> \>\>\> Tudor  
> \> \> \>\>  
> \> \> \>  
> \> \> \>  
> \> \> \>  
> \> \> \> ------------------------------------  
> \> \> \>  
> \> \> \> Post your message to: [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com)  
> \> \> \> Please indicate OS9, OSX, or WIN version, and include your full

name.  

> \> \> \> Denis Pelli, David Brainard, and Allen Ingling.  
> \> \> \> [http://psychtoolbox.org](http://psychtoolbox.org)  
> \> \> \> Yahoo! Groups Links  
> \> \> \>  
> \> \> \>  
> \> \> \>  
> \> \> \>  
> \> \>  
> \>
