VisualThresholdsExperiment.m nearly finished.

master
mDescape 3 years ago
parent ba1b0718e8
commit e1c1789fc2
  1. BIN
      Code/C7000_Controller/netcoreapp3.1/C7000_Test.dll
  2. BIN
      Code/C7000_Controller/netcoreapp3.1/C7000_Test.pdb
  3. 1806
      Code/C7000_Controller/netcoreapp3.1/SkCommIo.log
  4. 4
      Code/Matlab/AuditoryThresholds_v3.m
  5. 1
      Code/Matlab/Average.csv
  6. 158
      Code/Matlab/CalibrateVisualStim.m
  7. 124
      Code/Matlab/CalibrateVisualStim_Descalzo.m
  8. 4
      Code/Matlab/Calibration_curve2.csv
  9. 4
      Code/Matlab/Calibration_curve_paper.csv
  10. 1
      Code/Matlab/N_error.csv
  11. 1
      Code/Matlab/P_error.csv
  12. 83
      Code/Matlab/RGB_to_lx.m
  13. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_2s1Repetitions_13-02-2020_20.47.16.mat
  14. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_2s1Repetitions_13-02-2020_20.47.16.png
  15. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_2s1Repetitions_13-02-2020_20.50.45.mat
  16. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_2s1Repetitions_13-02-2020_20.50.45.png
  17. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_2s1Repetitions_23-02-2020_11.05.23.mat
  18. BIN
      Code/Matlab/Results/VisualThreshold/test/test_VisualThreshold_2s1Repetitions_23-02-2020_11.05.23.png
  19. 55
      Code/Matlab/TCP_Server.m
  20. 216
      Code/Matlab/VisualThresholdsExperiment.m
  21. 0
      Code/Matlab/Visual_Calibration_curve.csv
  22. 0
      Code/Matlab/Visual_ClosedLoop_CalibrateStim.m
  23. 10
      Code/Matlab/Visual_GetSpectrum.m
  24. 2
      Code/Matlab/Visual_OpenLoop_CalibrateStim.m
  25. 2
      Code/Matlab/Visual_Post_Cal_Test.m
  26. 0
      Code/Matlab/Visual_Present_single_image.m
  27. 0
      Code/Matlab/Visual_Time_evolution.m
  28. 15
      Code/Matlab/untitled.m
  29. BIN
      Documents/Bibliografia_llindar_molestia.rar
  30. BIN
      Documents/Configuracio.png
  31. BIN
      Documents/Materials_llindar_molestia.xlsx
  32. BIN
      Documents/sboa035.pdf
  33. 674
      LICENSE

File diff suppressed because it is too large Load Diff

@ -206,9 +206,9 @@ function [threshold, history, responsesStaircase, reactionTimes] = AuditoryThres
simulatedResponses = zeros(1,nMaxTrials);
% responses(1:2:end) = 1;
simulatedResponses((randi(2,1,nMaxTrials)-1)==1) = 1;
end
end
aafafaafafafaafaaffaafafaaffaffaaaffffafaa responses = ones(2, nMaxTrials).*(-1);
responses = ones(2, nMaxTrials).*(-1);
reactionTimes = ones(2, nMaxTrials).*(-1);
trial = 1;
while ~isFinished

@ -1 +0,0 @@
13.97,14.34,15.18,15.93,17.33,19.19,21.49,24.41,27.88,31.94,37.01,42.12,48.71,55.52,62.83,73.72,80.91,92.02,103,113.8,129,142.8,158.3,170.1,190.2,205.5,223.8,240.7,269.2,293.5,314.4,348.8,379,409,433.6,479.8,507.2,557.7,595.9,632,677.7,736.2,782.6,850.2,905,958.1,1006,1070,1130,1195,1270,1302,1383,1446,1515,1596,1666,1746,1825,1912,1994,2067,2156,2243,2330,2408,2498,2590,2673,2773,2871,2954,3065,3178,3288,3390,3486,3595,3699,3836,3945,4085,4173,4291,4430,4531,4693,4811,4927,5057,5202,5324,5470,5615,5747,5865,5974,6117,6236,6380,6495,6640,6770,6886,7023,7156,7280,7452,7624,7732,7856,7986,8109,8237,8391,8492,8644,8767,8950,9038,9163,9265,9418,9559,9697,9812,9930,10090,10300,10410,10500,10790,11030,10970,11290,11480,11530,11610,11740,11950,12180,12410,12730,12660,13010,12920,13200,13110,13340,13060,13420,13600,13350,14090,13890,14680,14470,14530,14930,14240,15290,15420,15290,15220,15590,16060,16340,16630,16840,17120,17210,17130,17140,17610,17400,18810,18020,18080,17910,18830,19170,19370,18730,19620,19840,19650,20470,19940,19700,20240,20700,20220,20490,20030,21130,20720,20080,21380,21110,22010,21910,21610,21510,22270,22090,23030,22660,22830,23380,22580,23440,22490,23650,23580,24080,24940,24490,24450,24420,23640,23630,24290,25390,24750,25060,25580,26010,25640,26390,26150,26860,26900,26970,27220,27570,27890,27890,27840,28280,28250,28470,28500,28440,28760,29000,29150,29140,29350,29640,29720,29660,29690,29970,30260,30510,30750
1 13.97 14.34 15.18 15.93 17.33 19.19 21.49 24.41 27.88 31.94 37.01 42.12 48.71 55.52 62.83 73.72 80.91 92.02 103 113.8 129 142.8 158.3 170.1 190.2 205.5 223.8 240.7 269.2 293.5 314.4 348.8 379 409 433.6 479.8 507.2 557.7 595.9 632 677.7 736.2 782.6 850.2 905 958.1 1006 1070 1130 1195 1270 1302 1383 1446 1515 1596 1666 1746 1825 1912 1994 2067 2156 2243 2330 2408 2498 2590 2673 2773 2871 2954 3065 3178 3288 3390 3486 3595 3699 3836 3945 4085 4173 4291 4430 4531 4693 4811 4927 5057 5202 5324 5470 5615 5747 5865 5974 6117 6236 6380 6495 6640 6770 6886 7023 7156 7280 7452 7624 7732 7856 7986 8109 8237 8391 8492 8644 8767 8950 9038 9163 9265 9418 9559 9697 9812 9930 10090 10300 10410 10500 10790 11030 10970 11290 11480 11530 11610 11740 11950 12180 12410 12730 12660 13010 12920 13200 13110 13340 13060 13420 13600 13350 14090 13890 14680 14470 14530 14930 14240 15290 15420 15290 15220 15590 16060 16340 16630 16840 17120 17210 17130 17140 17610 17400 18810 18020 18080 17910 18830 19170 19370 18730 19620 19840 19650 20470 19940 19700 20240 20700 20220 20490 20030 21130 20720 20080 21380 21110 22010 21910 21610 21510 22270 22090 23030 22660 22830 23380 22580 23440 22490 23650 23580 24080 24940 24490 24450 24420 23640 23630 24290 25390 24750 25060 25580 26010 25640 26390 26150 26860 26900 26970 27220 27570 27890 27890 27840 28280 28250 28470 28500 28440 28760 29000 29150 29140 29350 29640 29720 29660 29690 29970 30260 30510 30750

@ -1,158 +0,0 @@
function CalibrateAudioStimuli()
% Script to measure the difference (in terms of intensity) between the
% sent and the presented stimuli using the sonometer.
% Stimuli parameters
volumes = [30:2:60]; % in dBA
frequencies = 1000; % in Hz
durations = 3; % in seconds
interStimuliInterval = 3; % in seconds
stimulusRepetitions = 5;
intraStimuliInterval = 6; % in seconds
calibrationRepetitions = 3;
% Perform basic initialization of the sound driver:
InitializePsychSound(1);
% Get audio devices
% 1=Windows/DirectSound, 2=Windows/MME, 11=Windows/WDMKS, 13=Windows/WASAPI, 8=Linux/ALSA, 7=Linux/OSS, 12=Linux/JACK, 5=MacOSX/CoreAudio.
deviceType = 3;
devices = PsychPortAudio('GetDevices', deviceType);
deviceId = devices.DeviceIndex;
% deviceFreq: Requested playback/capture rate in samples per second (Hz).
deviceSamplingRate = devices.DefaultSampleRate;
% deviceChannels: Number of audio channels to use, defaults to 2 for stereo.
deviceChannels = devices.NrOutputChannels;
% Mode: Defaults to 1 == sound playback only. Can be set to 2 == audio
% capture, or 3 for simultaneous capture and playback of sound. Note however that
% mode 3 (full duplex) does not work reliably on all sound hardware.
soundMode = 1;
% ReqLatency: Level 0 means: Don’t care about latency or timing
% precision. This mode works always and with all settings, plays nicely with other
% sound applications. Level 1 (the default) means: Try to get the lowest latency
% that is possible under the constraint of reliable playback, freedom of choice
% for all parameters and interoperability with other applications. Level 2 means:
% Take full control over the audio device, even if this causes other sound
% applications to fail or shutdown. Level 3 means: As level 2, but request the
% most aggressive settings for the given device. Level 4: Same as 3, but fail if
% device can’t meet the strictest requirements.
reqLatency = 2; % should be 2
try
pahandle = PsychPortAudio('Open', deviceId, soundMode, reqLatency, deviceSamplingRate, deviceChannels);
catch
% Close Audio Port
try
PsychPortAudio('Close', pahandle);
catch
PsychPortAudio('Close');
end
pahandle = PsychPortAudio('Open', deviceId, soundMode, reqLatency, deviceSamplingRate, deviceChannels);
end
status = PsychPortAudio('GetStatus', pahandle);
oldRunMode = PsychPortAudio('RunMode', pahandle, 1);
% A-weights
% Weights extracted from Harrison, M. (2004). The measurement and behaviour of sound. Vehicle Refinement, 17–73
aWeights = [-63.4 -56.7 -50.5 -44.7 -39.4 -34.6 -30.2 -26.2 -22.5 -19.1 -16.1 -13.4 -10.9 -8.6 -6.6 -4.8 -3.2 -1.9 -0.8 0 0.6 1 1.2 1.3 1.2 1 0.5 -0.1 -1.1 -2.5 -4.3 -6.6 -9.3];
aFreqs = [12.5 16 20 25 31.5 40 50 63 80 100 125 160 200 250 315 400 500 630 800 1000 1250 1600 2000 2500 3150 4000 5000 6300 8000 10000 12500 16000 20000];
aXs = linspace(min(aFreqs(:)), max(aFreqs(:)), 10000);
aYs = interp1(aFreqs, aWeights, aXs);
% figure,
% semilogx(aXs, aYs);
% title('A-Weighting');
calibrationCurve = zeros(calibrationRepetitions,size(volumes,2));
for c = 1:calibrationRepetitions
for trial = 1:size(volumes,2)
% Initialize sound variable
stimulusSampling = round(durations*deviceSamplingRate);
% intraStimuliIntervalSampling = round(intraStimuliInterval*deviceSamplingRate);
% auditoryStimulusLength = stimulusSampling+intraStimuliIntervalSampling;
auditoryStimulusLength = stimulusSampling;
% From volume (dBA) to amplitude
weight = interp1(aFreqs, aWeights, frequencies);
vol = volumes(trial);
amp = 20e-6*10^((vol-weight)/20);
% Create pure tone
auditoryStimulus = zeros(1,auditoryStimulusLength);
auditoryStimulus(1,1:stimulusSampling) = MakeBeep_v2(frequencies, durations, deviceSamplingRate, 1);
auditoryStimulus = repmat(auditoryStimulus, [deviceChannels 1]); % repeat it ti di it stereo
% From amplitude to volume (dBA)
% Set volume of the stimulus
PsychPortAudio('Volume', pahandle, amp);
% Volume in dB, considering the air reference (20 microPascals).
% Amplitude ratio to dB conversion: GdB = 20 log10(A2 / A1), where
% A2 is the amplitude level, A1 is the referenced amplitude level and
% GdB is the amplitude ratio or gain in dB. Extracted from https://www.rapidtables.com/electric/decibel.html
volumeDB = 20*log10(amp/(20e-6));
volumeDBA = volumeDB + interp1(aFreqs, aWeights, frequencies);
disp(['Stimulus'' ', 'volume values: ', num2str(volumeDB), ' dB (', num2str(frequencies), ' Hz), i.e. ', num2str(volumeDBA), ' dBA'])
% Fill the audio playback buffer with the audio data:
PsychPortAudio('FillBuffer', pahandle, auditoryStimulus);
% Start playback for these sources:
for r = 1:stimulusRepetitions
startTime = PsychPortAudio('Start', pahandle);
% Stop playback of all sources:
[startTime endPositionSecs xruns estStopTime] = PsychPortAudio('Stop', pahandle, 1); % wait until the stimulus is finished
if r~=stimulusRepetitions
WaitSecs(intraStimuliInterval);
end
end
% Collect measured intensity (in dBA)
titleBar = 'Calibración de los estímulos';
userPrompt = {'Intensidad observada (en dBA)'};
caUserInput = inputdlg(userPrompt, titleBar, 1);
if isempty(caUserInput),return,end % Bail out if they clicked Cancel.
calibrationCurve(c,trial) = str2double(caUserInput{1});
% Delete buffer:
result = PsychPortAudio('DeleteBuffer');
WaitSecs(interStimuliInterval);
end
end
% Save results
currDate = datestr(now, 'yyyy-mm-dd');
save(['Results/AudioCalibration/',currDate,'_',num2str(frequencies),'Hz.mat'],'volumes','calibrationCurve','frequencies','durations');
figure,
hold on;
errorbar(volumes, mean(calibrationCurve,1), std(calibrationCurve,0,1), 'Color', [0.25 0.25 0.25], 'LineWidth', 2);
% plot(volumes, mean(calibrationCurve,1), 'Color', [0.25 0.25 0.25], 'LineWidth', 2);
scatter(volumes, mean(calibrationCurve,1), 40, [0 0 0]);
hold off;
xlim([min(min(volumes(:)),min(calibrationCurve(:))) max(max(volumes(:)),max(calibrationCurve(:)))]);
ylim([min(min(volumes(:)),min(calibrationCurve(:))) max(max(volumes(:)),max(calibrationCurve(:)))]);
xlabel('Sent intensity (in dBA)');
ylabel('Measured intensity (in dBA)');
title('Intensity calibration of audio stimuli');
disp('Calibration done');
% Wait a bit:
WaitSecs(0.1);
% Close Audio Port
PsychPortAudio('Close', pahandle);
% Done
return;

@ -1,124 +0,0 @@
num_measures = 5; %Number of measures will be made in each cycle of the calibration
interStimuliColor_sRGB = [0 0 0];
screenSizePix2 = zeros(1,2);
screenSizePix1 = zeros(1,2);
%Call the C7000 controller (TCP client)
!..\C7000_Controller\netcoreapp3.1\C7000_Test &
%Start the TCP server
tcpObj = tcp_Server_Start(); %Wait here until the client connects
%Screen('Preference', 'ScreenToHead', 0, 1, 1);
Screen('Preference', 'SkipSyncTests', 1);
screenNumber = max(Screen('Screens')); %0: single display setting
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', screenNumber);
[screenSizePix1(1) screenSizePix1(2)] = Screen('WindowSize', 1); %Principal monitor size
wPtr = Screen('OpenWindow', screenNumber, interStimuliColor_sRGB, [screenSizePix1(1) 1 screenSizePix1(1)+screenSizePix2(1) screenSizePix2(2)]);
Screen('FillRect', wPtr, interStimuliColor_sRGB);
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', wPtr);
% >>>>>Start of the calibration<<<<
%Present the first image
stimImg = GenerateNoisyImage([screenSizePix2(2) screenSizePix2(1)], 0.3, 0);
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);
[average1, ~, ~] = C7000_Read(num_measures, tcpObj); %Perform n measures and returun the usefull values
Screen('Close', stimTextureId);
%Present the second image
stimImg = GenerateNoisyImage([screenSizePix2(2) screenSizePix2(1)], 0.5, 0);
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);
[average2, ~, ~] = C7000_Read(num_measures, tcpObj); %Perform n measures and returun the usefull values
Screen('Close', stimTextureId);
%Lineal law: y = ax + b
a = (0.5-0.3)/(average2-average1);
b = (0.3)-(a*average1);
% >>>>Creation of the calibration curve<<<<
calIntensity = [0:1000:30000]; %Luminances we are aiming
realIntensity_avr = []; %Real luminances we are getting
realIntensity_max = [];
realIntensity_min = [];
for intensity = calIntensity
meanIntensity = intensity*a + b;
if meanIntensity > 1
meanIntensity = 1;
end
stimImg = GenerateNoisyImage([screenSizePix2(2) screenSizePix2(1)], meanIntensity, 0);
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);
[average_lx, max_lx, min_lx] = C7000_Read(num_measures, tcpObj); %Perform n measures and returun the usefull values
realIntensity_avr = [realIntensity_avr, average_lx];
realIntensity_max = [realIntensity_max, max_lx-average_lx];
realIntensity_min = [realIntensity_min, average_lx-min_lx];
end
errorbar(calIntensity, realIntensity_avr, realIntensity_min, realIntensity_max, '-o');
hold on
plot(calIntensity, calIntensity);
title('Calibration curve');
legend('Experimental points', 'X=Y curve');
ylabel('Iluminance received [lx]');
xlabel('Iluminance desired [lx]');
hold off
%Program clossing
sca;
C7000_End_program(tcpObj); %Return the C-7000 to its manual control
fclose(tcpObj); %Close the server
%C-7000 controller Functions
%START HERE
function tcpObj = tcp_Server_Start()
%Opens a TCP/IP server and waits until a client connects to it
port = 30000;
tcpObj = tcpip('0.0.0.0', port, 'NetworkRole', 'Server')
tcpObj.ByteOrder = 'littleEndian';
tcpObj.Timeout = 9999;
fopen(tcpObj); %Wait until the client connects
end
function [average_lx, max_lx, min_lx] = C7000_Read(n, tcpObj)
%Ask the C-7000 to make n measures and returns average, max and min lux
%of all the measures
fwrite(tcpObj, int16(n), 'int16');
average_lx = fread(tcpObj, 1, 'double');
max_lx = fread(tcpObj, 1, 'double');
min_lx = fread(tcpObj, 1, 'double');
end
function C7000_End_program(tcpObj)
fwrite(tcpObj, int16(-1), 'int16'); %Ask the C-7000 to finish the program
end
%END HERE

@ -1,4 +0,0 @@
0,0.0039216,0.0078431,0.011765,0.015686,0.019608,0.023529,0.027451,0.031373,0.035294,0.039216,0.043137,0.047059,0.05098,0.054902,0.058824,0.062745,0.066667,0.070588,0.07451,0.078431,0.082353,0.086275,0.090196,0.094118,0.098039,0.10196,0.10588,0.1098,0.11373,0.11765,0.12157,0.12549,0.12941,0.13333,0.13725,0.14118,0.1451,0.14902,0.15294,0.15686,0.16078,0.16471,0.16863,0.17255,0.17647,0.18039,0.18431,0.18824,0.19216,0.19608,0.2,0.20392,0.20784,0.21176,0.21569,0.21961,0.22353,0.22745,0.23137,0.23529,0.23922,0.24314,0.24706,0.25098,0.2549,0.25882,0.26275,0.26667,0.27059,0.27451,0.27843,0.28235,0.28627,0.2902,0.29412,0.29804,0.30196,0.30588,0.3098,0.31373,0.31765,0.32157,0.32549,0.32941,0.33333,0.33725,0.34118,0.3451,0.34902,0.35294,0.35686,0.36078,0.36471,0.36863,0.37255,0.37647,0.38039,0.38431,0.38824,0.39216,0.39608,0.4,0.40392,0.40784,0.41176,0.41569,0.41961,0.42353,0.42745,0.43137,0.43529,0.43922,0.44314,0.44706,0.45098,0.4549,0.45882,0.46275,0.46667,0.47059,0.47451,0.47843,0.48235,0.48627,0.4902,0.49412,0.49804,0.50196,0.50588,0.5098,0.51373,0.51765,0.52157,0.52549,0.52941,0.53333,0.53725,0.54118,0.5451,0.54902,0.55294,0.55686,0.56078,0.56471,0.56863,0.57255,0.57647,0.58039,0.58431,0.58824,0.59216,0.59608,0.6,0.60392,0.60784,0.61176,0.61569,0.61961,0.62353,0.62745,0.63137,0.63529,0.63922,0.64314,0.64706,0.65098,0.6549,0.65882,0.66275,0.66667,0.67059,0.67451,0.67843,0.68235,0.68627,0.6902,0.69412,0.69804,0.70196,0.70588,0.7098,0.71373,0.71765,0.72157,0.72549,0.72941,0.73333,0.73725,0.74118,0.7451,0.74902,0.75294,0.75686,0.76078,0.76471,0.76863,0.77255,0.77647,0.78039,0.78431,0.78824,0.79216,0.79608,0.8,0.80392,0.80784,0.81176,0.81569,0.81961,0.82353,0.82745,0.83137,0.83529,0.83922,0.84314,0.84706,0.85098,0.8549,0.85882,0.86275,0.86667,0.87059,0.87451,0.87843,0.88235,0.88627,0.8902,0.89412,0.89804,0.90196,0.90588,0.9098,0.91373,0.91765,0.92157,0.92549,0.92941,0.93333,0.93725,0.94118,0.9451,0.94902,0.95294,0.95686,0.96078,0.96471,0.96863,0.97255,0.97647,0.98039,0.98431,0.98824,0.99216,0.99608,1
13.18,13.72,14.5,15.4,17.02,18.88,21.22,24.46,27.98,32.58,37.54,42.88,49.78,56.78,64.6,73.22,82.84,94.24,105.2,116,129,143.4,159.2,175,190.8,211.4,229.2,247,269.4,294.2,322.8,350.4,382,411.2,443.6,482.4,521.6,562.2,603.6,648.4,697.4,744.8,791.4,858.4,911.6,972,1022,1084,1150,1204,1290,1326,1406,1470,1532,1616,1686,1778,1858,1938,2024,2110,2184,2276,2350,2448,2534,2624,2728,2820,2924,3014,3118,3224,3340,3454,3548,3656,3758,3890,3990,4130,4248,4354,4508,4616,4758,4888,5012,5130,5266,5412,5556,5704,5842,5958,6038,6202,6340,6424,6562,6728,6852,6950,7092,7234,7372,7498,7696,7784,7980,8088,8200,8316,8460,8548,8720,8838,9004,9096,9256,9354,9490,9642,9776,9902,10040,10100,10400,10660,10620,10780,10880,11100,11360,11540,11500,11700,11920,11900,12020,12360,12580,12540,12720,12940,13360,13060,13040,13620,13700,13980,13980,14100,14580,14600,15260,14940,15000,15000,15380,15680,15740,14560,15540,16040,16240,16920,16120,15680,16500,16820,18260,17680,16760,17980,17640,17740,18420,18480,18300,18440,18600,18540,18760,19080,19320,19620,19580,19260,19540,19340,21220,21420,20720,20480,20540,21180,21720,22060,21500,22060,22540,22680,22620,23260,23000,24120,23240,23160,24020,23020,23840,24240,23740,23900,24780,25020,25900,25980,25100,25220,26200,26300,25820,26800,26600,26440,27260,26820,27540,27380,27760,27940,28200,28300,28520,28660,28640,28280,29300,29420,29080,29500,29320,29840,29580,29820,29820,29800,30460,30560,30600,30360,31260,31380
0.32,0.08,0,0,0.08,0.02,0.08,0.04,0.02,0.12,0.06,0.12,0.12,0.12,0.2,0.08,0.26,0.06,0.8,0,0,0.6,0.8,0,0.2,0.6,0.8,0,0.6,0.8,0.2,0.6,1,0.8,2.4,0.6,1.4,1.8,1.4,0.6,0.6,2.2,4.6,3.6,0.4,2,8,6,0,6,0,14,4,0,8,4,4,2,2,12,6,0,6,4,20,2,16,6,2,10,6,6,12,16,10,6,12,14,22,10,20,10,22,26,12,14,22,22,18,10,24,18,24,26,18,12,12,18,10,16,28,22,8,20,18,16,18,22,34,16,30,22,20,34,20,32,20,12,26,14,24,26,20,18,14,28,60,0,0,740,80,20,20,0,640,360,0,0,480,200,280,440,220,360,880,860,540,1240,960,580,900,820,1020,1200,1120,1000,840,960,500,1700,1120,820,1260,840,1760,460,660,1280,1980,520,1900,1380,740,2020,1040,2120,2960,2060,2280,2420,2900,960,2100,1360,1340,1620,580,580,520,540,1660,860,2080,2380,3380,520,360,520,1180,2140,1000,840,2160,520,3080,2340,700,2080,1760,1140,1080,580,1260,960,860,1200,1820,1680,1900,520,1100,1580,1300,3400,880,1700,1100,4360,2940,880,1160,320,340,2260,300,1000,380,640,560,1020,300,380,620,400,380,360,820,580,480,500,240,440,700,740,1340,1020
0.58,0.02,0,0,0.02,0.08,0.02,0.06,0.08,0.08,0.04,0.08,0.18,0.18,0.2,0.12,0.14,0.04,0.2,0,0,0.4,0.2,0,0.8,0.4,0.2,0,0.4,0.2,0.8,0.4,2,0.2,1.6,1.4,1.6,1.2,1.6,1.4,1.4,1.8,3.4,1.4,0.6,2,2,4,0,4,0,16,6,0,12,16,6,8,8,18,4,0,14,6,20,8,24,4,8,20,24,4,18,14,20,4,18,26,28,20,20,40,38,34,38,16,38,28,12,20,16,32,26,14,12,18,28,12,10,14,22,18,2,10,22,24,22,48,16,14,30,28,20,36,20,18,10,18,24,26,6,14,10,12,16,42,40,0,0,260,20,80,80,0,160,240,0,0,120,100,320,360,180,340,1020,440,160,860,840,1220,900,1480,780,1300,780,1900,1160,1140,800,1700,1680,1980,1840,560,1340,340,1040,1620,1320,680,1200,1320,1260,1580,760,1980,1440,1240,1620,1480,1300,1240,1200,1040,1060,880,1220,520,1080,360,840,440,2020,2020,1120,480,440,480,1220,1260,800,960,1840,580,1320,2160,1100,1020,1540,960,920,1220,1540,1140,1440,1400,1980,2320,700,1080,1800,2020,1700,2200,1320,2300,1100,2540,1660,1020,440,780,260,940,200,1400,620,660,1040,980,500,820,980,200,320,340,1080,620,520,200,260,260,600,460,1860,1680
1 0 0.0039216 0.0078431 0.011765 0.015686 0.019608 0.023529 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.05098 0.054902 0.058824 0.062745 0.066667 0.070588 0.07451 0.078431 0.082353 0.086275 0.090196 0.094118 0.098039 0.10196 0.10588 0.1098 0.11373 0.11765 0.12157 0.12549 0.12941 0.13333 0.13725 0.14118 0.1451 0.14902 0.15294 0.15686 0.16078 0.16471 0.16863 0.17255 0.17647 0.18039 0.18431 0.18824 0.19216 0.19608 0.2 0.20392 0.20784 0.21176 0.21569 0.21961 0.22353 0.22745 0.23137 0.23529 0.23922 0.24314 0.24706 0.25098 0.2549 0.25882 0.26275 0.26667 0.27059 0.27451 0.27843 0.28235 0.28627 0.2902 0.29412 0.29804 0.30196 0.30588 0.3098 0.31373 0.31765 0.32157 0.32549 0.32941 0.33333 0.33725 0.34118 0.3451 0.34902 0.35294 0.35686 0.36078 0.36471 0.36863 0.37255 0.37647 0.38039 0.38431 0.38824 0.39216 0.39608 0.4 0.40392 0.40784 0.41176 0.41569 0.41961 0.42353 0.42745 0.43137 0.43529 0.43922 0.44314 0.44706 0.45098 0.4549 0.45882 0.46275 0.46667 0.47059 0.47451 0.47843 0.48235 0.48627 0.4902 0.49412 0.49804 0.50196 0.50588 0.5098 0.51373 0.51765 0.52157 0.52549 0.52941 0.53333 0.53725 0.54118 0.5451 0.54902 0.55294 0.55686 0.56078 0.56471 0.56863 0.57255 0.57647 0.58039 0.58431 0.58824 0.59216 0.59608 0.6 0.60392 0.60784 0.61176 0.61569 0.61961 0.62353 0.62745 0.63137 0.63529 0.63922 0.64314 0.64706 0.65098 0.6549 0.65882 0.66275 0.66667 0.67059 0.67451 0.67843 0.68235 0.68627 0.6902 0.69412 0.69804 0.70196 0.70588 0.7098 0.71373 0.71765 0.72157 0.72549 0.72941 0.73333 0.73725 0.74118 0.7451 0.74902 0.75294 0.75686 0.76078 0.76471 0.76863 0.77255 0.77647 0.78039 0.78431 0.78824 0.79216 0.79608 0.8 0.80392 0.80784 0.81176 0.81569 0.81961 0.82353 0.82745 0.83137 0.83529 0.83922 0.84314 0.84706 0.85098 0.8549 0.85882 0.86275 0.86667 0.87059 0.87451 0.87843 0.88235 0.88627 0.8902 0.89412 0.89804 0.90196 0.90588 0.9098 0.91373 0.91765 0.92157 0.92549 0.92941 0.93333 0.93725 0.94118 0.9451 0.94902 0.95294 0.95686 0.96078 0.96471 0.96863 0.97255 0.97647 0.98039 0.98431 0.98824 0.99216 0.99608 1
2 13.18 13.72 14.5 15.4 17.02 18.88 21.22 24.46 27.98 32.58 37.54 42.88 49.78 56.78 64.6 73.22 82.84 94.24 105.2 116 129 143.4 159.2 175 190.8 211.4 229.2 247 269.4 294.2 322.8 350.4 382 411.2 443.6 482.4 521.6 562.2 603.6 648.4 697.4 744.8 791.4 858.4 911.6 972 1022 1084 1150 1204 1290 1326 1406 1470 1532 1616 1686 1778 1858 1938 2024 2110 2184 2276 2350 2448 2534 2624 2728 2820 2924 3014 3118 3224 3340 3454 3548 3656 3758 3890 3990 4130 4248 4354 4508 4616 4758 4888 5012 5130 5266 5412 5556 5704 5842 5958 6038 6202 6340 6424 6562 6728 6852 6950 7092 7234 7372 7498 7696 7784 7980 8088 8200 8316 8460 8548 8720 8838 9004 9096 9256 9354 9490 9642 9776 9902 10040 10100 10400 10660 10620 10780 10880 11100 11360 11540 11500 11700 11920 11900 12020 12360 12580 12540 12720 12940 13360 13060 13040 13620 13700 13980 13980 14100 14580 14600 15260 14940 15000 15000 15380 15680 15740 14560 15540 16040 16240 16920 16120 15680 16500 16820 18260 17680 16760 17980 17640 17740 18420 18480 18300 18440 18600 18540 18760 19080 19320 19620 19580 19260 19540 19340 21220 21420 20720 20480 20540 21180 21720 22060 21500 22060 22540 22680 22620 23260 23000 24120 23240 23160 24020 23020 23840 24240 23740 23900 24780 25020 25900 25980 25100 25220 26200 26300 25820 26800 26600 26440 27260 26820 27540 27380 27760 27940 28200 28300 28520 28660 28640 28280 29300 29420 29080 29500 29320 29840 29580 29820 29820 29800 30460 30560 30600 30360 31260 31380
3 0.32 0.08 0 0 0.08 0.02 0.08 0.04 0.02 0.12 0.06 0.12 0.12 0.12 0.2 0.08 0.26 0.06 0.8 0 0 0.6 0.8 0 0.2 0.6 0.8 0 0.6 0.8 0.2 0.6 1 0.8 2.4 0.6 1.4 1.8 1.4 0.6 0.6 2.2 4.6 3.6 0.4 2 8 6 0 6 0 14 4 0 8 4 4 2 2 12 6 0 6 4 20 2 16 6 2 10 6 6 12 16 10 6 12 14 22 10 20 10 22 26 12 14 22 22 18 10 24 18 24 26 18 12 12 18 10 16 28 22 8 20 18 16 18 22 34 16 30 22 20 34 20 32 20 12 26 14 24 26 20 18 14 28 60 0 0 740 80 20 20 0 640 360 0 0 480 200 280 440 220 360 880 860 540 1240 960 580 900 820 1020 1200 1120 1000 840 960 500 1700 1120 820 1260 840 1760 460 660 1280 1980 520 1900 1380 740 2020 1040 2120 2960 2060 2280 2420 2900 960 2100 1360 1340 1620 580 580 520 540 1660 860 2080 2380 3380 520 360 520 1180 2140 1000 840 2160 520 3080 2340 700 2080 1760 1140 1080 580 1260 960 860 1200 1820 1680 1900 520 1100 1580 1300 3400 880 1700 1100 4360 2940 880 1160 320 340 2260 300 1000 380 640 560 1020 300 380 620 400 380 360 820 580 480 500 240 440 700 740 1340 1020
4 0.58 0.02 0 0 0.02 0.08 0.02 0.06 0.08 0.08 0.04 0.08 0.18 0.18 0.2 0.12 0.14 0.04 0.2 0 0 0.4 0.2 0 0.8 0.4 0.2 0 0.4 0.2 0.8 0.4 2 0.2 1.6 1.4 1.6 1.2 1.6 1.4 1.4 1.8 3.4 1.4 0.6 2 2 4 0 4 0 16 6 0 12 16 6 8 8 18 4 0 14 6 20 8 24 4 8 20 24 4 18 14 20 4 18 26 28 20 20 40 38 34 38 16 38 28 12 20 16 32 26 14 12 18 28 12 10 14 22 18 2 10 22 24 22 48 16 14 30 28 20 36 20 18 10 18 24 26 6 14 10 12 16 42 40 0 0 260 20 80 80 0 160 240 0 0 120 100 320 360 180 340 1020 440 160 860 840 1220 900 1480 780 1300 780 1900 1160 1140 800 1700 1680 1980 1840 560 1340 340 1040 1620 1320 680 1200 1320 1260 1580 760 1980 1440 1240 1620 1480 1300 1240 1200 1040 1060 880 1220 520 1080 360 840 440 2020 2020 1120 480 440 480 1220 1260 800 960 1840 580 1320 2160 1100 1020 1540 960 920 1220 1540 1140 1440 1400 1980 2320 700 1080 1800 2020 1700 2200 1320 2300 1100 2540 1660 1020 440 780 260 940 200 1400 620 660 1040 980 500 820 980 200 320 340 1080 620 520 200 260 260 600 460 1860 1680

@ -1,4 +0,0 @@
0,0.0039216,0.0078431,0.011765,0.015686,0.019608,0.023529,0.027451,0.031373,0.035294,0.039216,0.043137,0.047059,0.05098,0.054902,0.058824,0.062745,0.066667,0.070588,0.07451,0.078431,0.082353,0.086275,0.090196,0.094118,0.098039,0.10196,0.10588,0.1098,0.11373,0.11765,0.12157,0.12549,0.12941,0.13333,0.13725,0.14118,0.1451,0.14902,0.15294,0.15686,0.16078,0.16471,0.16863,0.17255,0.17647,0.18039,0.18431,0.18824,0.19216,0.19608,0.2,0.20392,0.20784,0.21176,0.21569,0.21961,0.22353,0.22745,0.23137,0.23529,0.23922,0.24314,0.24706,0.25098,0.2549,0.25882,0.26275,0.26667,0.27059,0.27451,0.27843,0.28235,0.28627,0.2902,0.29412,0.29804,0.30196,0.30588,0.3098,0.31373,0.31765,0.32157,0.32549,0.32941,0.33333,0.33725,0.34118,0.3451,0.34902,0.35294,0.35686,0.36078,0.36471,0.36863,0.37255,0.37647,0.38039,0.38431,0.38824,0.39216,0.39608,0.4,0.40392,0.40784,0.41176,0.41569,0.41961,0.42353,0.42745,0.43137,0.43529,0.43922,0.44314,0.44706,0.45098,0.4549,0.45882,0.46275,0.46667,0.47059,0.47451,0.47843,0.48235,0.48627,0.4902,0.49412,0.49804,0.50196,0.50588,0.5098,0.51373,0.51765,0.52157,0.52549,0.52941,0.53333,0.53725,0.54118,0.5451,0.54902,0.55294,0.55686,0.56078,0.56471,0.56863,0.57255,0.57647,0.58039,0.58431,0.58824,0.59216,0.59608,0.6,0.60392,0.60784,0.61176,0.61569,0.61961,0.62353,0.62745,0.63137,0.63529,0.63922,0.64314,0.64706,0.65098,0.6549,0.65882,0.66275,0.66667,0.67059,0.67451,0.67843,0.68235,0.68627,0.6902,0.69412,0.69804,0.70196,0.70588,0.7098,0.71373,0.71765,0.72157,0.72549,0.72941,0.73333,0.73725,0.74118,0.7451,0.74902,0.75294,0.75686,0.76078,0.76471,0.76863,0.77255,0.77647,0.78039,0.78431,0.78824,0.79216,0.79608,0.8,0.80392,0.80784,0.81176,0.81569,0.81961,0.82353,0.82745,0.83137,0.83529,0.83922,0.84314,0.84706,0.85098,0.8549,0.85882,0.86275,0.86667,0.87059,0.87451,0.87843,0.88235,0.88627,0.8902,0.89412,0.89804,0.90196,0.90588,0.9098,0.91373,0.91765,0.92157,0.92549,0.92941,0.93333,0.93725,0.94118,0.9451,0.94902,0.95294,0.95686,0.96078,0.96471,0.96863,0.97255,0.97647,0.98039,0.98431,0.98824,0.99216,0.99608,1
2.48,2.58,2.74,2.88,3.12,3.5,3.94,4.5,5.2,5.92,6.86,7.84,9.1,10.42,11.82,13.6,15.3,17.42,19.42,21.5,23.8,26.4,29.3,32.44,35.72,39.42,42.88,46.1,50.34,55.14,60.16,65.38,71.18,77.6,82.96,90,97.1,105,112,120.4,129.8,138.8,147.2,159.8,169.6,181,191,202.2,215.6,227.6,239,249.8,261.4,275.4,286.8,301,315,330.2,346.2,362.2,376.8,393,408,424.4,441,456.4,473.6,491.8,509.4,528.6,545.6,561.6,583.6,604.8,625.2,641.2,662.2,682.8,703.6,725.8,749.2,771.8,794.8,818.8,844.4,866.6,892,918,943.6,966,993,1016,1042,1076,1100,1126,1140,1170,1194,1210,1240,1266,1286,1304,1332,1358,1380,1410,1440,1470,1486,1526,1542,1566,1584,1620,1642,1668,1702,1720,1744,1768,1786,1818,1842,1870,1894,1914,1958,1982,2004,2040,2064,2086,2118,2132,2162,2196,2228,2230,2282,2292,2336,2346,2378,2412,2440,2458,2488,2512,2552,2584,2614,2646,2680,2702,2744,2770,2804,2836,2874,2920,2958,2986,3020,3054,3086,3134,3170,3190,3208,3270,3306,3344,3384,3404,3446,3486,3510,3562,3582,3620,3652,3688,3730,3788,3794,3830,3880,3902,3922,3940,4012,4036,4084,4108,4140,4170,4194,4228,4278,4286,4312,4348,4372,4398,4434,4470,4504,4536,4548,4566,4596,4640,4642,4696,4716,4778,4798,4822,4852,4898,4914,4944,4984,5008,5048,5058,5056,5110,5122,5154,5186,5210,5242,5310,5352,5376,5370,5438,5450,5488,5490,5516,5550,5582,5584,5624,5656,5672,5714,5722,5766,5776,5826,5904
0.02,0.02,0.06,0.02,0.08,0,0.06,0,0,0.08,0.04,0.06,0,0.08,0.08,0,0,0.08,0.08,0,0,0,0.1,0.06,0.08,0.08,0.02,0.1,0.16,0.06,0.04,0.12,0.12,0.1,0.14,0.1,0.1,0,0,0.6,0.2,0.2,0.8,0.2,0.4,0,0,0.8,0.4,0.4,1,0.2,0.6,0.6,1.2,0,1,0.8,0.8,0.8,0.2,1,1,0.6,1,1.6,2.4,1.2,1.6,1.4,1.4,2.4,2.4,1.2,0.8,2.8,1.8,1.2,2.4,1.2,2.8,3.2,2.2,2.2,2.6,2.4,2,1,2.4,2,2,4,8,4,0,4,0,0,6,0,0,4,4,6,8,12,10,0,10,0,4,4,8,4,6,0,8,2,8,0,6,2,4,2,8,10,6,6,2,8,6,10,6,14,2,8,8,4,2,0,8,8,4,4,2,8,10,12,2,8,8,6,6,14,10,8,6,10,6,14,6,10,12,14,10,6,4,6,10,10,12,10,4,6,6,6,4,4,10,8,8,10,8,12,10,12,16,10,10,8,8,10,8,4,6,2,10,10,6,2,2,4,8,2,8,2,6,10,6,4,2,14,14,10,8,4,14,12,22,8,8,2,6,16,6,12,12,12,4,0,8,16,4,10,8,0,28,4,0,12,0,2,0,4,0,8,6,6,4,8,6,8,4,4,4,16
0.08,0.08,0.04,0.08,0.02,0,0.04,0,0,0.02,0.06,0.04,0,0.02,0.02,0,0,0.02,0.02,0,0,0,0.1,0.04,0.02,0.12,0.08,0.1,0.14,0.14,0.06,0.08,0.08,0.1,0.06,0.1,0.1,0,0,0.4,0.8,0.8,0.2,0.8,0.6,0,0,0.2,0.6,0.6,1,0.8,0.4,0.4,0.8,0,1,0.2,0.2,0.2,0.8,1,2,0.4,1,3.4,2.6,1.8,2.4,2.6,2.6,1.6,1.6,2.8,0.2,3.2,2.2,1.8,1.6,0.8,2.2,1.8,2.8,1.8,2.4,3.6,2,1,3.6,2,3,6,2,6,0,6,0,0,14,0,0,6,6,4,12,8,10,0,10,0,6,6,2,6,4,0,2,8,12,0,4,8,6,8,2,10,4,4,8,2,4,10,4,6,8,2,2,6,8,0,2,2,6,6,8,12,20,8,8,12,22,4,14,6,10,12,14,10,14,16,14,10,8,16,10,14,16,14,20,10,8,10,6,4,14,14,16,16,10,12,12,10,12,18,10,18,14,10,20,2,12,10,12,6,14,8,10,10,4,8,8,6,12,8,2,8,4,10,4,6,8,6,6,10,12,6,16,8,18,22,2,8,4,14,4,8,8,8,6,0,2,14,6,10,2,0,12,6,0,8,0,8,0,6,0,2,4,4,6,2,4,2,6,6,6,14
1 0 0.0039216 0.0078431 0.011765 0.015686 0.019608 0.023529 0.027451 0.031373 0.035294 0.039216 0.043137 0.047059 0.05098 0.054902 0.058824 0.062745 0.066667 0.070588 0.07451 0.078431 0.082353 0.086275 0.090196 0.094118 0.098039 0.10196 0.10588 0.1098 0.11373 0.11765 0.12157 0.12549 0.12941 0.13333 0.13725 0.14118 0.1451 0.14902 0.15294 0.15686 0.16078 0.16471 0.16863 0.17255 0.17647 0.18039 0.18431 0.18824 0.19216 0.19608 0.2 0.20392 0.20784 0.21176 0.21569 0.21961 0.22353 0.22745 0.23137 0.23529 0.23922 0.24314 0.24706 0.25098 0.2549 0.25882 0.26275 0.26667 0.27059 0.27451 0.27843 0.28235 0.28627 0.2902 0.29412 0.29804 0.30196 0.30588 0.3098 0.31373 0.31765 0.32157 0.32549 0.32941 0.33333 0.33725 0.34118 0.3451 0.34902 0.35294 0.35686 0.36078 0.36471 0.36863 0.37255 0.37647 0.38039 0.38431 0.38824 0.39216 0.39608 0.4 0.40392 0.40784 0.41176 0.41569 0.41961 0.42353 0.42745 0.43137 0.43529 0.43922 0.44314 0.44706 0.45098 0.4549 0.45882 0.46275 0.46667 0.47059 0.47451 0.47843 0.48235 0.48627 0.4902 0.49412 0.49804 0.50196 0.50588 0.5098 0.51373 0.51765 0.52157 0.52549 0.52941 0.53333 0.53725 0.54118 0.5451 0.54902 0.55294 0.55686 0.56078 0.56471 0.56863 0.57255 0.57647 0.58039 0.58431 0.58824 0.59216 0.59608 0.6 0.60392 0.60784 0.61176 0.61569 0.61961 0.62353 0.62745 0.63137 0.63529 0.63922 0.64314 0.64706 0.65098 0.6549 0.65882 0.66275 0.66667 0.67059 0.67451 0.67843 0.68235 0.68627 0.6902 0.69412 0.69804 0.70196 0.70588 0.7098 0.71373 0.71765 0.72157 0.72549 0.72941 0.73333 0.73725 0.74118 0.7451 0.74902 0.75294 0.75686 0.76078 0.76471 0.76863 0.77255 0.77647 0.78039 0.78431 0.78824 0.79216 0.79608 0.8 0.80392 0.80784 0.81176 0.81569 0.81961 0.82353 0.82745 0.83137 0.83529 0.83922 0.84314 0.84706 0.85098 0.8549 0.85882 0.86275 0.86667 0.87059 0.87451 0.87843 0.88235 0.88627 0.8902 0.89412 0.89804 0.90196 0.90588 0.9098 0.91373 0.91765 0.92157 0.92549 0.92941 0.93333 0.93725 0.94118 0.9451 0.94902 0.95294 0.95686 0.96078 0.96471 0.96863 0.97255 0.97647 0.98039 0.98431 0.98824 0.99216 0.99608 1
2 2.48 2.58 2.74 2.88 3.12 3.5 3.94 4.5 5.2 5.92 6.86 7.84 9.1 10.42 11.82 13.6 15.3 17.42 19.42 21.5 23.8 26.4 29.3 32.44 35.72 39.42 42.88 46.1 50.34 55.14 60.16 65.38 71.18 77.6 82.96 90 97.1 105 112 120.4 129.8 138.8 147.2 159.8 169.6 181 191 202.2 215.6 227.6 239 249.8 261.4 275.4 286.8 301 315 330.2 346.2 362.2 376.8 393 408 424.4 441 456.4 473.6 491.8 509.4 528.6 545.6 561.6 583.6 604.8 625.2 641.2 662.2 682.8 703.6 725.8 749.2 771.8 794.8 818.8 844.4 866.6 892 918 943.6 966 993 1016 1042 1076 1100 1126 1140 1170 1194 1210 1240 1266 1286 1304 1332 1358 1380 1410 1440 1470 1486 1526 1542 1566 1584 1620 1642 1668 1702 1720 1744 1768 1786 1818 1842 1870 1894 1914 1958 1982 2004 2040 2064 2086 2118 2132 2162 2196 2228 2230 2282 2292 2336 2346 2378 2412 2440 2458 2488 2512 2552 2584 2614 2646 2680 2702 2744 2770 2804 2836 2874 2920 2958 2986 3020 3054 3086 3134 3170 3190 3208 3270 3306 3344 3384 3404 3446 3486 3510 3562 3582 3620 3652 3688 3730 3788 3794 3830 3880 3902 3922 3940 4012 4036 4084 4108 4140 4170 4194 4228 4278 4286 4312 4348 4372 4398 4434 4470 4504 4536 4548 4566 4596 4640 4642 4696 4716 4778 4798 4822 4852 4898 4914 4944 4984 5008 5048 5058 5056 5110 5122 5154 5186 5210 5242 5310 5352 5376 5370 5438 5450 5488 5490 5516 5550 5582 5584 5624 5656 5672 5714 5722 5766 5776 5826 5904
3 0.02 0.02 0.06 0.02 0.08 0 0.06 0 0 0.08 0.04 0.06 0 0.08 0.08 0 0 0.08 0.08 0 0 0 0.1 0.06 0.08 0.08 0.02 0.1 0.16 0.06 0.04 0.12 0.12 0.1 0.14 0.1 0.1 0 0 0.6 0.2 0.2 0.8 0.2 0.4 0 0 0.8 0.4 0.4 1 0.2 0.6 0.6 1.2 0 1 0.8 0.8 0.8 0.2 1 1 0.6 1 1.6 2.4 1.2 1.6 1.4 1.4 2.4 2.4 1.2 0.8 2.8 1.8 1.2 2.4 1.2 2.8 3.2 2.2 2.2 2.6 2.4 2 1 2.4 2 2 4 8 4 0 4 0 0 6 0 0 4 4 6 8 12 10 0 10 0 4 4 8 4 6 0 8 2 8 0 6 2 4 2 8 10 6 6 2 8 6 10 6 14 2 8 8 4 2 0 8 8 4 4 2 8 10 12 2 8 8 6 6 14 10 8 6 10 6 14 6 10 12 14 10 6 4 6 10 10 12 10 4 6 6 6 4 4 10 8 8 10 8 12 10 12 16 10 10 8 8 10 8 4 6 2 10 10 6 2 2 4 8 2 8 2 6 10 6 4 2 14 14 10 8 4 14 12 22 8 8 2 6 16 6 12 12 12 4 0 8 16 4 10 8 0 28 4 0 12 0 2 0 4 0 8 6 6 4 8 6 8 4 4 4 16
4 0.08 0.08 0.04 0.08 0.02 0 0.04 0 0 0.02 0.06 0.04 0 0.02 0.02 0 0 0.02 0.02 0 0 0 0.1 0.04 0.02 0.12 0.08 0.1 0.14 0.14 0.06 0.08 0.08 0.1 0.06 0.1 0.1 0 0 0.4 0.8 0.8 0.2 0.8 0.6 0 0 0.2 0.6 0.6 1 0.8 0.4 0.4 0.8 0 1 0.2 0.2 0.2 0.8 1 2 0.4 1 3.4 2.6 1.8 2.4 2.6 2.6 1.6 1.6 2.8 0.2 3.2 2.2 1.8 1.6 0.8 2.2 1.8 2.8 1.8 2.4 3.6 2 1 3.6 2 3 6 2 6 0 6 0 0 14 0 0 6 6 4 12 8 10 0 10 0 6 6 2 6 4 0 2 8 12 0 4 8 6 8 2 10 4 4 8 2 4 10 4 6 8 2 2 6 8 0 2 2 6 6 8 12 20 8 8 12 22 4 14 6 10 12 14 10 14 16 14 10 8 16 10 14 16 14 20 10 8 10 6 4 14 14 16 16 10 12 12 10 12 18 10 18 14 10 20 2 12 10 12 6 14 8 10 10 4 8 8 6 12 8 2 8 4 10 4 6 8 6 6 10 12 6 16 8 18 22 2 8 4 14 4 8 8 8 6 0 2 14 6 10 2 0 12 6 0 8 0 8 0 6 0 2 4 4 6 2 4 2 6 6 6 14

@ -1 +0,0 @@
0.07,0.04,0.08,0.03,0.03,0.09,0.09,0.01,0.08,0.14,0.11,0.12,0.11,0.22,0.23,0.22,0.11,0.12,0,0.8,0,0.8,0.3,0.1,0.2,0.5,0.8,0.7,1.2,0.5,0.4,1.8,2,1,2.6,1.8,1.2,2.7,1.9,2,2.7,1.2,2.6,3.2,4,3.1,6,0,0,5,10,12,13,16,15,16,26,26,15,22,4,17,26,23,30,28,38,10,33,23,31,14,15,18,18,30,16,25,19,36,35,15,33,31,40,21,33,21,17,27,32,24,30,25,17,35,24,27,26,20,25,20,20,16,23,56,20,12,24,42,16,46,19,17,11,22,24,7,20,18,33,5,18,9,37,22,40,90,0,10,0,90,230,70,290,380,130,110,140,250,280,310,730,1060,710,320,1400,910,1240,860,1520,1500,950,890,1090,1180,870,1530,630,1140,690,1720,1390,1320,1190,1260,740,1330,1540,1320,2210,1330,1140,2010,1700,1910,1920,1980,1110,2030,1870,2370,1430,1720,2240,1950,1570,1840,1300,1740,2100,1420,1490,830,1830,1120,480,1580,1010,1010,1610,1510,1210,1470,1490,1830,1760,1430,1380,980,1340,1090,1950,1680,2080,1940,690,1750,1820,1140,1030,1090,690,1250,1560,1680,1910,2040,1890,1950,760,800,670,520,570,690,590,540,1080,450,870,500,840,1360,1000,850,640,650,740,520,860,490,770,860,810,950
1 0.07 0.04 0.08 0.03 0.03 0.09 0.09 0.01 0.08 0.14 0.11 0.12 0.11 0.22 0.23 0.22 0.11 0.12 0 0.8 0 0.8 0.3 0.1 0.2 0.5 0.8 0.7 1.2 0.5 0.4 1.8 2 1 2.6 1.8 1.2 2.7 1.9 2 2.7 1.2 2.6 3.2 4 3.1 6 0 0 5 10 12 13 16 15 16 26 26 15 22 4 17 26 23 30 28 38 10 33 23 31 14 15 18 18 30 16 25 19 36 35 15 33 31 40 21 33 21 17 27 32 24 30 25 17 35 24 27 26 20 25 20 20 16 23 56 20 12 24 42 16 46 19 17 11 22 24 7 20 18 33 5 18 9 37 22 40 90 0 10 0 90 230 70 290 380 130 110 140 250 280 310 730 1060 710 320 1400 910 1240 860 1520 1500 950 890 1090 1180 870 1530 630 1140 690 1720 1390 1320 1190 1260 740 1330 1540 1320 2210 1330 1140 2010 1700 1910 1920 1980 1110 2030 1870 2370 1430 1720 2240 1950 1570 1840 1300 1740 2100 1420 1490 830 1830 1120 480 1580 1010 1010 1610 1510 1210 1470 1490 1830 1760 1430 1380 980 1340 1090 1950 1680 2080 1940 690 1750 1820 1140 1030 1090 690 1250 1560 1680 1910 2040 1890 1950 760 800 670 520 570 690 590 540 1080 450 870 500 840 1360 1000 850 640 650 740 520 860 490 770 860 810 950

@ -1 +0,0 @@
0.13,0.06,0.02,0.07,0.07,0.01,0.01,0.09,0.12,0.06,0.09,0.18,0.29,0.18,0.17,0.18,0.09,0.08,0,0.2,0,0.2,0.7,0.9,0.8,0.5,0.2,0.3,0.8,0.5,0.6,1.2,2,1,1.4,1.2,1.8,2.3,3.1,3,2.3,2.8,2.4,2.8,5,2.9,4,0,0,5,10,18,7,4,5,4,4,4,15,8,6,13,14,7,10,12,22,10,27,17,19,16,15,12,12,10,14,15,21,14,15,15,37,29,30,19,17,29,23,23,28,26,20,25,23,25,16,23,24,20,15,10,20,24,27,24,20,18,26,28,14,34,31,23,29,18,26,33,20,32,17,15,32,21,33,28,40,10,0,90,0,810,670,30,710,720,770,190,860,850,720,190,770,840,690,180,600,990,960,1340,1280,900,1750,810,1210,920,830,1070,670,1260,910,1480,2010,2080,1410,940,1260,1470,1360,1280,1590,2070,1760,2190,1800,1190,1680,2020,2590,2070,2030,1430,2370,1980,2160,2250,1930,2360,1800,2560,2100,2880,2910,1370,2270,1680,620,2220,2290,2190,2190,3490,3690,1830,1310,2770,2640,1070,1220,1520,1060,1410,2650,820,720,1260,1010,650,980,1360,1970,1610,510,1550,1140,1020,1090,1160,610,750,240,500,630,980,530,610,510,560,920,550,930,1000,660,640,500,450,660,650,460,480,540,210,530,540,490,550
1 0.13 0.06 0.02 0.07 0.07 0.01 0.01 0.09 0.12 0.06 0.09 0.18 0.29 0.18 0.17 0.18 0.09 0.08 0 0.2 0 0.2 0.7 0.9 0.8 0.5 0.2 0.3 0.8 0.5 0.6 1.2 2 1 1.4 1.2 1.8 2.3 3.1 3 2.3 2.8 2.4 2.8 5 2.9 4 0 0 5 10 18 7 4 5 4 4 4 15 8 6 13 14 7 10 12 22 10 27 17 19 16 15 12 12 10 14 15 21 14 15 15 37 29 30 19 17 29 23 23 28 26 20 25 23 25 16 23 24 20 15 10 20 24 27 24 20 18 26 28 14 34 31 23 29 18 26 33 20 32 17 15 32 21 33 28 40 10 0 90 0 810 670 30 710 720 770 190 860 850 720 190 770 840 690 180 600 990 960 1340 1280 900 1750 810 1210 920 830 1070 670 1260 910 1480 2010 2080 1410 940 1260 1470 1360 1280 1590 2070 1760 2190 1800 1190 1680 2020 2590 2070 2030 1430 2370 1980 2160 2250 1930 2360 1800 2560 2100 2880 2910 1370 2270 1680 620 2220 2290 2190 2190 3490 3690 1830 1310 2770 2640 1070 1220 1520 1060 1410 2650 820 720 1260 1010 650 980 1360 1970 1610 510 1550 1140 1020 1090 1160 610 750 240 500 630 980 530 610 510 560 920 550 930 1000 660 640 500 450 660 650 460 480 540 210 530 540 490 550

@ -1,83 +0,0 @@
interStimuliColor_sRGB = [0 0 0];
screenSizePix2 = zeros(1,2);
screenSizePix1 = zeros(1,2);
!..\C7000_Controller\netcoreapp3.1\C7000_Test &
tcpObj = tcp_Server_Start(); %Wait here until the client connects
%Screen('Preference', 'ScreenToHead', 0, 1, 1);
Screen('Preference', 'SkipSyncTests', 1);
realIntensity_avr = []; %Real luminances we are getting
realIntensity_max = [];
realIntensity_min = [];
num_measures = 10; %Number of measures will be made in each cycle of the calibration
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', 2);
[screenSizePix1(1) screenSizePix1(2)] = Screen('WindowSize', 1);
wPtr = Screen('OpenWindow', 2, interStimuliColor_sRGB, [screenSizePix1(1) 1 screenSizePix1(1)+screenSizePix2(1) screenSizePix2(2)]);
Screen('FillRect', wPtr, interStimuliColor_sRGB);
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', wPtr);
calIntensity = [0:255]; %1 step for each rgb value [0 0 0], [1 1 1], ..., [255, 255, 255]
stimImg = zeros(screenSizePix2(2), screenSizePix2(1), 3);
for intensity = calIntensity
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);
[average_lx, max_lx, min_lx] = C7000_Read(num_measures, tcpObj); %Perform n measures and returun the usefull values
realIntensity_avr = [realIntensity_avr, average_lx];
realIntensity_max = [realIntensity_max, max_lx-average_lx];
realIntensity_min = [realIntensity_min, average_lx-min_lx];
stimImg = stimImg + 1/255;
end
%Present the data measured
errorbar(calIntensity, realIntensity_avr, realIntensity_min, realIntensity_max, '-o');
%Program clossing
sca;
C7000_End_program(tcpObj); %Return the C-7000 to its manual control
fclose(tcpObj); %Close the server
%clear all
%Alarm to indicate the program has finished
load handel
sound(y,Fs)
%C-7000 controller Functions
%START HERE
function tcpObj = tcp_Server_Start()
%Opens a TCP/IP server and waits until a client connects to it
port = 30000;
tcpObj = tcpip('0.0.0.0', port, 'NetworkRole', 'Server')
tcpObj.ByteOrder = 'littleEndian';
tcpObj.Timeout = 9999; %Must be a big number
fopen(tcpObj); %Wait until the client connects
end
function [average_lx, max_lx, min_lx] = C7000_Read(n, tcpObj)
%Ask the C-7000 to make n measures and returns average, max and min lux
%of all the measures
fwrite(tcpObj, int16(n), 'int16');
average_lx = fread(tcpObj, 1, 'double');
max_lx = fread(tcpObj, 1, 'double');
min_lx = fread(tcpObj, 1, 'double');
end
function C7000_End_program(tcpObj)
fwrite(tcpObj, int16(-1), 'int16'); %Ask the C-7000 to finish the program
end
%END HERE

@ -1,55 +0,0 @@
num_measures = 5; %Num of measures to be made each time
num_tests = 10; %Times measures will be taken
average_lx = []
max_lx = []
min_lx = []
x = []
tcpObj = tcp_Server_Start(); %Wait here until the client connects
for num_tests = 1:num_tests
[average, max, min] = C7000_Read(num_measures, tcpObj); %Perform n measures and returun the usefull values
%Plot:
average_lx = [average_lx, average];
max_lx = [max_lx, max-average];
min_lx = [min_lx, average-min];
x = [x, num_tests];
h = errorbar(x, average_lx, min_lx, max_lx, '-o');
refreshdata(h,'caller')
drawnow
end
C7000_End_program(tcpObj); %Return the C-7000 to its manual control
fclose(tcpObj); %Close the server
function tcpObj = tcp_Server_Start()
%Opens a TCP/IP server and waits until a client connects to it
port = 30000;
tcpObj = tcpip('0.0.0.0', port, 'NetworkRole', 'Server')
tcpObj.ByteOrder = 'littleEndian';
tcpObj.Timeout = 9999;
fopen(tcpObj); %Wait until the client connects
end
function [average_lx, max_lx, min_lx] = C7000_Read(n, tcpObj)
%Ask the C-7000 to make n measures and returns average, max and min lux
%of all the measures
fwrite(tcpObj, int16(n), 'int16');
average_lx = fread(tcpObj, 1, 'double');
max_lx = fread(tcpObj, 1, 'double');
min_lx = fread(tcpObj, 1, 'double');
end
function C7000_End_program(tcpObj)
fwrite(tcpObj, int16(-1), 'int16'); %Ask the C-7000 to finish the program
end

@ -1,4 +1,4 @@
function [threshold, history, responsesStaircase, reactionTimes] = VisualThresholds_v0()
function [threshold, history, responsesStaircase, reactionTimes] = VisualThresholdsExperiment()
% Calculate discomfort thresholds from visual stimuli. A light with a mean
% intensity = meanIntensity will be presented during duration (in secs)
% and repeated = number of repetitions. The participant would response
@ -10,15 +10,15 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
screenSizeCm = [50 30]; % width and height in cm
% Experiment parameters
minIntensity = 0.1;
maxIntensity = 0.9;
initIntensity = 0.3;
stepSizeIntensity = 0.02;
minIntensity = 0; %lx
maxIntensity = 30000; %lx
initIntensity = 2000;
stepSizeIntensity = 1000; %lux
interStimuliColor_sRGB = [0 0 0];
stimulusDuration = 2;
interStimuliInterval = 3;
intraStimuliInterval = 2;
stimulusDuration = 0.2;
interStimuliInterval = 0;
intraStimuliInterval = 0;
repetitions = 1;
responseDuration = 1; % in secs
@ -28,7 +28,15 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
fixationColor_sRGB = [0.5 0.5 0.5];
enableCorrections = 1;
%Import calibration curve
imported_data = csvread('Visual_Calibration_curve.csv');
inputGeneratorValue = imported_data(1,:);
realIntensity_avr_cal = imported_data(2,:);
realIntensity_max_cal = imported_data(3,:);
realIntensity_min_cal = imported_data(4,:);
clear imported_data
% Establish key mapping: ESCape aborts, Space toggles between auto-
% movement of sound source or user mouse controlled movement:
KbName('UnifyKeynames');
@ -70,7 +78,7 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
fixationSizePix = round(fixationSizeDeg*pixelsPerDegree(1)); % in pixels
buttonsSeparationPix = round(buttonsSeparationDeg*pixelsPerDegree(1)); % in pixels
% Generate the stimulus presented during the intrastimuli interval
blankImg = zeros(screenSizePix(2), screenSizePix(1), length(interStimuliColor_sRGB));
for i = 1:length(interStimuliColor_sRGB)
@ -90,7 +98,11 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
nReversalTrials = 4;
nMaxTrials = 300;
[nextValue, isFinished, finalValue, methodState] = psychMethodSIAM(possibleValues,initValue,stepSize,trialStepSize,nReversals,nReversalTrials,nMaxTrials);
% Show instructions
wPtr = DrawInstructionsPage(testMode);
KbWait;
% To test the script
if testMode
warning('Test mode is activated');
@ -104,9 +116,11 @@ function [threshold, history, responsesStaircase, reactionTimes] = VisualThresho
trial = 1;
while ~isFinished
% Create stimulus to be presented
stimImg = GenerateNoisyImage([screenSizePix(2) screenSizePix(1)], nextValue, 0.1);
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
whenStimulus = tFixation + interStimuliInterval;
stimImg = GenerateCalibratedImage(nextValue, realIntensity_avr_cal, inputGeneratorValue);
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);
whenStimulus = tFixation + interStimuliInterval;
% Set randmonly the key that corresponds to discomfort and
% non-discomfort, respective
@ -373,7 +387,6 @@ function img = DrawFixationPointInImage(img, fixationSizePix, fixation_sRGB)
img(imgCenter(1)-lineWidthPix/2:imgCenter(1)+lineWidthPix/2,imgCenter(2)-fixCrossDimPix:imgCenter(2)+fixCrossDimPix,2) = fixation_sRGB(2);
img(imgCenter(1)-lineWidthPix/2:imgCenter(1)+lineWidthPix/2,imgCenter(2)-fixCrossDimPix:imgCenter(2)+fixCrossDimPix,3) = fixation_sRGB(3);
function [wPtr, tFixation] = DrawFixationPoint(wPtr, fixationSizePix, fixation_sRGB, showButtons, buttonsOrder, buttonsSeparationPix, background_sRGB, whenFixation, tFlip, testMode)
if exist('wPtr','var')==0 || isempty(wPtr)
@ -472,4 +485,175 @@ function [wPtr, tFixation] = DrawFixationPoint(wPtr, fixationSizePix, fixation_s
end
% Flip to the screen
tFixation = Screen('Flip', wPtr, whenFixation-tFlip);
tFixation = Screen('Flip', wPtr, whenFixation-tFlip);
function stimImg = GenerateCalibratedImage(desired_lux, realIntensity_avr_cal, inputGeneratorValue)
%Creates an image of $desired_lux [lx] based on the calibration curve
screenSizePix2 = zeros(1,2);
screenSizePix1 = zeros(1,2);
screenNumber = max(Screen('Screens')); %0: single display setting
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', screenNumber);
[screenSizePix1(1) screenSizePix1(2)] = Screen('WindowSize', 1); %Principal monitor size
lux_values = abs(realIntensity_avr_cal - desired_lux); %Set $desired_lux as the 0 point
[~,Index1] = min(lux_values(:)); %Find the location of the closest point
%to 0. Because it is the closest point (in
%the calibration curve) to the
%desired_lux value.
lux_values(Index1) = NaN; %"Remove" the lowest value from the array
[~,Index2] = min(lux_values(:)); %Find the index of the second lowest value
%{
%First order interpolation (y = ax+b)
if Index2 > Index1
a = (inputGeneratorValue(Index2)-inputGeneratorValue(Index1))/(realIntensity_avr_cal(Index2)-realIntensity_avr_cal(Index1));
b = inputGeneratorValue(Index2) -(a*realIntensity_avr_cal(Index2));
if isnan(a)
a = (inputGeneratorValue(Index2)-inputGeneratorValue(Index1-1))/(realIntensity_avr_cal(Index2)-realIntensity_avr_cal(Index1-1));
end
else
a = (inputGeneratorValue(Index1)-inputGeneratorValue(Index2))/(realIntensity_avr_cal(Index1)-realIntensity_avr_cal(Index2));
b = inputGeneratorValue(Index2) -(a*realIntensity_avr_cal(Index2));
if isnan(a)
a = (inputGeneratorValue(Index1)-inputGeneratorValue(Index2-1))/(realIntensity_avr_cal(Index1)-realIntensity_avr_cal(Index2-1));
b = inputGeneratorValue(Index2-1) -(a*realIntensity_avr_cal(Index2-1));
end
end
%}
%Zero order interpollation
inputIntensity = inputGeneratorValue(Index1);
if isnan(inputIntensity)
inputIntensity = 0;
elseif inputIntensity > 1
inputIntensity = 1;
elseif inputIntensity < 0
inputIntensity = 0;
end
stimImg = GenerateNoisyImage([screenSizePix2(2) screenSizePix2(1)], inputIntensity, 0);
inputIntensity = 0;
function ShowStimuli(stimImg, wPtr)
%Presents image (stimImg) to the second screen)
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);
function wPtr = DrawInstructionsPage(testMode)
% Open window with a fixation point
screenColor = [128 128 128];
screenFreq = 60; %120;%120;%In Hz (desired freq) %60 for testing purposes
screenFreqTolerance = 5;
screenNumber = max(Screen('Screens')); %0: single display setting
screenNumber = 2;
screenSize = zeros(1,2);
[screenSize(1), screenSize(2)] = Screen('WindowSize', screenNumber);
if testMode
PsychDebugWindowConfiguration(0, 0.25)
% wPtr = Screen('OpenWindow', screenNumber, screenColor, [1 1 screenSize(1) screenSize(2)*0.25]);
wPtr = Screen('OpenWindow',screenNumber,screenColor);
else
clear Screen;
Screen('Preference', 'ConserveVRAM', 4096);
Screen('Preference', 'SkipSyncTests', 1 );
wPtr = Screen('OpenWindow',screenNumber,screenColor);
end
% Get timing information from screen
screenRefreshRate = Screen('GetFlipInterval', wPtr);
disp(['Screen rate: ' num2str(screenRefreshRate)]);
ScreenFreqDiscrepancy = screenFreq - 1/screenRefreshRate;
Screen('FillRect', wPtr, screenColor);
% Check the monitor's configuration
if ~testMode
if (ScreenFreqDiscrepancy < screenFreqTolerance)
disp('Refresh rate is the desired one');
else
disp(['Refresh frequency should be ' screenFreq]);
error('Screen was not propperly configured');
end
end
% Set font style in window
tfont='Arial';
tsize=15;
tstyle=1; %1=normal 2=bold 3=italic 4=underline
vSpacing = 3;
Screen('TextFont', wPtr, tfont);
Screen('TextSize', wPtr, tsize);
Screen('TextStyle', wPtr, tstyle);
% Get coordinates in the window
windowSize = zeros(1,2);
[windowSize(1), windowSize(2)] = Screen('WindowSize', wPtr);
windowCenter = zeros(1,2);
windowCenter(1) = floor(windowSize(1)/2);
windowCenter(2) = floor(windowSize(2)/2);
screenNumber = Screen('WindowScreenNumber', wPtr);
% Define black and white
white = WhiteIndex(screenNumber);
black = BlackIndex(screenNumber);
strInstructions = 'En este experimento se le presentará un estímulo visual y debe indicar si le causa molestia o no. En caso que le cause molestia, debe pulsar la tecla que se indica como "Molesto", en caso contrario, debe pulsar la tecla "NO Molesto". Debe indicar su respuesta lo más rápido posible cuando aparezca la cruz en el centro de la pantalla (indicará que el estímulo ha terminado de ser presentado). La respuesta de la derecha corresponde a la tecla "F" y la de la izquierda a la tecla "A".';
strInstructions2 = 'Pulse la barra espaciadora para continuar';
DrawFormattedText(wPtr,strInstructions,'center',windowSize(2)*0.25,black, 80, 0, 0, vSpacing);
DrawFormattedText(wPtr,strInstructions2,'center',windowSize(2)*0.66,black, 80, 0, 0, vSpacing);
% Flip to the screen
Screen('Flip', wPtr);
%C-7000 controller Functions
%START HERE
function tcpObj = tcp_Server_Start()
%Opens a TCP/IP server and waits until a client connects to it
port = 30000;
tcpObj = tcpip('0.0.0.0', port, 'NetworkRole', 'Server')
tcpObj.ByteOrder = 'littleEndian';
tcpObj.Timeout = 9999;
fopen(tcpObj); %Wait until the client connects
function [average_lx, max_lx, min_lx] = C7000_Read(n, tcpObj)
%Ask the C-7000 to make n measures and returns average, max and min lux
%of all the measures
fwrite(tcpObj, int16(n), 'int16');
average_lx = fread(tcpObj, 1, 'double');
max_lx = fread(tcpObj, 1, 'double');
min_lx = fread(tcpObj, 1, 'double');
function [X_1nm, Y_1nm, X_5nm, Y_5nm] = C7000_GetSpectrum(tcpObj)
%Ask the C-7000 to send the spectrum of the last measure made
%This functuion does not take any new measures of the light, just sends
%more data to Matlab
fwrite(tcpObj, int16(-2), 'int16');
Y_1nm = fread(tcpObj, 400, 'single');
Y_5nm = fread(tcpObj, 80, 'single');
Y_1nm = transpose(Y_1nm);
Y_5nm = transpose(Y_5nm);
X_1nm = [380:1:779];
X_5nm = [380:5:775];
function C7000_End_program(tcpObj)
fwrite(tcpObj, int16(-1), 'int16'); %Ask the C-7000 to finish the program
%END HERE

@ -2,12 +2,12 @@ X_1nm = [];
Y_1nm = [];
X_5nm = [];
Y_5nm = [];
interStimuliColor_sRGB = [0 0 0];
StimuliColor_RGB = [1 0 0];
screenSizePix2 = zeros(1,2);
screenSizePix1 = zeros(1,2);
%Call the C7000 controller (TCP client)
%!..\C7000_Controller\netcoreapp3.1\C7000_Test &
!..\C7000_Controller\netcoreapp3.1\C7000_Test &
%Start the TCP server
tcpObj = tcp_Server_Start(); %Wait here until the client connects
@ -19,14 +19,14 @@ screenNumber = max(Screen('Screens')); %0: single display setting
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', screenNumber);
[screenSizePix1(1) screenSizePix1(2)] = Screen('WindowSize', 1); %Principal monitor size
wPtr = Screen('OpenWindow', screenNumber, interStimuliColor_sRGB, [screenSizePix1(1) 1 screenSizePix1(1)+screenSizePix2(1) screenSizePix2(2)]);
Screen('FillRect', wPtr, interStimuliColor_sRGB);
wPtr = Screen('OpenWindow', screenNumber, StimuliColor_RGB, [screenSizePix1(1) 1 screenSizePix1(1)+screenSizePix2(1) screenSizePix2(2)]);
Screen('FillRect', wPtr, StimuliColor_RGB);
[screenSizePix2(1) screenSizePix2(2)] = Screen('WindowSize', wPtr);
%Present new image
stimImg = GenerateNoisyImage([screenSizePix2(2) screenSizePix2(1)], 1, 0); %Create the visual stimuli
stimImg = GenerateNoisyImage([screenSizePix2(2) screenSizePix2(1)], 1, 0, StimuliColor_RGB); %Create the visual stimuli
stimTextureId = Screen('MakeTexture', wPtr, uint8(stimImg.*255));
Screen('DrawTexture', wPtr, stimTextureId);
Screen('Flip', wPtr);

@ -53,7 +53,7 @@ fclose(tcpObj); %Close the server
%Data save
export_me = [calIntensity; realIntensity_avr; realIntensity_max; realIntensity_min];
csvwrite('Calibration_curve.csv', export_me)
csvwrite('Visual_Calibration_curve.csv', export_me)

@ -1,4 +1,4 @@
imported_data = csvread('Calibration_curve.csv');
imported_data = csvread('Visual_Calibration_curve.csv');
inputGeneratorValue = imported_data(1,:);
realIntensity_avr_cal = imported_data(2,:);
realIntensity_max_cal = imported_data(3,:);

@ -1,15 +0,0 @@
windowPtr=Screen('OpenWindow', 0, [], [100 100 1000 1000])
% Setting the text size
Screen('TextSize', windowPtr, 25);
% Setting the font
Screen('TextFont', windowPtr, 'Helvetica');
% Setting the style (underlined)
Screen('TextStyle', windowPtr, 4);
% Setting the text, location (x,y coordinates) and color
Screen('DrawText', windowPtr, 'hey there', 300, 300,[255 0 0])
% Showing the result on the screen
Screen('Flip', windowPtr)
% Keeping the window for 2 seconds
WaitSecs(2)
% Closing the window
sca

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is thr