File:Circular convolution example.png

Circular_convolution_example.png(488 × 516 pixels, file size: 12 KB, MIME type: image/png)

Captions

Captions

Example of using circular convolution to produce linear convolution

Summary edit

Description Circular convolution can be expedited by the FFT algorithm, so it is often used with an FIR filter to efficiently compute linear convolutions. These graphs illustrate how that is possible.
Date
Source Own work
Author Bob K
Permission
(Reusing this file)
Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.
Other versions

Derivative works of this file:  Circular convolution example.svg

PNG development
InfoField
 
This PNG graphic was created with LibreOffice.
Octave/gnuplot source
InfoField
click to expand

This graphic was created with the help of the following Octave script:

graphics_toolkit gnuplot

% "color" is temporary, because of gnuplot bug (see below)
hfig = figure("color", .85*[1 1 1], "position", [100 100 488 512]);
set(gca, "color", .85*[1 1 1])

xmax = 3000;

% subplot() undoes the "color" attempts above.  (gnuplot bug)
subplot(6,1,1)
L = 100;
f = ones(1,L)/L;
plot(-100:200-1, [zeros(1,100) f*L zeros(1,100)], "linewidth", 2, "color", "magenta")
set(gca, "color", "white")
title("Circular convolution example", "FontSize",12)
text(100, 1.6, "h[n]")
text(xmax/2, 0.4, '\leftarrow n \rightarrow')
ylim([0 2])
xlim([-100 xmax])
set(gca,"XTick",[]); set(gca,"YTick",[])

subplot(6,1,2)
a = [zeros(1,20) ones(1,L) zeros(1,300) 0.5*ones(1,100) zeros(1,1000-L-20-400)];
b = [zeros(1,1000-L-20) ones(1,L) zeros(1,20)];
a1 = [zeros(1,1000) a zeros(1,1000)];
b1 = [zeros(1,1000) b zeros(1,1000)];
plot(1:length(a1), a1, "color", "blue", 1:length(a1), b1, "color", "red")
set(gca, "color", "white")
text(200, 1.6, "X[n]")
ylim([0 2])
xlim([0 xmax])
set(gca,"XTick",[]); set(gca,"YTick",[])

subplot(6,1,3)
a1 = conv(a1,f);
b1 = conv(b1,f);
plot(1:length(a1), a1+b1, "color", "green", "linewidth", 2)
set(gca, "color", "white")
text(200, 1.6, "X[n] * h[n]")
ylim([0 2*max(a1)])
xlim([0 xmax])
set(gca,"XTick",[]); set(gca,"YTick",[])

subplot(6,1,4)
a = [a a a];
b = [b b b];
L = 1:length(a);
plot(L, a, "color","blue", L, b, "color","red")
set(gca, "color", "white")
text(200, 2.0, 'X_N[n]')
ylim([0 2.5])
xlim([0 xmax])
set(gca,"XTick", [1000 2000])
set(gca,"XTickLabel",["N"; "2N"])
set(gca,"YTick",[])

subplot(6,1,5)
a1 = conv(a,f);
b1 = conv(b,f);
b1(1:90) = b1(3000+[1:90]);
L = 1:length(a1);
plot(L,a1,"color","blue", L,b1, "color","red")
set(gca, "color", "white")
text(200, 1.6, 'components of X_N[n] * h[n]')
ylim([0 2*max(a1)])
xlim([0 xmax])
set(gca,"XTick",[]); set(gca,"YTick",[])

subplot(6,1,6)
c = a1+b1;
L = length(c);
k=1100;
plot(1:k, c(1:k), "color","red", k+(1:900), c(k+(1:900)), "color", "green", "linewidth", 2, (k+900+1):xmax, c((k+900+1):xmax), "color","red")
set(gca, "color", "white")
text(200, 1.6, 'X_N[n] * h[n]')
ylim([0 2*max(a1+b1)])
xlim([0 xmax])
set(gca,"XTick",[]); set(gca,"YTick",[])

text(1163, -1, "X[n] * h[n]", "fontsize", 16)
annotation("line", [.414 .414], [.136 .045])
annotation("line", [.647 .647], [.136 .045])

% I prefer the version created by the export function on the GNUPlot figure,
% because the dimensions are better.
print(hfig,"-dpng","-color", 'C:\Users\BobK\Circular convolution example.png')

File history

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

Date/TimeThumbnailDimensionsUserComment
current15:29, 19 February 2013Thumbnail for version as of 15:29, 19 February 2013488 × 516 (12 KB)Bob K (talk | contribs)Add title. Add tick marks to 4th subplot. Use Octave & gnuplot.
17:12, 16 April 2008Thumbnail for version as of 17:12, 16 April 2008386 × 504 (9 KB)Bob K (talk | contribs)Crop image to the correct size.
16:28, 16 April 2008Thumbnail for version as of 16:28, 16 April 2008960 × 720 (5 KB)Bob K (talk | contribs){{Information |Description= Illustration of circular convolution |Source=self-made |Date=16-Apr-2008 |Author= Bob K }}

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata