Time Averaged Moire Fringes
9 views (last 30 days)
Show older comments
How can I generate time averaged moire fringes?
0 Comments
Answers (1)
Sameer
on 11 Sep 2024
Edited: Sameer
on 11 Sep 2024
Hi Akanksha
From my understanding, you want to generate time-averaged "Moiré fringes" using MATLAB. This involves creating interference patterns by superimposing two sets of lines or gratings with a slight relative displacement or rotation.
Below is a MATLAB script that demonstrates how to achieve this:
% Parameters
num_lines = 100; % Number of lines in the grating
line_spacing = 5; % Spacing between lines
angle = 5; % Angle of rotation in degrees
image_size = 500; % Size of the image
% Create a base grating
[x, y] = meshgrid(1:image_size, 1:image_size);
base_grating = sin(2 * pi * (x / line_spacing));
% Create a rotated grating
theta = deg2rad(angle);
x_rot = x * cos(theta) + y * sin(theta);
y_rot = -x * sin(theta) + y * cos(theta);
rotated_grating = sin(2 * pi * (x_rot / line_spacing));
% Combine the gratings to create Moiré pattern
moire_pattern = base_grating + rotated_grating;
% Normalize and display the Moiré pattern
moire_pattern = (moire_pattern - min(moire_pattern(:))) / (max(moire_pattern(:)) - min(moire_pattern(:)));
imshow(moire_pattern, []);
title('Time-Averaged Moiré Fringes');
Hope this helps!
0 Comments
See Also
Categories
Find more on Encryption / Cryptography in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!