The Program
int r, i, s, t, max_coeff;
float h1[MAX], h2[MAX], g[MAX];
printf("Invalid resolution!\n");
for(s = 0; s <= max_coeff; ++s) {
h1[s] += g[t] * cos(scale*s*t);
h2[s] += g[t] * sin(scale*s*t);
printf("\n\nSpectrum:\n");
for(i = 1; i <= max_coeff; ++i)
sqrt(h1[i]*h1[i] + h2[i]*h2[i]) );
This is the program pg241.c