In VHDL, all signals should be in integer. So let's modify the C source
to switch all variables from floating to fixed point.
|
|
(1) Type of integer in VC++
Type |
Bits |
Range |
char |
8 |
-128 to 128 |
short |
16 |
-32,768 to 32,767
|
long |
32 |
-2,147,483,648 to 2,147,483,647
|
int |
32 |
-2,147,483,648 to 2,147,483,647
|
long long |
64 |
-9,223,372,036 ,854,775,808 to
9,223,372,036 ,854,775,807
|
Note: this manner fits only in VC++.
(2) Why the range of input is only 32 ??
In 1024-point FFT, the result(spectrum) can be 1024 times bigger than the
input. So that, if you want to have the output in [-32768, +32768), the
input should be limited in [-32, +32).
|