File:Convolution of spiky function with box.gif
Convolution_of_spiky_function_with_box.gif (475 × 144 pixels, file size: 106 KB, MIME type: image/gif, looped, 406 frames, 20 s)
Captions
Captions
Summary
[edit]DescriptionConvolution of spiky function with box.gif |
An animation displaying the process and result of convolving a spiky signal with itself. For each position in the resulting hat function the input functions and the multiplied input functions are shown, and the area which is integrated is marked. This work mimicks File:Convolucion de entrada con respuesta al impulso.gif but includes the source code and shows the result of the convolution in the same graph as the input functions. The function used is $exp(-t)$ for $t>0$ and $0$ otherwise. |
Date | |
Source | Own work |
Author | Brian Amberg |
![](https://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Matlab_Logo.png/25px-Matlab_Logo.png)
Matlab Code used to create the image
[edit]%% Create folding of two rectangular impulses with spiky function
X=-2.3:0.0005:3.8;
F1=exp(-X);
F1(X<=0) = 0;
F2=zeros(size(X)); F2(abs(X)<=0.5) = 1;
clf
[tmp zero_offset] = min(abs(X));
!rm -f /tmp/conv_box_spike*
integral=nan(size(X));
for offset_i=1:numel(X)
offset=X(offset_i);
shift=offset_i-zero_offset;
F2_shifted = circshift(F2, [1 shift]);
F2_shifted(1:min(shift, numel(X))) = 0;
F2_shifted(end+shift:end) = 0;
product = F2_shifted.*F1;
integral(offset_i) = sum(product)/numel(X)*(X(end)-X(1));
if (mod(offset_i, 30)==0)
area(X, product, 'facecolor', 'yellow');
hold on
plot(X, F1, 'b', X, F2_shifted, 'r', X, integral, 'k', [offset offset], [0 2], 'k:')
hold off
axis([-1.5 3 0 1.1])
xlabel('t');
legend('Area under f(t)g(t)', 'f(t)', 'g(t)', '(f*g)(t)');
grid on
drawnow
set(gcf,'PaperPositionMode','auto')
print('-dpng', '-r72', '-painters', sprintf('/tmp/conv_box_spike_%06d.png', offset_i));
end
end
And the conversion was done with Image Magicks convert using
convert -delay 5 -loop 0 conv_box_spike_*.png conv_box_spike.gif
Licensing
[edit]![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
![]() |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 18:41, 7 July 2010 | ![]() | 475 × 144 (106 KB) | Rubybrian (talk | contribs) | Cropped the image and optimized the output for size using <code> convert -layers Optimize -delay 5 -loop 0 conv_box_spike_*.png conv_box_spike.gif </code> |
18:22, 7 July 2010 | ![]() | 587 × 159 (1.03 MB) | Rubybrian (talk | contribs) | == Summary == {{Information |Description=An animation displaying the process and result of convolving a spiky signal with itself. For each position in the resulting hat function the input functions and the multiplied input functions are shown, and the are |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org