The main error in your calc was that you used f instead of omega in the computation of the symbolic transform values. Once this is fixed, the freq scaling error between the symbolic and numeric disappears. See attached.
I also changed the positioning variable "a" to be a fraction of the overall time period, rather than depend directly on the index (number of pts). In general, I find it much more useful and less confusing to set up problems so that the quantization from continuous to discrete - setting the number of pts - is done so that the computation is always done on the basis of quantities that have meanig to the problem - time,volts, length, etc - rather than directly as a function of some index. The attached is set up now so that you can vary the number of points without affecting most parameters. I also added a DC offset term.
I created some plots at the bottom whcih concatenate three periods of time and freq domain info, so you can see how the sections match at the edges. I always find this useful when trying to interpret DFT results.
Using the cfft (or CFFT, which differs only in the amplitude scaling) as you did here, allows the use of arbitrary number of pts, not just powers of two. Try N0=28, and notice the repeated time waveform at the bottom which is almost sinusoidal, and the corresponding spectrum. Them try setting DC = -0.5 to remove the offset, and notice that only the fundamental complex freqs (f=-1, +1) are significant, as we would expect.
Lou