06-14-2023 12:37 PM
Hello everyone,
I would like to learn how to create a discrete transfer function using LabVIEW FPGA Module.Before I used niFpga Discrete Transfer Function Direct.vi but i am not sure that the function works correctly or not. In addition, i tried same transfer function on MATLAB-Simulink program. LabVIEW and MATLAB results are different from each other. Please if you have any idea about using niFpga Discrete Transfer Function Direct.vi, share with me.
06-14-2023 01:46 PM
Can you provide more details on what you have tried? Maybe upload code examples?
06-15-2023 04:50 AM - edited 06-15-2023 04:52 AM
Hi Terry,
Thanks for your reply. I couldn't run fpga codes since there is no hardware at the now. Because of this I will share the code. Actually, there is a discrete transfer function block in my code. While the LabVIEW code is running, the results differ from MATLAB Simulink model. The transfer function is same, but results are different from each other for each input.
I tried same transfer function block at LabVIEW Real Time Module. MATLAB and Real time module transfer function results are same but not fpga module. I couldn't understand the reason of this. At real time module, I used Control and Simulation loop.
I hope this info helps you.
MATLAB SIMULINK TRANSFER FUNCTION BLOCKS AND OUTPUT
LABVIEW FPGA CODE
LABVIEW REAL TIME CODE
06-16-2023 10:30 AM
What do the fixed point results look like?
I would expect a difference in the above code.
One is floating point and the other is fixed point. You want to add fixed point to the floating point case as follows:
On https://www.ni.com/en-us/support/documentation/supplemental/11/an-introduction-to-high-throughput-ds... see the picture under the text "In order to coerce the floating point representation to a fixed-point resolution and dynamic range, simply convert to a specific fixed point representation (grey), then back to floating point (orange)."
This allows you to operate with floating point data but passing through the fixed point conversion should make it effectively fixed point.