Created by Dr. V. R. Ratnaparkhe
Signals & SystemsVirtual Laboratory
Experiment 05 · Signals & Systems Lab

Even and Odd Decomposition

Split five different signals into even and odd parts and check against theory.

SymmetryDecompositionCO 1-3

Aim

Extract the even and odd parts of five different signals and compare them with the theoretical results.

Objectives

  • Define even and odd symmetry for discrete signals.
  • Compute xe[n] and xo[n] from x[n] and x[−n].
  • Check that x = xe + xo and that Ex = Ee + Eo.
  • Compare computed parts with closed-form answers for 5 standard signals.

Definitions

Even: x[−n] = x[n] (mirror-symmetric about n = 0) Odd: x[−n] = −x[n] (anti-symmetric; x[0] must be 0) x_e[n] = ½ { x[n] + x[−n] } x_o[n] = ½ { x[n] − x[−n] } x[n] = x_e[n] + x_o[n]

Every signal can be split into one even part and one odd part, and the split is unique. The even and odd parts are orthogonal: Σ xe[n]·xo[n] = 0. So the energies simply add.

Animation: building the parts

x[n] (green) is mirrored to x[−n] (blue). Their half-sum gives xe and their half-difference gives xo.

Theoretical results for the five test signals

#x[n]xe[n]xo[n]
1u[n]½ + ½δ[n]½·sgn[n]
2aⁿu[n]½a|n| + ½δ[n]½·sgn[n]·a|n|
3n·u[n] (ramp)|n|/2n/2
4cos(ω₀n) + sin(ω₀n)cos(ω₀n)sin(ω₀n)
5δ[n−2] + 2δ[n+1]½δ[n−2] + ½δ[n+2] + δ[n+1] + δ[n−1]½δ[n−2] − ½δ[n+2] + δ[n+1] − δ[n−1]
sgn[n] = 1 for n > 0, 0 for n = 0, and −1 for n < 0.
  1. Choose Signal 1 in the Simulator. Use a symmetric index range (−N…N) so that x[−n] is defined everywhere.
  2. Press ▶ Animate decomposition to see the fold, the half-sum and the half-difference.
  3. Read the max |computed − theory| values for xe and xo. They should be 0.
  4. Repeat for signals 2–5. For signal 2, change a; for signal 4, change ω₀.
  5. Type your own sequence (Custom). Before you look, predict whether it is even, odd or neither.
  6. Record each signal. In "Observed" type the value of xe[1] you worked out by hand.
If your MATLAB index range is not symmetric, pad with zeros first. Otherwise fliplr(x) does NOT give x[−n].

Pre-lab diagnostic

Signal

x[n]
x[−n]
x_e[n] computed (●) vs theory (○)
x_o[n] computed (●) vs theory (○)
Check: x_e + x_o (●) on top of x[n] (○)
AudioAn even signal sounds the same played backwards. An odd one mirrors with its pitch flipped about the middle.

Comparison table

Analysis

Post-lab quiz

Self-evaluation

exp5_evenodd.m

%% Experiment 5: Even and odd parts of signals
clc; clear; close all;
n = -10:10;                                  % symmetric range!
X = { (n>=0), 0.8.^n.*(n>=0), n.*(n>=0), cos(pi*n/5)+sin(pi*n/5), (n==2)+2*(n==-1) };
names = {'u[n]','0.8^n u[n]','n u[n]','cos+sin','impulses'};
for k = 1:5
  x  = X{k};  xr = fliplr(x);                % x[-n]
  xe = (x + xr)/2;  xo = (x - xr)/2;
  figure('Name',names{k});
  subplot(3,1,1); stem(n,x);  title(['x[n] = ' names{k}]);
  subplot(3,1,2); stem(n,xe); title('even part');
  subplot(3,1,3); stem(n,xo); title('odd part');
  fprintf('%-10s  max|x-(xe+xo)| = %g   Ee+Eo-Ex = %g\n', names{k}, ...
          max(abs(x-(xe+xo))), sum(xe.^2)+sum(xo.^2)-sum(x.^2));
end