
How can I make a set of stimuli composed of pseudorandom dots of the same size and each stimuli having different spatial frequencies/densities?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I'd like to generate 50 stimuli composed of pseudorandom dots of the same size and each stimulus having different spatial frequencies/densities? I think I need to use stochastic screening based on my google searches but I don't know how to generate them. The picture attached is from wikipedia. I'd like to generate something similiar to the smaller squares where we can see how each is increasing in sptial frequency.
Thank you for your help!
Refernce: https://en.wikipedia.org/wiki/Stochastic_screening
0 Kommentare
Antworten (1)
chicken vector
am 19 Apr. 2023
Bearbeitet: chicken vector
am 19 Apr. 2023
This is slow and inefficient and can be improven with more pseudo-random techniques, but it does the tricks:
% Dots size:
dotSize = 5;
% Numbers density variations along 'x':
xSize = 1e3;
% Number of dots at first and last x:
minDots = 1;
maxDots = 1000;
% Dots interpolation:
nDots = linspace(minDots, maxDots, xSize);
% Initiliase figure:
figure;
hold on;
% loop over x coordinates:
for x = 1 : xSize
% Number of dots at current 'x':
numEl = round(nDots(x));
% Create 'x' noise:
noise = rand(numEl, 1) - .5;
% Plot dots at current 'x':
scatter(x + noise, rand(1,numEl), dotSize, 'k', 'Filled');
end
% Figure properties:
xlim([0, xSize])
ylim([0, 1])
set(gca, 'Color', 'w', 'XColor', 'None', 'YColor', 'None')
Result:

0 Kommentare
Siehe auch
Kategorien
Mehr zu Entering Commands finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!