- Input data is an array of complex
double-precision floating-point data, but the FFT core being modeled requires data in signed
two's-complement, fixed-point format with precision given by
C_INPUT_WIDTH. The data has a sign bit, then the binary point, then(C_INPUT_WIDTH- 1) fractional bits. The FFT MEX function checks the input data to see if it fits within this format and precision. If not, it prints a warning, and internally rounds it using convergent rounding (halfway values are rounded to the nearest even number) to the required precision. To accurately model the FFT core, prequantize the input data to this required precision before passing it to the model. This can be done using the MATLAB software built-in quantize function.Enter help quantizer/quantize or doc quantize on the MATLAB software command line for more information.
- Output data has the correct precision to model the FFT:
- If the FFT is scaled or has block floating-point (that is,
C_HAS_SCALING= 1,C_HAS_BFP= 0 or 1, respectively), output data is all in the range -1.0 ≤ data < +1.0, the precision isC_INPUT_WIDTHbits, withC_INPUT_WIDTH-1 fractional bits. For example, ifC_INPUT_WIDTH= 8, output data is precise to 2-7 = 0.0078125 and is in the range -1.0 to +0.9921875, and the binary representation of the output data has the format s.fffffff, where s is the sign bit and f is a fractional bit. - If the FFT is unscaled (
C_HAS_SCALING= 0), output data grows beyond ± 1.0, such that the binary point remains in the same place and there are still (C_INPUT_WIDTH- 1) fractional bits after the binary point. In total, the output precision is (C_INPUT_WIDTH+C_NFFT_MAX+ 1) bits. For example, ifC_INPUT_WIDTH= 8 andC_NFFT_MAX= 3, output data is precise to 2-7 = 0.0078125 and is in the range -16.0 to +15.9921875, and the binary representation of the output data has the format siiii.fffffff, where s is the sign bit, i is an integer bit, and f is a fractional bit.
- If the FFT is scaled or has block floating-point (that is,
-
blk_expis the integer block exponent. It is only valid (and non-zero) if block floating-point is used (that is,C_HAS_SCALING= 1 andC_HAS_BFP= 1). It indicates the total number of bits that intermediate values were shifted right during the FFT processing. For example, ifblk_exp= 5, the output data has been divided by 32 relative to the magnitude of the input data. -
overflowindicates if overflow occurred during the FFT processing. It is only valid (and non-zero) if fixed scaling is used (that is,C_HAS_SCALING= 1 andC_HAS_BFP= 0). A value of 0 indicates that overflow did not occur; a value of 1 indicates that overflow occurred at some stage in the FFT processing. To avoid overflow, increase the scaling at one or more stages in the scaling schedule (scaling_schinput). - If overflow occurred with the Pipelined, Streaming I/O architecture
(
C_ARCH= 3) due to differences between the FFT core and the model in the order of operations within the processing stage, the output data might not match theXK_REandXK_IMoutputs of the FFT core. The output data must be ignored if the overflow output is 1. This is the only case where the model is not entirely bit accurate to the core.