File:Incoherent sum of speckles.webm

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Incoherent_sum_of_speckles.webm(WebM audio/video file, VP9, length 13 s, 480 × 534 pixels, 128 kbps overall, file size: 195 KB)

Captions

Captions

The speckle pattern produced by sources incoherent with each other sum without interfering.

Summary

[edit]
Description
English: Coherent light passing through a scattering medium is scrambled into a speckle pattern. But if there are multiple sources incoherent with each other, the resulting pattern will be the incoherent sum of the speckle patterns generated by each source.
Date
Source https://twitter.com/j_bertolotti/status/1553005005304696832
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929

Mathematica 13.0 code

[edit]
dim = 256;
texture = ExampleData[{"Texture", "Sand3"}];
color1[x_] := RGBColor[0.368417, 0.506779, 0.709798, x];
color2[x_] := RGBColor[0.922526, 0.385626, 0.209179, x];
speckle[] := 
  Abs[Fourier[
    RandomComplex[{-1 - I, 1 + I}, {dim, dim}]*
     GaussianMatrix[{dim/2, dim/30}][[1 ;; -2, 1 ;; -2]]]]^2;
tmp1 = speckle[]*
  GaussianMatrix[{dim/2, dim/4}][[1 ;; -2, 1 ;; -2]]; tmp1 = tmp1/
 Max[tmp1];
tmp2 = speckle[]*
  GaussianMatrix[{dim/2, dim/4}][[1 ;; -2, 1 ;; -2]]; tmp2 = tmp2/
 Max[tmp2];
tmp3 = speckle[]*
  GaussianMatrix[{dim/2, dim/4}][[1 ;; -2, 1 ;; -2]]; tmp3 = tmp3/
 Max[tmp3];
source1 = 
 RotateRight[
  GaussianMatrix[{dim/2, dim/40}][[1 ;; -2, 1 ;; -2]], {-50, 
   20}]; source1 = source1/Max[source1];
source2 = 
 RotateRight[
  GaussianMatrix[{dim/2, dim/40}][[1 ;; -2, 1 ;; -2]], {50, 
   80}]; source2 = source2/Max[source2];
source3 = 
 RotateRight[
  GaussianMatrix[{dim/2, dim/40}][[1 ;; -2, 
   1 ;; -2]], {20, -50}]; source3 = source3/Max[source3];

frames1 = Table[
   s = ArrayPlot[a*tmp1, DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   sourceplot = 
    ArrayPlot[a*source1, DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   Graphics3D[{
     Texture[texture], 
     Polygon[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
     Texture[sourceplot], 
     Polygon[{{-1.5, 5, -1.5}, {-1.5, 5, 1.5}, {1.5, 5, 1.5}, {1.5, 
        5, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     , Black, Thick, 
     Line[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}, {-1.5, 2, -1.5}}], 
     Texture[s], 
     Polygon[{{-1.5, -1, -1.5}, {-1.5, -1, 1.5}, {1.5, -1, 
        1.5}, {1.5, -1, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     }, PlotRange -> {{-2, 2}, {-1.5, 5}, {-2, 2}}, 
    ViewPoint -> {-1.3, - 2.4, 2.}, Boxed -> False, 
    Lighting -> "Neutral", Background -> White]
   , {a, 0, 1, 0.1}];

frames2 = Table[
   s = ArrayPlot[a*tmp2, DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   sourceplot = 
    ArrayPlot[a*source2, DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   Graphics3D[{
     Texture[texture], 
     Polygon[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
     Texture[sourceplot], 
     Polygon[{{-1.5, 5, -1.5}, {-1.5, 5, 1.5}, {1.5, 5, 1.5}, {1.5, 
        5, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     , Black, Thick, 
     Line[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}, {-1.5, 2, -1.5}}], 
     Texture[s], 
     Polygon[{{-1.5, -1, -1.5}, {-1.5, -1, 1.5}, {1.5, -1, 
        1.5}, {1.5, -1, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     }, PlotRange -> {{-2, 2}, {-1.5, 5}, {-2, 2}}, 
    ViewPoint -> {-1.3, - 2.4, 2.}, Boxed -> False, 
    Lighting -> "Neutral", Background -> White]
   , {a, 0, 1, 0.1}];

frames3 = Table[
   s = ArrayPlot[a*tmp3, DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   sourceplot = 
    ArrayPlot[a*source3, DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   Graphics3D[{
     Texture[texture], 
     Polygon[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
     Texture[sourceplot], 
     Polygon[{{-1.5, 5, -1.5}, {-1.5, 5, 1.5}, {1.5, 5, 1.5}, {1.5, 
        5, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     , Black, Thick, 
     Line[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}, {-1.5, 2, -1.5}}], 
     Texture[s], 
     Polygon[{{-1.5, -1, -1.5}, {-1.5, -1, 1.5}, {1.5, -1, 
        1.5}, {1.5, -1, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     }, PlotRange -> {{-2, 2}, {-1.5, 5}, {-2, 2}}, 
    ViewPoint -> {-1.3, - 2.4, 2.}, Boxed -> False, 
    Lighting -> "Neutral", Background -> White]
   , {a, 0, 1, 0.1}];

frames4 = Table[
   s = ArrayPlot[a*(tmp1 + tmp2 + tmp3), DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   sourceplot = 
    ArrayPlot[a*(source1 + source2 + source3), DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   Graphics3D[{
     Texture[texture], 
     Polygon[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
     Texture[sourceplot], 
     Polygon[{{-1.5, 5, -1.5}, {-1.5, 5, 1.5}, {1.5, 5, 1.5}, {1.5, 
        5, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     , Black, Thick, 
     Line[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}, {-1.5, 2, -1.5}}], 
     Texture[s], 
     Polygon[{{-1.5, -1, -1.5}, {-1.5, -1, 1.5}, {1.5, -1, 
        1.5}, {1.5, -1, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     }, PlotRange -> {{-2, 2}, {-1.5, 5}, {-2, 2}}, 
    ViewPoint -> {-1.3, - 2.4, 2.}, Boxed -> False, 
    Lighting -> "Neutral", Background -> White]
   , {a, 0, 1, 0.1}];

time1 = Sum[
   UnitStep[t - \[Tau]] E^(-0.5 (t - \[Tau])), {\[Tau], 
    Evaluate[
     Accumulate@RandomVariate[ExponentialDistribution[0.1], {20}]]}];
timeseries1 = Table[time1, {t, 1, 100, 1}];
time2 = Sum[
   UnitStep[t - \[Tau]] E^(-0.5 (t - \[Tau])), {\[Tau], 
    Evaluate[
     Accumulate@RandomVariate[ExponentialDistribution[0.1], {20}]]}];
timeseries2 = Table[time2, {t, 1, 100, 1}];
time3 = Sum[
   UnitStep[t - \[Tau]] E^(-0.5 (t - \[Tau])), {\[Tau], 
    Evaluate[
     Accumulate@RandomVariate[ExponentialDistribution[0.1], {20}]]}];
timeseries3 = Table[time3, {t, 1, 100, 1}];

frames5 = Table[
   s = ArrayPlot[(timeseries1[[t]]*tmp1 + timeseries2[[t]]*tmp2 + 
       timeseries3[[t]]*tmp3), DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   sourceplot = 
    ArrayPlot[(timeseries1[[t]]*source1 + timeseries2[[t]]*source2 + 
       timeseries3[[t]]*source3), DataReversed -> True, 
     ColorFunction -> "SunsetColors", ColorFunctionScaling -> False, 
     PlotRangePadding -> None];
   Graphics3D[{
     Texture[texture], 
     Polygon[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
     Texture[sourceplot], 
     Polygon[{{-1.5, 5, -1.5}, {-1.5, 5, 1.5}, {1.5, 5, 1.5}, {1.5, 
        5, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     , Black, Thick, 
     Line[{{-1.5, 2, -1.5}, {-1.5, 2, 1.5}, {1.5, 2, 1.5}, {1.5, 
        2, -1.5}, {-1.5, 2, -1.5}}], 
     Texture[s], 
     Polygon[{{-1.5, -1, -1.5}, {-1.5, -1, 1.5}, {1.5, -1, 
        1.5}, {1.5, -1, -1.5}}, 
      VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]
     }, PlotRange -> {{-2, 2}, {-1.5, 5}, {-2, 2}}, 
    ViewPoint -> {-1.3, - 2.4, 2.}, Boxed -> False, 
    Lighting -> "Neutral", Background -> White]
   , {t, 1, 100, 1}];

Export["path/filename.mp4",
 Join[frames1, Reverse[frames1], frames2, Reverse[frames2], frames3, 
  Reverse[frames3], frames4, Reverse[frames4], frames5]
 , "AnimationRepetitions" -> \[Infinity], "DisplayDurations" -> 0.1]

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:24, 1 August 202213 s, 480 × 534 (195 KB)Berto (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

Transcode status

Update transcode status
Format Bitrate Download Status Encode time
VP9 480P 113 kbps Completed 09:24, 1 August 2022 7.0 s
Streaming 480p (VP9) 113 kbps Completed 11:09, 23 March 2024 2.0 s
VP9 360P 64 kbps Completed 09:24, 1 August 2022 5.0 s
Streaming 360p (VP9) Not ready Unknown status
VP9 240P 36 kbps Completed 09:24, 1 August 2022 3.0 s
Streaming 240p (VP9) 36 kbps Completed 09:13, 5 December 2023 1.0 s
WebM 360P 220 kbps Completed 09:24, 1 August 2022 2.0 s
Streaming 144p (MJPEG) 505 kbps Completed 12:55, 15 November 2023 1.0 s

Metadata