I'm working on a project to make a one-port Vector Network analyzer. This device needs to be calibrated by Arduino, and for this I need to do a matrix multiplication and inversion with complex numbers in it. I'm using the Arduino Nano board but I'm planning on switching to the Arduino Nano 33 BLE Sense due to memory issues.
The gamma_m and gamma_a arrays are filled with values by for-loops that I've taken out to limit the code here.
The goal of this part of the code is to get the error coefficients e_00, e_11, and delta_e, they are stored in global arrays.
The error that I get is the following (on the line of C = {...}):
//no match for 'operator=' (operand types are 'BLA::Matrix<3, 3>' and '<brace-enclosed initializer list>')
It seems like the Basiclinearalgebra library doesn't cover the values of the matrices to be complex numbers. This project is my first experience with Arduino so I'm rather new to it.
Does anyone have a solution for my problem?
Is there a data type covering complex numbers? 'Changing the Element Type' is used to change the data type to e.g. int or double. As Complex isn't a datatype, it doesn't work and I don't know how I could go around it.
In C++, complex numbers are a class. You will have to check whether Arduino IDE supports them, but in any case, the AVR (Arduino Uno, Mega, etc.) libraries do not support "double" data type. It is treated as single precision floats, which is not good for some operations.
z1: Real = 0.00000000, Imag = 1.00000000
z2: Real = -1.00000000, Imag = 0.00000000
Of course, the AVR-based Arduinos don't support the STL. But, if I needed to do matrix math with complex numbers, an 8-bit AVR would not be my first choice anyway