-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output scaling factor #15
Comments
The output scales at one additional bit for every two stages. This is based upon two principles:
Therefore, the FFT drops one bit every other stage. This minimizes the computational power required, at no loss of relevant precision. Dan |
Hello Dan, Following that logic, the output scale should be calculated according to Now, if I understand the source code correctly, the first stage never drops a bit, so only the 3rd, 5th, etc. What is now still unclear to me, is the fact that is sometime "un-drops" a bit, according to the scale factors I found. So I guess there is some other condition that affects the scale factor. Do you know what am I missing here? Thanks and best regards, |
Hello!
In the spec, it is mentioned that the core calculates the regular DFT "to within a scale factor".
After trying out the FFT core with several different configurations, it is not quite clear to me what this scaling factor is or where it comes from.
As a reference, I compared the FFT core's results to a Python FFT (NumPy, as well as a manual DFT loop) and came to the following conclusion:
(Command for core generation:
fft-gen -f F -n N -p 1024 -x 4
)The output bitwith was not manually capped, so the generator decided how many bits are required. The same test was performed with an input bitwidth of 16, leading to the same scale factors. So I assume that these are deterministic and due to them being all factors of 2, I also assume that they are the result of certain implementation details (shifting, truncating, etc.).
Unfortunately, I didn't find more information on that topic in other issues, the blog post, spec, or README.
Would it be possible to elaborate on that?
I'm also a little bit surprised that no one already mentioned this since it seems pretty important to me to have the correct scaling factor in order to get "correct" results (i.e.: the same as in a co-simulation, for example).
Thanks a lot!
The text was updated successfully, but these errors were encountered: