Has somebody developed a comprehensive theory of the algebraic structure of trigonometric polynomials in several variables? If yes, where?

**Background:**

By a (real) trigonometric polynomial in $d$-variables, I mean a map $\mathbb{T}^d \to \mathbb{R}$ that is given by an expression of the form $$ f(x) = \sum_{|k| \leq K} \hat{f}(k) \exp(2\pi\mathrm{i} k\cdot x) $$ where $k \in \mathbb{Z}^d$ and $|k| = \sup_{j=1,\dots,d} |k_j|$. Also $\mathbb{T} = \mathbb{R}/\mathbb{Z}$.

These trigonometric polynomials have many of the properties of usual polynomials, but are NOT polynomials. So as far as I know it, one cannot apply the usual algebraic-geometry constructions.

An example of a result, I would be interested in is: Given polynomials $f_1, \dots, f_{\ell}$ how does the dimension of their zero locus $$ \{x \in \mathbb{T}^d:\quad f_j(x) = 0,\quad j=1,\dots,\ell\} $$ relate to the ideal generated by these polynomials?

**One approach**

In the Annals paper by Bourgain and Goldstein, a hint of how to do this is given. Write $$ \exp(2\pi\mathrm{i} k \cdot x) = \prod_{j=1}^{d} \exp(2\pi\mathrm{i} x_j)^{k_j}. $$ Using that $\exp(2\pi\mathrm{i} x_j) = \cos(2\pi x_j) + \mathrm{i} \sin(2\pi x_j)$, one can write a trigonometric polynomial as a honest polynomial in the $2 d$ variables $C_j = \cos(2\pi x_j)$ and $S_j = \sin(2\pi x_j)$. A computation shows that this is a honest polynomial with real coefficients. Call this polynomial $\tilde{f}$.

These set from the previous example can then be described as the zero locus of the polynomials $\tilde{f}_j$ and the polynomials $$ (C_j)^2 + (S_j)^2 = 1. $$

It seems to me that using this approach one can more or less carry over most results, but I am not very good at algebra, so I might miss subtleties. It would be nice if there was some work out of these things by somebody in the field.