Problem 5.8
Here we have the signals:
x1 (u) = {1,2,3,1}
x2 (u) = (4,3,2,2}
We want their circular convolution
3
X3 (u) =
x1 (m) x2 ((u – m))4
m 0
We’ll do this graphically:
2
3
x1(u)
3
1
2
x2(u)
1
4
2
So
2
2
x1(m)
3
And
1
2
x2((-m))4
1
4
3
3
x3 (0) =
x1 (m) x2 ((– m))
m 0
1-4+2-2+3–2+1–3
17
=
=
Next for n = 1 we need
2
3
x1(m)
1
4
1
2
x2((1-m))4
3
3
So x3 (1) = 1 - 3 + 2 - 4 + 3 - 2 + 1 - 2 = 19
For u = 2, the circles are
2
3
3
x2((2-m))4
x1(m)
1
2
4
1
2
3
x3 (2) =
x1(m) x2((2-m))4
m 0
=
1 - 2 + 2 – 3 + 3 – 4 +1 – 2 = 22
Finally for u = 3
2
3
2
x1(m)
1
3
1
x2((3-m))4
4
And
3
x3 (3) =
x1(m) x2((3-m))4
m 0
=
1 - 2 + 2 – 2 + 3 – 3 +1 – 4 = 19
Thus
X3 (u) = x1 (u) 4
X2 (u) = (17, 19, 22, 19)
2
Problem 5.9
Here we use the fact that
X3 (u) = IDFT {X1 (k) X2 (k)}
So we first need X1 (k), and X2 (k) to begin:
3
x1 (k) =
x1 (u) e –j*2*pi*nk/4
4 point DFT
h 0
= x1 (0) + x1 (1) e –j**k/2 + x1 (2) e –j**k + x1 (3) e –j*3*k*/2
= 1 + 2e-j(/2)k + 3e-jk + e-j(3/2)k
i.e. put h = 0 in
So
x1(0) = 1 + 2 + 3 + 1 = 7
x1(1) = 1 + 2e-j/2 + 3e-j + e-j3/2
= 1 – 2j – 3 + j
= -2 – j
since e-j/2 = -j & e-j = -1 & e-j3/2 = +j
x1(2) = 1 + 2e-j + 3e-j2 + e-j3
=1–2+3–1=1
x1(3) = 1 + 2e-j3/2 + 3e-j3 + e-j9/2
= 1 + 2j – 3 – j = -2 + j
Similarly
3
x2(k) =
x2(n)e-j2kn/4
n 0
= 4 + 3e-j(/2)k + 2e-jk + 2e-j(3/2)k
Which is
x2(0) = 11
x2(1) = 2 – j
x2(2) = 1
x2(3) = 2 + j
Thus
x3(0) = x2(0)x1(0) = (11)(7) = 77
x3(1) = x2(1)x1(1) = (2 – j)(-2 – j) = -5
x3(2) = x2(2)x1(2) = (1)(1) = 1
x3(3) = x2(3)x1(3) = (2 + j)(-2 + j) = -5
Finally
x3(n) = IDFT {x3(k)}
=
=
1
4
3
x3(k)ej2nk/4
n 0
77
5 j(n/2) 1 jn 5 j3(/2)n
+
e
+ e +
e
4
4
4
4
or
1
(77 – 5 + 1 - 5) = 17
4
1
1
x3(1) = (77 - 5ej (/2) - 1 - 5ej3(/2)) = (77 – 5j – 1 + 5j)
4
4
= 19
1
1
x3(1) = (77 – 5j + ej 2 - 5ej3) = (77 + 5 + 1 +5)
4
4
= 22
1
1
x3(1) = (77 – 5ej3/2 + ej 3 - 5ej9/2) = (77 + 5j +1 – 5j)
4
4
= 19
Thus
X3(a) = {17,19,22,19}
x3(0) =
Like in problem 9.11!
Problem 5.16
First, since h(n) 1 1/ 4 n k0 and we are sampling at the rate 4k0 it is simple to
show that H k 1 1/ 4exp jk / 2 . This is independent of k0 and moreover is 4
periodic with
H 0 3 / 4 H 1 1 j / 4
H 2 5 / 4 H (3) 1 j / 4
Next, G(k)=1/H(k) is also 4 periodic. Thus we have:
1 4 k0 1
g n
G k exp j 2 nk / 4k0
4k0 k 0
1
4k0
k0 1
k0 1
G
0
exp
j
2
n
4
k
/
4
k
G
1
exp j 2 n 4k 1 / 4k0
0
k
0
k 0
k0 1
k0 1
G 2 exp j 2 n 4k 2 / 4k0 G 3 exp j 2 n 4k 3 / 4k0
k 0
k 0
k0 1
1 3
exp j 2 nk / k0
G l exp j 2 nl / 4k0
4k0 l 0
k 0
Now, recall that g(n) is going to be 4k0 periodic. In this case, it is not hard to convince
yourself that the last summation in the last line is equal to zero except when n=0, k0 , 2k0
and 3k0 when it equals k0. Thus, g(n) is also going to be equal to zero except at the points
n=0, k0 , 2k0 and 3k0 it will equal
3
g 0 0.25 G l 1.0039
l 0
3
g k0 0.25 G l exp j l / 2 0.0157
l 0
3
g 2k0 0.25 G l exp j l 0.0627
l 0
3
g 3k0 0.25 G l exp j 3l / 2 0.2510
l 0
Convolving with the original gives a fair representation of a unit impulse. Specifically
for k0=50, we get:
1.2
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
0
50
which shows some distortion.
100
150
200
250
Problem 5.25
a) X() =
n
2
=
x(u)e-jn
x(u)e-jn
n 2
= ej2 + 2ej + 3 + 2e-j + e-j2
= ( ej2 + e-j2 ) + (e2 + e-2 ) +3
= 2cos2 + 4cos +3
5
b) V(k) =
v(u)e-jk
h 0
= 3 + 2e-j (2/6)k + e-j (2/6)2k + 0 + e-j(2/6)4k + e-j(2/6)5k
= 3 + 2 (e-j (2/6)k + e-j(2/6)5k) + (e-j (2/6)2k + 0 + e-j(2/6)4k)
= 3 + 2 e-j 3(2/6)k[e+j2(2/6)k + e-j 2(2/6)k] + e-j 3(2/6)k [e+j (2/6)k + e-j (2/6)k]
2
2
= 3 + e-j k * 2cos
k + e-j k4cos
2k
6
6
c) Strictly speaking no relation. Try (b) with time origin under 1st 1 and then see that the
resulting V(k) is a sampled version of X().
Additional Written Problem 1
We will show equivalently that R 1G GR 1 . Let
Gn be the n-th column of G for n = 0,1,2,…N-1.
Gn(m) be the m-th element of Gn for m = 0,1,2,…N-1.
Now
1
0 0 0
1 0 0
0
R 1G 0 1 0
0 G0 G1 GN 1
0
0 0
0
0 1 0
GN 1 N 1
G0 N 1 G1 N 1
G0 0
G1 0
GN 1 0
GN 1 N 2
G0 N 2 G1 N 2
and
1
0 0 0
1 0 0
0
GR 1 G0 G1 GN 1 0 1 0
0
0
0 0
0
0 1 0
G1 G2 GN 1 G0
So if R 1G GR 1 we have
G0 N 1
G0 0
G1
G0 N 2
G1 N 1
G1 0
G2
G1 N 2
etc.
In other words, the n-th column of G is a circularly shifted version of the (N-1)-st
column. This is just the definition of a circulant matrix.
Additional written 2
Look at then picture below. For the first 10 samples of the circular convolution (the
green), there is only overlap between the second signal and one image of the first. This
state of overlap is the same overlap as we would have for points 100 through 109 of the
linear convolution of these two signals. For the next 29 points (blue), there is overlap
between the second signal and two images of the first. These points cannot correspond to
any in the linear convolution. Finally, points 40 though 99 (red) of the circular
convolution represent the same overlap as we would have for points 40 though 99 of the
linear convolutiuon..
x2(-n) sliding through x1(n)
0
10
39
100
0
110
139
200
210
239
Convolution circular and block
Problem 1.1a
% $$$ Script to solve Burrus et al Exericse 1.1
% $$$ in Convolution: Circular and Block
% $$$ Define the signal
n = 0:15;
x = (-7:8)';
lx = length(x);
shft = 3;
% $$$ Use rotate.m to shift 4 units
y1 = rotate(x,shft);
%
%
X
k
$$$ Use FFTs by taking advantage of the
$$$ shift-modulation property
= fft(x);
= (0:lx-1)';
Y2 = X.*exp(-j*2*pi.*k*shft/lx);
y2 = real(ifft(Y2));
figure(1);clf;
subplot(311);stem(n,x); grid on;title('x')
subplot(312);stem(n,y1); grid on;title('y_1');
subplot(313);stem(n,y2); grid on;title('y_2');
print -deps -tiff prob11a.eps
% Now shift by N/2 to get sign flip
shft = 8;
Y1 = fft(rotate(x,shft));
[fft(x) Y1]
% Note sign flip as expected
%
8.0000
8.0000
% -8.0000 +40.2187i
8.0000 -40.2187i
% -8.0000 +19.3137i -8.0000 +19.3137i
% -8.0000 +11.9728i
8.0000 -11.9728i
% -8.0000 + 8.0000i -8.0000 + 8.0000i
% -8.0000 + 5.3454i
8.0000 - 5.3454i
% -8.0000 + 3.3137i -8.0000 + 3.3137i
% -8.0000 + 1.5913i
8.0000 - 1.5913i
% -8.0000
-8.0000
% -8.0000 - 1.5913i
8.0000 + 1.5913i
% -8.0000 - 3.3137i -8.0000 - 3.3137i
% -8.0000 - 5.3454i
8.0000 + 5.3454i
% -8.0000 - 8.0000i -8.0000 - 8.0000i
% -8.0000 -11.9728i
8.0000 +11.9728i
% -8.0000 -19.3137i -8.0000 -19.3137i
% -8.0000 -40.2187i
8.0000 +40.2187i
Problem 1.1b
function y = mod(x,N)
% $$$ Function to compute x mod N
% $$$ Eric Miller
% $$$ Make x a column vector
x = x(:);
if (x >= 0)
y = rem(x,N);
else
y = rem(x-N*(fix(x/N)-1),N);
end
Problem 1.1c
function y = rotate(x,l)
%
%
%
%
%
%
%
$$$
$$$
$$$
$$$
$$$
$$$
$$$
Function to do a circular shift of the
vector x by l places. x is assumed to be a
column vector. Positive l corresponds to a
downward shift while negaitve l is an upward shift
Makes use of the modulo function to do all rotations
Eric Miller
% $$$ Swap the sign of the shift so that positive l
% $$$ corresponds to a downward shift of the vector.
l = -l;
% $$$ Make sure x is a column vector
x = x(:);
lx = length(x);
% $$$ The index set to be rotated
n = (1:lx)';
% $$$ The rotated index set opbtained using the modulo
% $$$ operator
nr = modulo(n+modulo(l,lx),lx);
% $$$ Because of the way modulo works,
% $$$ the 0 in nr must be replaced by an lx
nr(find(nr==0))=lx;
% $$$ Finally build the rotated vector
y = x(nr);
Problem 1.1d
% $$$ Script to solve Burrus et al Exericse 1.1
% $$$ in Convolution: Circular and Block
% $$$ Part (b): See attached function modulo.m
% $$$ Part (c): See attached function rotate.m
% $$$ Part (d)
% $$$ Define the signal
x = (0:7)';
lx = length(x);
shft = 4;
% $$$ Use rotate.m to shift 4 units
y1 = rotate(x,shft);
%
%
X
k
$$$ Use FFTs by taking advantage of the
$$$ shift-modulation property
= fft(x);
= (0:lx-1)';
Y2 = X.*exp(-j*2*pi.*k*shft/lx);
y2 = real(ifft(Y2));
[y1 y2]
%ans =
%
4.0000
4.0000
%
5.0000
5.0000
%
6.0000
6.0000
%
7.0000
7.0000
%
0
0.0000
%
1.0000
1.0000
%
2.0000
2.0000
%
3.0000
3.0000
Problem 1.2
% $$$ Script to solve Burrus et al Exericse 1.2
% $$$ in Convolution: Circular and Block
% $$$ See function cflip.m for the clode to do the
% $$$ circular flipping of a vector
%
x
%
y
%
%
%
%
%
%
%
%
%
%
%
$$$ The signal
= (0:7)';
$$$ Flip it
= cflip(x);
$$$ The result
$$$ >> y
$$$ y =
$$$
0
$$$
7
$$$
6
$$$
5
$$$
4
$$$
3
$$$
2
$$$
1
function y = cflip(x);
% $$$ Function to do a circular flip of a sequence.
% $$$
% $$$ Eric Miller
% $$$ First make sure that x is a column vector
x = x(:);
% $$$ The original index set
n = (1:length(x))'-1;
% $$$ The flipped set obtained using the modulo operator
% $$$ Need to add the 1 to deal with Matlab indexing
nr = modulo(-n,length(x)) + 1;
% $$$ The flipped vector
y = x(nr);
Problem 1.3a
% $$$ Build the time set, and the signal
N = 11;
n = (0:N-1)';
x = 2*n+3;
xr = cflip(x);
x2
x3
x4
x5
=
=
=
=
rotate(x,2);
rotate(x,-3);
rotate(xr,4);
rotate(xr,-5);
% $$$ Generate the plots
clg
stem(n,x);
title('x(n) for 1.3(a)')
print -deps prob13a1.eps
clg
subplot(221);stem(n,x2);
title('x((l-2))_11')
subplot(222);stem(n,x3);
title('x((l+3))_11')
subplot(223);stem(n,x4);
title('x((4-l))_11')
subplot(224);stem(n,x5);
title('x((-l-5))_11')
print -deps prob13a2.eps
Problem 1.3b
nn = 0:12;
x = .87.^nn;
nns = rotate(nn,4)+1;
clg
subplot(211);
stem(nn,x);
title('x(n) for 1.3(b)');
subplot(212);
stem(nn,x(nns));
title('x((n-4))_13');
print -deps ./picts/prob13b.eps
Problem 2.1a
% $$$ See attached ccfft.m for code to do FFT-based circular
convolution
N = 16;n = 0:N-1;
% $$$ Part (a.1)
a = 4; b = 2;
x = zeros(N,1); h = zeros(N,1);
x(a) = 1; h(b) = 1;
y1 = ccfft(x,h);
% $$$ Plot the results
clg
subplot(221);stem(n,x);title('x(n) Prob 2.1.a.1, N=16');
subplot(222);stem(n,h);title('h(n) Prob 2.1.a.1, N=16');
subplot(212);stem(n,y1);title('Circ. conv. x and h ; N=16')
print -deps -tiff prob211.eps
% $$$ Part (a.2)
x = zeros(N,1); h = zeros(N,1);
x(1:5) = ones(5,1);
h(5:12) = ones(8,1);
y2 = ccfft(x,h);
% $$$ Plot the results
clg
subplot(221);stem(n,x);title('x(n) Prob 2.1.a.2, N=16');
subplot(222);stem(n,h);title('h(n) Prob 2.1.a.2, N=16');
subplot(212);stem(n,y2);title('Circ. conv. x and h ; N=16')
print -deps -tiff prob212.eps
% $$$ Part (a.3)
x = zeros(N,1); h = zeros(N,1);
x(1:11) = ones(11,1);
h(6:12) = ones(7,1);
y3 = ccfft(x,h);
% $$$ Plot the results
clg
subplot(221);stem(n,x);
title('x(n) Prob 2.1.a.3, N=16');subplot(222);stem(n,h);
title('h(n) Prob 2.1.a.3, N=16');subplot(212);stem(n,y3)
title('Circ. conv. x and h ; N=16');print -deps -tiff prob213.eps
% $$$ For N = 21, 1 and 2 will be these same since there is no
% $$$ time aliasing. Only 3 will change.
N=21;n=0:N-1;
x = zeros(N,1); h = zeros(N,1);
x(1:11) = ones(11,1);
h(6:12) = ones(7,1);
y4 = ccfft(x,h);
% $$$ Plot the results
clg
subplot(221);stem(n,x);
title('x(n) Prob 2.1.a.3, N=21');subplot(222);stem(n,h);
title('h(n) Prob 2.1.a.3, N=21');subplot(212);stem(n,y4)
title('Circ. conv. x and h ; N=21');print -deps -tiff prob214.eps
Problem 2.1b
% $$$ Script to solve Burrus et al Exericse 2.1.b
% $$$ in Convolution: Circular and Block
N = 16; n = 0:N-1
% $$$ Compare to (2.1.a.2)
x = zeros(N,1); h = zeros(N,1);
x(1:5) = ones(5,1);
h(5:12) = ones(8,1);
y5 = ccfft(x,h);
% $$$ Plot the results
clg
subplot(221);stem(n,x);
title('x(n) Prob 2.1.b, N=16');
subplot(222);stem(n,h);
title('h(n) Prob 2.1.b, N=16');
subplot(212);stem(n,y5)
title('Circ. conv. x and h ; N=16')
print -deps -tiff prob215.eps
% $$$ Compare to 2.1.a.3 ()
x = zeros(N,1); h = zeros(N,1);
x(1:11) = ones(11,1);
h(6:12) = ones(7,1);
y6 = ccfft(x,h);
% $$$ Plot the results
clg
subplot(221);stem(n,x);
title('x(n) Prob 2.1.b, N=16');
subplot(222);stem(n,h);
title('h(n) Prob 2.1.b, N=16');
subplot(212);stem(n,y6)
title('Circ. conv. x and h ; N=16')
print -deps -tiff prob216.eps
Problem 2.1c
% $$$ Script to solve Burrus et al Exericse 2.1.c
% $$$ in Convolution: Circular and Block
N = 16; n = 0:N-1
% $$$ Compare to (2.1.a.2)
x = zeros(N,1); h = zeros(N,1);
x(1:5) = ones(5,1);
h(5:12) = ones(8,1);
[y7,H7] = ccmtx(x,h);
% $$$ Plot the results
clf
subplot(221);stem(n,x);
title('x(n) Prob 2.1.c, N=16');
subplot(222);stem(n,h);
title('h(n) Prob 2.1.c, N=16');
subplot(212);stem(n,y7)
title('Circ. conv. x and h ; N=16')
print -deps -tiff prob217.eps
% $$$ Compare to 2.1.a.3 ()
x = zeros(N,1); h = zeros(N,1);
x(1:11) = ones(11,1);
h(6:12) = ones(7,1);
[y8,H8] = ccmtx(x,h);
% $$$ Plot the results
clf
subplot(221);stem(n,x);
title('x(n) Prob 2.1.c, N=16');
subplot(222);stem(n,h);
title('h(n) Prob 2.1.c, N=16');
subplot(212);stem(n,y8)
title('Circ. conv. x and h ; N=16')
print -deps -tiff prob218.eps
Problem 3.4
a) Let us assume that both x and h are of length N. In this case to get all possible ways in
which shifts of h can overlap x, we need to copies of x in the periodic extension. Hence
N’=2N.
b) For the linear convolution, h will partially overlap x for the first N samples. After this,
h overlaps x and its periodic extension. So, throw out the first N samples, keep the next
N and throw away the rest.
Partial overlap. Throw away
output from these shifts
x(n)
h(-n) “sliding” through the
periodic extension of x(n)
x(n-N)
Overlaps x and its shift. Good
points so keep them
c) Here is the function:
function y = ccpe(x,h)
% Function to do circular convolution
% via periodic extension. McLellan et. al
% Problem 3.4 in Conv.: Circ and Block
% Eric Miller
N = length(x);
y1 = conv([x(:);x(:)],h);
y = y1(N+1:2*N);
We test it using random x and h and things look good:
>> x = randn(5,1);
>> h = randn(5,1);
>> y1 = ccmtx(x,h);
>> y2 = ccpe(x,h);
>> [y1 y2]
ans =
0.1929
0.1929
0.8304
0.8304
0.5785
0.5785
1.1710
1.1710
-2.2346
-2.2346
Partial overlap. Throw away
output from these shifts
© Copyright 2026 Paperzz