Concepts / Fourier Basis Functions

Fourier Basis Functions

A multidimensional Fourier basis function is not a single independent cosine with one frequency for the whole state.

  • Programming

From Coordinates to Functions

A Fourier basis extends the idea of using cosine functions from one dimension to a multidimensional state space. The state space is a d-dimensional unit hypercube, and each state is represented by a vector. A basis function then combines one cosine component for every dimension, allowing cosine-based functions to represent functions over the entire state space.

Tracing a Frequency Choice

Now trace what happens when a frequency vector is chosen. Let c_i be an integer frequency vector with one component for each dimension. The component of c_i associated with a dimension selects the cosine frequency for that dimension. The dot product c_i · s gathers the frequency information across the dimensions, while the multidimensional basis function is built from the corresponding cosine components.

Worked example

Reading the vector (1, 0)

Interpret the frequency vector (1, 0)ᵀ for a two-dimensional state.

  1. 1
    Identify the dimensions

    There are two entries in the vector, so the vector assigns one frequency choice to each of two dimensions.

  2. 2
    Read the first entry

    The first entry is 1, so the first dimension receives the higher available frequency in this example.

  3. 3
    Read the second entry

    The second entry is 0, so the second dimension receives the zero frequency.

  4. 4
    Interpret the basis function

    The resulting basis function has one cosine component for the first dimension and one cosine component for the second dimension, using the frequencies selected by the two entries.

Result

The vector (1, 0)ᵀ selects a higher-frequency cosine component along the first dimension and a zero-frequency cosine component along the second dimension.

cᵢ(1, 0)ᵀDimension 1frequency 1Dimension 2frequency 0first entrysecond entry
How does each entry of an integer frequency vector select a cosine frequency for its corresponding dimension?

Multiplying One Cosine per Dimension

A multidimensional Fourier basis function is not a single independent cosine with one frequency for the whole state. It has one cosine component for each dimension. The frequency vector supplies the choice for each component, and the components are multiplied together to form one basis function over the multidimensional state space. In two dimensions, the construction combines a cosine for the first coordinate with a cosine for the second coordinate. In d dimensions, it combines d cosine components.

Cosine 1dimension 1Basis functionproduct of cosinecomponentsCosine 2dimension 2Cosine ddimension dmultiplymultiplymultiply
How do separate one-dimensional cosine functions combine into one basis function over a multidimensional state?
Key point

The frequency vector does not describe a new dimension. It supplies one frequency choice for each existing state-space dimension. The resulting basis function keeps the same number of cosine components as the state has dimensions.

Counting the Complete Basis

To count the basis functions, first list the allowed frequency values for one dimension. For an order-N basis, each frequency component can range from 0 through N. That gives N + 1 choices for each dimension. Because every dimension receives its own component of the frequency vector, the total number of possible frequency vectors, and therefore basis functions, is (N + 1)d.

0 through NN + 1 choicesDimension 1N + 1 choicesBasis functions(N + 1)^d Dimension 2N + 1 choicesDimension dN + 1 choiceschoose forchoose forchoose forcombine choicescombine choicescombine choices
How do the available choices in each dimension produce exactly (N + 1)d basis functions?
Worked example

An order-2 basis in three dimensions

Count the possible basis functions when d = 3 and the order is N = 2.

  1. 1
    Count choices per dimension

    Each frequency component can be 0, 1, or 2, so each dimension has 3 possible frequency choices.

  2. 2
    Combine the dimensions

    A frequency vector has one independently selected component for each of the three dimensions.

  3. 3
    Count all vectors

    The number of combinations is 3 multiplied by 3 multiplied by 3, which is 27.

Result

An order-2 basis in three dimensions contains 27 possible frequency vectors and therefore 27 basis functions.

Mistakes in Interpretation

  • Common mistake

    Treating the state vector as the frequency vector.

    What it looks like

    Reading s = (s₁, s₂)ᵀ as if it selected cosine frequencies.

    Why it fails

    The state vector describes the coordinates of a point in the unit hypercube. The integer vector c_i selects the cosine frequencies.

    Do this instead

    Use s for the state-space location and c_i for the per-dimension frequency choices.

  • Common mistake

    Using one frequency choice for the entire multidimensional state.

    What it looks like

    Describing a two-dimensional basis function with only one frequency value.

    Why it fails

    Each frequency vector has one component for each dimension.

    Do this instead

    Read one frequency component for dimension 1, one for dimension 2, and continue through dimension d.

  • Common mistake

    Counting only the allowed values instead of all combinations.

    What it looks like

    For d = 3 and N = 2, answering 3 instead of 27.

    Why it fails

    The value 3 counts choices for one dimension, not complete frequency vectors across three dimensions.

    Do this instead

    Multiply the N + 1 choices across all d dimensions, giving (N + 1)^d.

  • Common mistake

    Adding cosine components instead of using the product structure.

    What it looks like

    Interpreting the multidimensional basis as a sum of one cosine per dimension.

    Why it fails

    The basis function is formed as a product of cosine components, with one component for each dimension.

    Do this instead

    Track the cosine selected for every dimension and combine those components by multiplication.

Apply the Structure

MEDIUM

A state space has d = 2 dimensions, and an order-N basis uses N = 1. List the possible frequency vectors and explain what the vector (0, 1)ᵀ means for the two cosine components.

Hints
  • For N = 1, each component can be 0 or 1.
  • Build every two-entry combination from those choices.
  • The first entry belongs to the first dimension, and the second entry belongs to the second dimension.
  1. 1
    A d-dimensional unit hypercube represents each state with a vector whose components lie in [0, 1]. An integer frequency vector has one component per dimension and assigns the cosine frequency for that dimension. The corresponding Fourier basis function multiplies one cosine component per dimension. For order N, every component has N + 1 choices, so the complete basis contains (N + 1)d functions.

Key Takeaways

  • A state vector s records a point in a d-dimensional unit hypercube, with every component between 0 and 1.
  • An integer frequency vector c_i contains one frequency choice for each state-space dimension.
  • A multidimensional basis function is formed by multiplying one cosine component per dimension.
  • For order N, each frequency component has N + 1 choices, producing (N + 1)d basis functions.

Related concepts

More concepts starting with F