--- Quote Start ---
What are the I and Q in your equation sqrt(I^2 + Q^2)? Are they the real and imaginary values from the FFT source_real and source_imag?
--- Quote End ---
yes, I & Q are the special names in communications given to the two channels representing in effect a complex signal, I = inphase, Q=Qudrature.
--- Quote Start ---
Do I do the scaling with source_exp on both the source_real AND source_imag?
--- Quote End ---
you need to scale according to the way altera have done their IP.
I believe it is the output of fft that must be scaled...ofcourse, check the IP data sheet.
--- Quote Start ---
Also do I do the scaling before or after doing the sqrt(I^2 + Q^2)?
--- Quote End ---
In normal computation such as matlab you don't need any scaling. Altera simply left that for you. So for your hardware results yes do scaling first.
I checked the matlab output and it looks like your results:
your result .....................matlab fft real = zeros .....................same
imag(0) = 0 .....................same
imag(1) = -8192 ..............-1048576
imag(63) = +8192 ............+1048576
imag(others) = 0 ..............same
If you now multiply 8192 by 2^7 you get matlab result.
Your problem now is this: your final output value needs far more bits than just 16 signed so you need to divide down by truncation to a max of 32767 or less.
Your other case of having one sample just above zero ...etc. No don't do that. By doing that you are no longer having a proper sine in the sense of orthogonality in a complex vector.