###### Exercise3

The Fourier transform that we used in this section is often called the Discrete Fourier Cosine Transform because it is defined using a basis $$\ccal$$ consisting of cosine functions. There is also a Fourier Sine Transform defined using a basis $$\scal$$ consisting of sine functions. For instance, in $$\real^4\text{,}$$ the basis vectors of $$\scal$$ are

\begin{equation*} \begin{aligned} \vvec_1 = \left[\begin{array}{c} \sin\left(\frac{1\cdot1\pi}{8}\right) \\ \sin\left(\frac{3\cdot1\pi}{8}\right) \\ \sin\left(\frac{5\cdot1\pi}{8}\right) \\ \sin\left(\frac{7\cdot1\pi}{8}\right) \\ \end{array}\right], \amp \vvec_2 = \left[\begin{array}{c} \sin\left(\frac{1\cdot2\pi}{8}\right) \\ \sin\left(\frac{3\cdot2\pi}{8}\right) \\ \sin\left(\frac{5\cdot2\pi}{8}\right) \\ \sin\left(\frac{7\cdot2\pi}{8}\right) \\ \end{array}\right], \\ \\ \vvec_3 = \left[\begin{array}{c} \sin\left(\frac{1\cdot3\pi}{8}\right) \\ \sin\left(\frac{3\cdot3\pi}{8}\right) \\ \sin\left(\frac{5\cdot3\pi}{8}\right) \\ \sin\left(\frac{7\cdot3\pi}{8}\right) \\ \end{array}\right], \amp \vvec_4 = \left[\begin{array}{c} \sin\left(\frac{1\cdot4\pi}{8}\right) \\ \sin\left(\frac{3\cdot4\pi}{8}\right) \\ \sin\left(\frac{5\cdot4\pi}{8}\right) \\ \sin\left(\frac{7\cdot4\pi}{8}\right) \\ \end{array}\right]\text{.} \\ \end{aligned} \end{equation*}

We can think of these vectors graphically, as shown in FigureĀ 3.3.10.

1. The Sage cell below defines the matrix S whose columns are the vectors in the basis $$\scal$$ as well as the matrix C whose columns form the basis $$\ccal$$ used in the Fourier Cosine Transform.

In the $$8\times8$$ block of luminance values we considered in this section, the first column begins with the four entries 176, 181, 165, and 139, as seen in FigureĀ 3.3.6. These form the vector $$\xvec=\fourvec{176}{181}{165}{139}\text{.}$$ Find both $$\coords{\xvec}{\scal}$$ and $$\coords{\xvec}{\ccal}\text{.}$$

2. Write a sentence or two comparing the values for the Fourier Sine coefficients $$\coords{\xvec}{\scal}$$ and the Fourier Cosine coefficients $$\coords{\xvec}{\ccal}\text{.}$$

3. Suppose now that $$\xvec=\fourvec{100}{100}{100}{100}\text{.}$$ Find the Fourier Sine coefficients $$\coords{\xvec}{\scal}$$ and the Fourie Cosine coefficients $$\coords{\xvec}{\ccal}\text{.}$$

4. Write a few sentences explaining why we use the Fourier Cosine Transform in the JPEG compression algorithm rather than the Fourier Sine Transform.

in-context