/
2023 EESC W3400 Lec  16: Natural textures created using the 2D FFT 2023 EESC W3400 Lec  16: Natural textures created using the 2D FFT

2023 EESC W3400 Lec 16: Natural textures created using the 2D FFT - PowerPoint Presentation

isabella
isabella . @isabella
Follow
1 views
Uploaded On 2024-03-15

2023 EESC W3400 Lec 16: Natural textures created using the 2D FFT - PPT Presentation

Computational Earth Science Bill Menke Instructor Emily Glazer Teaching Assistant TR 240 355 Today Use of the Fast Fourier Transform in Modeling random textures of natural phenomenon ID: 1048707

autocorrelation random fft asd random autocorrelation asd fft data casd group abs dasd sqrt density gaussian sigmad normal spectral

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "2023 EESC W3400 Lec 16: Natural texture..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. 2023 EESC W3400Lec 16: Natural textures created using the 2D FFTComputational Earth ScienceBill Menke, InstructorEmily Glazer, Teaching AssistantTR 2:40 – 3:55

2. TodayUse of the Fast Fourier Transform in Modeling“random textures”of natural phenomenon

3. look at these two random “datasets”

4.

5.

6. about the same overall amplitudein fact, they have the same variance  

7. but they are different in that the second is bounded,  (whereas the first isn’t)   

8. they have different probability density functionsnormaluniformType equation here.         

9. # normal with mean 0 and stddev of sigmadd=np.random.normal(loc=0.0,scale=sigmad,size=(Nx,1));# uniform with mean 0 and stddev of sigmaddhigh = sqrt(3)*sigmad;d=np.random.uniform(low=-dhigh,high=dhigh,size=(Nx,1));very easy to make random data with python

10. many uses for random datathe one we’ll investigate todayis making data that“matches the texture”natural data(which could then be used to test data analysis code)

11. most “real” data doesn’t look like thisand the reason is that this fake data lacks “correlation” between neighboring data points

12.   no correlation:if a point is high,equal probability that a neighboring point is low or high

13. here’s a dataset with some correlation  

14. but scatter plot of points offset by two has little correlation   

15. here’s a dataset with more correlation    

16. correlation coefficient : measure of how “linear” the scatter plot             

17. autocorrelation              

18. shape of autocorrelation matters    wide

19. shape of autocorrelation matters    narrow

20. shape of autocorrelation matters    smooth  cusp  

21. autocorrelation can be oscillatory   wavelength   wavelength  

22. making a random dataset with a specified autocorrelationrelies on two rulesRule 1: ASD of autocorrelation is PSD of datasetRule 2: ASD of uncorrelated noise is approximately constantASD = amplitude spectral density = | FT d |PSD = power spectral density = ASD2

23. start withreplace dt withdt sqrt [ASD(c)] / ASD(d)ASD = amplitude spectral density = | FT d |PSD = power spectral density = ASD2STD = standard deviationdesired cdesired standard deviation sdd = uncorrelated noisetake FTASD(d) = |dt|ASD(c) = |ct|d = IFT dtscale to desiredd = sd d / STD(d)dt = FT dct = FT c modify dtake IFTrescale

24. start withreplace dt withdt sqrt [ASD(c)] / ASD(d)desired cdesired standard deviation sdd = uncorrelated noisetake FTd = IFT dtscale to desiredd = sd d / STD(d)dt = FT dct = FT c modify dtake IFTrescaleif you omit this division,the result is inexact but“more random”and that sometimes is helpfulASD(d) = |dt|ASD(c) = |ct|

25. start withtake FTmodify dtake IFTrescaled=np.random.normal(loc=0.0,scale=1.0,size=(Nx,1));ct = np.fft.fft(c,axis=0);casd = np.sqrt(cpsd);dt = np.fft.fft(d,axis=0);if( EXACT ): dasd = np.abs(dt); dt = np.multiply(casd, np.divide(dt,dasd));else: dt = np.multiply(casd, dt);d = np.real(np.fft.fft(dt,axis=0));d = sigmad*d/np.std(d);dabsmax = np.max(np.abs(d));

26. several useful autocorrelation functionsGaussian Exponential  

27. several useful autocorrelation functionsGaussian-oscillatory Exponentialoscillatory   

28. the algorithm works in any number of dimensions2D (and higher datasets) are easybecause

29. d = np.random.normal(loc=0.0,scale=1.0,size=(Nx,Ny));casd = np.sqrt(np.abs(np.fft.fft2(c))); dt = np.fft.fft2(d);dasd = np.abs(dt);if( EXACT ): dasd = np.abs(dt); dt = np.multiply(casd, np.divide(dt,dasd));else: dt = np.multiply(casd, dt); d = np.real(np.fft.ifft2(dt));d = (sigmad/np.std(d))*d;

30. Gaussian autocorrelationxywith sy=sxdataset

31. Gaussian autocorrelationxywith sy=3sxdataset

32. Group assignments:design random 2D field that captures the texture of a natural onechoice of four autocorrelation functions Gaussian (TYPE=1) Exponential (TYPE=2) Gaussian-Oscillatory (TYPE=3) Exponential-Oscillatory (TYPE=4)and whether the field has the target autocorrelationexactly (EXACT=1) or only approximately (EXACT=0)two parameters,sx and syfour parameters,sx, sy, Lx and Ly

33. Group 1: Clouds

34. Group 2: Ocean waves

35. Group 3: Oil reservoir

36. Group 4: hilly topography