implementing complex multiplication in simulink
38 views (last 30 days)
Pratheek Punchathody on 23 Apr 2021
Using the MATLAB Function block, we can create a complex multiplication block with the required number of inputs.
Create a functional block in simulink, by double clicking on this function block write the below function which takes 2 real inputs and 2 imaginary inputs.
function y = fcn(a,b,c,d) %a,c are real inputs and b,d are imaginary inputs
y = c1*c2; % performing multiplication
The following MATLAB function block is created with 2 real inputs and 2 imaginary inputs. The multiplication operation of the two complex numbers are performed and the output is shown with the variable y.
Hope this helps..!
Kiran Kintali on 9 May 2023
For HDL Code Generation you can use the Simulink and MATLAB function examples shown below.
These examples use FPGA/ASIC friendly full precision intermediate products in the complex multiplication.
>> Simulink start page / HDL Coder templates section
Walter Roberson on 9 May 2023
You can use blocks to combine each real component with its corresponding imaginary component. Then you can use a Product block https://www.mathworks.com/help/simulink/slref/product.html . Just be sure not to set the output signal type to Inherit: Keep MSB, or to Inherit: Match Scaling, as those two do not support complex signals.
Code Generation HDL Coder HDL Code Generation from Simulink Speed and Area Optimization Speed Optimization