&input n = 32 ! number of grid points c = 1. ! coefficient of cosine term s = 5. ! coefficient of sine term kc = 1 ! value of k in cosine term ks = 5 ! value of k in sine term / The function we are transforming is of the form: u = c * cos(kc * x) + s * sin(ks * x) over the region x = [0, 2*pi). To proceed, change the input values above, run the code (by typing ./x1 at the prompt in another window) and plot the results using gnuplot. I recommend gnuplot commands like: gnuplot> plot 'x1.x' w l gnuplot> plot 'x1.k' u 1:2 w i, 'x1.k' u 1:3 w i Try these cases: 1. n = 32, c = 1, s = 0, kc = 1, ks = 0 Look at the function in real space (plot 'x1.x') and then in the transform space. Do you understand the correspondence? Why does the kx axis extend to 16? 2. Try varying c. Make sure you understand the results in both the real and Fourier space. 3. Fix c = 1 and try varying kc. Do you understand the spectral plot? Why is the height of the bar different? 4. Set n=32, c=0., s=1., kc=1, ks=1. Do you understand the spectral plot? Why is the bar negative now? Can you figure out how to make it positive? 5. Try varying c, s, kc, and ks, always keeping kc and ks <= n/2. You should be able to predict the spectral plot with confidence now. 6. Keeping n=32, try this: c=1., s=0., kc=16, ks=1. What do you expect to happen if you increase kc further? Try it. This is the problem of aliasing. You should vary kc until you can predict the spectral plot with confidence.