Sparsity Representation of a Signal Using the DCT Matrix
If you know that your ($N\times 1$) signal $\mathbf x$ is supposed to be sparse when DCT-transformed, then your $\mathbf\Psi$ should be the IDCT (inverse DCT). Then your $\mathbf\theta$ will be in the DCT ("frequency") domain and your $\mathbf x$ will be in the "time" domain.

You basically have two options for implementing this:


If you are using this in a context where it is OK to use the DCT as a function instead of an actual matrix, this may be more efficient, as your programming environment's implementation of the DCT is most likely more efficient in terms of storage and computational complexity than explicitly doing the matrix-vector product. In this case, look for the idct function;

x = idct(theta);

If you must implement it with an actual matrix-vector product, you can obtain the matrix $\mathbf\Psi$ by transforming an identity matrix of the appropriate dimensions:

Psi = idct(eye(N));
x = Psi * theta;


Expect that operations involving Psi * theta will be slower and more memory-consuming than idct(theta).