AN 464: DFT/IDFT Reference Design

ID 683644
Date 5/30/2018

Fixed-Point Model Parameters

The simple_dft_example.m file defines the parameters for the DFT/IDFT Reference Design fixed-point model.

The following pairs of columns are from left to right:

  1. Input data
  2. Model block Floating Point output.
  3. Model integer output.
  4. MATLAB output.
  5. Absolute Difference between the Model and MATLAB outputs
  6. Percentage difference between the Model and MATLAB outputs.

In each pair of columns the left hand column is the real data and the right hand column is the imaginary data. All data is in normal order with time 0 and bin 0 on the first row.

The model and the reference design do not perform 1/length scaling when in IDFT mode, so the 1/length scaling is removed from the MATLAB results by multiplying all samples by the length.

Table 4.  Model Output Parameters
Variable Name Type Description
vec_out Array of complex integers Complex output array in normal order (provided disable_reordering = 0) Array length is the same as input array 'vec'
blk_exponent Integer (–127 to +127)

Exponent value common to all values in output array


If you use the model for system modelling without reference to the RTL, set invert_sign_of_exponent to 0 so that the ouput sample values are:

vec_out× 2b l k_ex pone nt

Table 5.  Model Input Parameters
Variable Name Type Default Value 1 Description
vec Array of complex integers Input array to be transformed. The model performs a transform of length equal to the input array length. The array length must be one of the 34 lengths.
model_is_fixed_point 0 or 1 1 0 = double precision model; 1 = fixed point model.
idft_mode 0 or 1 0 = DFT; 1 = IDFT.
B_top Integer 14 to 24 T_top2 Butterfly coefficient precision in bits.
D_top Integer 14 to 24 RAM data path width in bits. This value is also the input data width and the mantissa width of the output samples.
T_top Integer 14 to 24 Twiddle coefficient precision in bits.
bfly_mult_convergent_mode 0 or 1 1

Rounding mode at outputs of butterfly complex multipliers:

0 = symetrical round-up

1 = convergent rounding

tw_mult_convergent_mode 0 or 1 1

Rounding mode at outputs of twiddle complex multipliers:

0 = symetrical round up

1 = convergent rounding 3

limit_bfp_mux_size 0 or 1 1

0 = BFP scaling is done to the full precision of width D_top width. 1 = BFP scaling is limited to

max_num_of_bfp_msb_shift_b itsbits down from the MSB. 3

max_num_of_bfp_msb_shift_ bits

2 to

(D_top– 1)

3 BFP scaler size. 3
skip_bfp_on_last_pass 0 or 1 1 0 = BFP scaling is performed on all reads from data RAM; 1= BFP scaling is omitted for the last read from data RAM. 3
1 Typical settings to use when running the model or default value that you should use so that the model matches the RTL behavior.
2 In the RTL, the value of B_top is always equal to the value set for T_top.
3 These parameters are only valid for fixed_point_model = 1.