Digital Signal Processing Reference
In-Depth Information
index zero. For example, the sequence [1,2,3,4] that has corresponding sample indices [3,4,5,6], when
folded, results in the sequence [4,3,2,1] and corresponding indices [-6,-5,-4,-3].
To illustrate the above ideas, we can, for example, let x
[
]
n
= [1,2,3,4] with corresponding sample
indices n = [3,4,5,6], and compute x
[−
n
]
using MathScript. We can write a simple script to accomplish
the folding operation:
function [xFold,nFold] = LVFoldSeq(x,n)
xFold = fliplr(x), nFold = -fliplr(n)
For the problem at hand, we can then make the following call:
n = [3,4,5,6]; x=[1,2,3,4];
[xFold,nFold] = LVFoldSeq(x,n)
figure(6); hold on; stem(n,x,'bo'); stem(nFold,xFold,'r*')
2.4.9 EVEN AND ODD DECOMPOSITION
Any real sequence can be decomposed into two components that display even and odd symmetry about
the midpoint of the sequence. A sequence that exhibits even symmetry has its first and last samples equal,
its second and penultimate samples equal, and so on. A sequence that exhibits odd symmetry has its first
sample equal to the negative of the last sample, its second sample equal to the negative of its penultimate
sample, etc.
An even decomposition xe of a sequence x can be obtained as
xe = 0.5*(x + fliplr(x))
and the corresponding odd decomposition xo is
xo = 0.5*(x - fliplr(x))
We can write a simple function that generates the even and odd components of an input sequence
x
[
n
]
as follows:
function [xe,xo] = LVEvenOdd(x)
xe = (x + fliplr(x))/2; xo = (x - fliplr(x))/2;
[
]
= [1,3,5,7], we'll
generate an even/odd decomposition and verify its correctness by summing the even and odd components,
and comparing to the original input signal x
We can illustrate use of the above script with a simple example; assuming that x
n
[
n
]
.
x = [1,3,5,7];
[xe,xo] = LVEvenOdd(x)
recon=xe+xo,diff=x-recon
From the above we get xe = [4,4,4,4] and xo = [-3,-1,1,3], the sum of which is [1,3,5,7], i.e., the
original sequence x .
Another useful even/odd decomposition is defined such that
xe
[
n
]=
xe
[−
n
]
and
xo
[
n
]=−
xo
[−
n
]
Search WWH ::




Custom Search