Skip to article frontmatterSkip to article content

4.1 Orthogonal and Orthonormal Bases

Orthogonal bases make computing easy

Dept. of Electrical and Systems Engineering
University of Pennsylvania

Binder

Lecture notes

1Reading

Material related to this page, as well as additional exercises, can be found in ALA 4.1.

2Learning Objectives

By the end of this page, you should know:

  • orthogonal and orthonormal basis and their examples
  • how to check if a basis is orthogonal and orthonormal
  • to write coordinates of a vector in orthogonal and orthonormal basis

3Orthogonality

Orthogonality is a generalization/abstraction of perpendicularity (right angles) to general inner product spaces. Algorithms using orthogonality are at the core of modern linear algebra, and include the Gram-Schmidt algorithm, the QR decomposition, and the least-squares algorithm, all of which we shall see in this lecture.

More abstract applications of orthogonality, that you will see for example, in ESE 2240 include the Discrete Cosine Transform (DCT) and Discrete Fourier Transform (DFT), algorithms that lie at the heart of modern digital media (e.g., JPEG image compression and MP3 audio compression).

4Orthogonal and Orthonormal Bases

Let VV be an inner product space (as usual, we assign that the scalars over which VV is defined are real valued). Remember that v,wV\vv v, \vv w \in V are orthogonal if v,w=0\langle \vv v, \vv w\rangle = 0. If v,wRn\vv v, \vv w \in \mathbb{R}^n and v,w=vw\langle \vv v, \vv w\rangle = \vv v \cdot \vv w is the dot product, this simply means that v\vv v and w\vv w are perpendicular (meet at a right angle).

Orthogonal vectors are useful, because they point in completely different directions, making them particularly well-suited for defining bases. Orthogonal vectors give rise to the concept of an orthogonal basis.

If each basis vector in an orthogonal basis is a unit vector (has norm equal to one), then they form a special type of orthogonal basis known as an orthonormal basis.

A simply way to construct an orthonormal basis from an orthogonal basis is to normalize each of its elements, that is, to replace each basis element bi\vv{b_i} with its normalized counterpart bibi\frac{\vv{b_i}}{\|\vv{b_i}\|}. As an exercise, can you formally verify that b1b1,...,bnbn\frac{\vv{b_1}}{\|\vv{b_1}\|}, ..., \frac{\vv{b_n}}{\|\vv{b_n}\|} is an orthonormal basis for if b1,...,bn\vv{b_1}, ..., \vv{b_n} is an orthogonal one? Can you explain why rescaling each entry does not affect the mutual orthogonality of this set?

4.1Python break!

In the following code, we demonstrate how to normalize a set of vectors (an orthogonal basis) represented in a matrix using np.linalg.norm, so that we obtain a normalized set of vectors (an orthonormal basis).

# Normalizing

import numpy as np

b = np.array([[1, 0, 5],
              [2, 1, -2],
              [-1, 2, 1]])
print("The basis represented as a matrix: \n", b)

b_norm = np.linalg.norm(b, axis=0) # notice across what axis we are computing the norm
b_normalized = b / b_norm # Dividing a matrix by a vector!!!

print("Normalized basis: \n", b_normalized)

print("Norm of each basis vector: \n", np.linalg.norm(b_normalized, axis=0))
The basis represented as a matrix: 
 [[ 1  0  5]
 [ 2  1 -2]
 [-1  2  1]]
Normalized basis: 
 [[ 0.40824829  0.          0.91287093]
 [ 0.81649658  0.4472136  -0.36514837]
 [-0.40824829  0.89442719  0.18257419]]
Norm of each basis vector: 
 [1. 1. 1.]

5Working in Orthogonal Bases

So why do we care about orthogonal (or even better, orthonormal) bases? Turns out they make a lot of the computations that we’ve been doign so far MUCH easier.

We’ll start with some important properties of computing a vector’s coordinates with respect to an orthogonal basis.

A very small change to the above allows us to extend these ideas to orthogonal, but not orthonormal, bases:

Binder