Simulating Fixed-Point Filters (Digital Filter Design Toolkit)
After you create a fixed-point filter model, you must simulate the filtering process to verify that the fixed-point model works as expected in a complete implementation. You can use the DFD FXP Simulation VI and the DFD FXP Simulation with State VI to facilitate this evaluation. To verify the simulation result, you can use the following two options:
- Compare the simulation results with the filter output results that you obtain by processing the same signal with the reference floating-point filter. Ensure that the simulation results are sufficiently similar to the filtering results of the reference floating-point filter.
- Use the DFD FXP Simulation Report VI to monitor the behavior of the fixed-point filter during the simulation process by observing the filtering text report output. The report contains statistical information about all the quantizers—except the coefficients a/k and coefficients b/v quantizers—in the fixed-point model. Each quantizer has five data entries: max value, min value, #overflows, #underflows, and #operations. Ensure that both #overflows and #underflows equal 0 or fall below an appropriate threshold.
Like all other parts of the design process, simulation is a trial-and-error process. If you observe overflow or underflow in the filtering text report or if the simulation result does not match the actual floating-point filtering result, try making the following adjustments:
- Return to the modeling step. Modify the integer word lengths for the related quantizers to eliminate overflows and underflows until both #overflows and #underflows equal 0 or fall below an appropriate threshold. Use max value and min value to estimate the integer word lengths.
Tip The DFD FXP Modeling VI automatically calculates the integer word lengths so you cannot modify them directly. However, you can use the DFD FXP Get Quantizer VI to retrieve the integer word lengths for the related quantizers and then use the DFD FXP Set Quantizer VI to modify the integer word lengths. - Change the implementation structure.
- Adjust the specifications and redesign the floating-point filter.
Note In the filtering text report, the #operations entry for the product and sum quantizers provides information about the computational requirements of the fixed-point filter. A smaller value implies a faster computational speed. If several filter structures satisfy the performance requirements of the filter, select the filter structure whose product quantizer has the smallest #operations value. |
Refer to the Lowpass_Step 4_Model and Simulate FXP Lowpass VI in the labview\examples\Digital Filter Design\Case Studies\Single-Rate Filter directory for an example that demonstrates how to create a fixed-point model of a lowpass filter and simulate the filtering result.