Image:Dirac function approximation.gif

From Wikipedia, the free encyclopedia

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.
Description

Illustration of approximating the Dirac delta function by gaussians.

Source

self-made with MATLAB

Date

22:22, 12 January 2008 (UTC)

Author

Oleg Alexandrov

Permission
(Reusing this image)

see below



Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Български | Català | Česky | Cymraeg | Dansk | Deutsch | Eʋegbe | Ελληνικά | English | Español | Esperanto | Euskara | Estremeñu | فارسی | Français | Galego | 한국어 | हिन्दी | Hrvatski | Ido | Bahasa Indonesia | Íslenska | Italiano | עברית | Kurdî / كوردی | Latina | Lietuvių | Latviešu | Magyar | Македонски | Bahasa Melayu | Nederlands | ‪Norsk (bokmål)‬ | ‪Norsk (nynorsk)‬ | 日本語 | Polski | Português | Ripoarisch | Română | Русский | Shqip | Slovenčina | Slovenščina | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Tiếng Việt | Walon | ‪中文(简体)‬ | ‪中文(繁體)‬ | zh-yue-hant | +/-

[edit] Source code (MATLAB)

% Illustration of approximating the Dirac delta function with gaussians.
 
function main()
 
   r = 3; % the power in the Bernoulli inequality
 
   % KSmrq's colors
   red    = [0.867 0.06 0.14];
   blue   = [0, 129, 205]/256;
   green  = [0, 200,  70]/256;
   yellow = [254, 194,   0]/256;
   white = 0.99*[1, 1, 1];
 
  % Set up the grid and other parameters
   N = 300;
   A = -2; B = 2; 
   C=-1; D = 6;
 
   X = linspace(A, B, N);
 
   % Set up the figure
   lw = 3; % linewidth
   fs = 18; % font size
 
   for p=1:10
 
      a=1/p;
 
      % gaussian
      Y=(1/(a*sqrt(pi)))*exp(-X.^2/a^2);
 
      figure(1); clf; 
 
      set(gca, 'fontsize', fs);
      set(gca, 'linewidth', 0.4*lw)
      hold on;
 
      plot_axes (A, B, C, D, lw/1.5);
 
      plot(X, Y, 'color', blue, 'linewidth', lw);
 
      axis equal; axis([A, B, C, D]); 
 
      set(gca, 'XTick', [-2, -1, 0, 1, 2]) % text labels on the x axis
      grid on;
 
      H=text(B-1.5, D-0.5, sprintf('a=1/%d', p), 'fontsize', fs);
 
      % save to disk
      file = sprintf('Frame%d.eps', 1000+p);
      disp(file);
      saveas(gcf, file, 'psc2')
 
      pause(0.1);
 
   end
 
 % Converted to gif with the command
 % convert -antialias -density 100 -delay 20 -loop 10000 Frame10* Dirac_function_approximation.gif
 % then scaled in Gimp   
 
function plot_axes (A, B, C, D, lw)
 
   gray = 0.5*[1, 1, 1];
 
   plot([A B], [0, 0], 'linewidth', lw, 'color', gray);
   plot([0, 0], [C, D], 'linewidth', lw, 'color', gray);

File history

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

Date/TimeDimensionsUserComment
current22:51, 12 January 2008200×335 (89 KB)Oleg Alexandrov (tweak)
22:22, 12 January 2008217×363 (99 KB)Oleg Alexandrov ({{Information |Description=Illustration of approximating the Dirac delta function by gaussians. |Source=self-made with MATLAB |Date=~~~~~ |Author= Oleg Alexandrov |Permission= |other_versions= }} {{)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):