# Re: Pelli-Zhang Video Attenuator & Attenuator.mex

**URL:** <https://psychtoolbox.discourse.group/t/re-pelli-zhang-video-attenuator-attenuator-mex/1161>\
**Category:** Uncategorized\
**Created:** [April 17, 2002, 6:44pm UTC](https://psychtoolbox.discourse.group/t/re-pelli-zhang-video-attenuator-attenuator-mex/1161 "2002-04-17T18:44:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denispelli](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@denispelli](https://psychtoolbox.discourse.group/u/denispelli)\
**Post date:** [April 17, 2002, 6:44pm UTC](https://psychtoolbox.discourse.group/t/re-pelli-zhang-video-attenuator-attenuator-mex/1161/1 "2002-04-17T18:44:19Z")

</div>

> \>Denis,  
> \>  
> \>Thanks for the feedback. I have now purchased and installed an ISR video  
> \>attenuator on our Mac G4 with a Sony GDM F500 monitor. However, I am unclear  
> \>on how to determine if I am getting the increased resolution, or perhaps  
> \>more precisely, if the matlab routines I am using are able to access the  
> \>full resolution provided by the attenuator. Any advice would be greatly  
> \>appreciated.  
> \>  
> \>1. What exactly is the resolution provided by the attenuator? Is it  
> \>12-bits? Are there test routines that will confirm the exact resolution?  
> \>  
> \>2. I have modified the existing ContrastThresholdDemo routines to present  
> \>multiple moving gratings at different locations on the screen and to  
> \>estimate contrast thresholds for the detection of movement at each  
> \>location. However, I have not tinkered with the code that determines  
> \>contrast steps, CLUTs, or QUEST parameters. It appears that these routines  
> \>assume that only 256 luminance levels are available (8 bits). Do I need to  
> \>alter the statements that apparently refer to 256 levels in various matlab  
> \>routines to reflect the higher resolution provided by the attenuator in  
> \>order to get the QUEST routines to modulate stimulus contrast with finer  
> \>resolution? I've tried doing this with the statements I thought were  
> \>relevant, but I typically break the programs when I do so. Generally, if one  
> \>has a contrast threshold estimation program based on the QUEST routines set  
> \>up to expect 8-bit resolution, how does one alter the program to expect a  
> \>resolution of 12-bits (or whatever the resolution of the video attenuator  
> \>actually is)?  
> \>  
> \>Thanks for your advice,  
> \>  
> \>Vince Samar

dear vince  
  
1. you'll get an effective resolution of around 12 bits. no, we don't   
have any MATLAB test routines to show that. i would be good to have such.  
  
2. even though we use the Pelli-Zhang attenuator in nearly all our work,   
we're still using the original software that I wrote for it to do that,   
which has only minimal documentation (usage help) and is needlessly   
restricted to the Mac. We use a free-standing application called   
CalibrateLuminance and Attenuator.mex (formerly called "CLUT.mex"). (Both   
are available, see below; you seem to have them already.) Attenuator.mex   
reads the luminance calibration file produced by CalibrateLuminance and   
computes appropriate color lookup table (i.e. clut) values to linearly   
map a range of pixel values (entry numbers) to luminances. It takes   
advantage of the video attenuator to achieve very fine steps in that   
mapping.  
  
The normal way to use the video attenuator is to set the video card to   
use 8-bit pixels. In this case the pixel value (0 to 255) is used to   
select one of the entries (0 to 255) in the hardward color lookup table   
(clut). Each of those entries is a triplet of numbers, which drive the   
three DACs. The video attenuator combines those three voltages, with   
unequal gains, to produce one voltage, which drives your monitor. Thus,   
for a fixed clut, you can produce only 256 luminances. If you are   
simultaneously displaying several gratings you should optimize the clut   
for the highest contrast grating. Of course, the clut can be changed very   
quickly between frames, allowing you to have a completely different clut   
on each frame if you like. in practice, i rarely do that, but we do   
always compute a new clut for each stimulus presentation (i.e. each new   
trial at a new contrast).  
  
we have thought for some time that it would be very nice to replace the C   
programs CalibrateLuminance (standalone application) and Attenuator.mex   
by plain MATLAB code, but we don't have a schedule for that. the Pelli   
and Zhang article contains all the necessary information.  
  
Attenuator.mex will be included in the next release of the PsychToolbox,   
in a new category called "PsychBeta" of unsupported software that   
nevertheless seems to be of wide interest. I'm also enclosing it in this   
message.  
  
good luck  
  
best  
  
denis  
  
p.s.  
announcement for Attenuator.mex  
[http://psychtoolbox.org/mac.html#changes](http://psychtoolbox.org/mac.html#changes)  
  
attenuator web page  
[http://vision.nyu.edu/Tips/Attenuator.html](http://vision.nyu.edu/Tips/Attenuator.html)  
  
CalibrateLuminance (application and sources included in VideoToolbox)  
[http://vision.nyu.edu/VideoToolbox/Contents.html](http://vision.nyu.edu/VideoToolbox/Contents.html)  
[http://vision.nyu.edu/VideoToolbox/Download.html](http://vision.nyu.edu/VideoToolbox/Download.html)  
  
  
NOTE TO ALL: [denis.pelli@...](mailto:denis.pelli@...) is my preferred email address. Please   
use that address. My "verizon.net" address will go away soon, partly   
because Verizon forces me to use that as my "From:" address. My current   
email program won't allow me to designate a separate "Reply-to:" address.
