Complex number operations in dq format. More...
#include "IQConstants.h"
Go to the source code of this file.
Defines | |
#define | MAG_QD(in) (_IQmag(in.q,in.d)) |
#define | MAG_QD_NDATA(in, n) (_IQmag(in.q[n],in.d[n])) |
#define | MAG_QD_DATA(in, out) |
#define | SQR_QD(in) (_IQmpy(in.q,in.q)+_IQmpy(in.d,in.d)) |
#define | SQR_QD_NDATA(in, n) (_IQmpy(in.q[n],in.q[n])+_IQmpy(in.d[n],in.d[n])) |
#define | SQR_QD_DATA(in, out) |
#define | SUM_QD(s1, s2, out) {out.q=s1.q+s2.q;out.d=s1.d+s2.d;} |
#define | SUM_QD_NDATA(s1, s2, out, n) {out.q[n]=s1.q[n]+s2.q[n];out.d[n]=s1.d[n]+s2.d[n];} |
#define | SUM_QD_DATA(s1, s2, out) |
#define | DIFF_QD(s1, s2, out) {out.q=s1.q-s2.q;out.d=s1.d-s2.d;} |
#define | DIFF_QD_NDATA(s1, s2, out, n) {out.q[n]=s1.q[n]-s2.q[n];out.d[n]=s1.d[n]-s2.d[n];} |
#define | DIFF_QD_DATA(s1, s2, out) |
#define | INV_QD(in, out) {out.q=_IQdiv(_IQ(1),in.q);out.d=_IQdiv(_IQ(1),in.d);} |
#define | MULT_REAL(dq, sc, out) {out.q=_IQmpy(dq.q,sc);out.d=_IQmpy(dq.d,sc);} |
#define | _NEG_QD(in) {in.q=-in.q;in.d=-in.d;} |
#define | NEG_QD(in, out) {out.q=-in.q;out.d=-in.d;} |
#define | ASSIGN_QD(in, out) {out.q=in.q;out.d=in.d;} |
#define | SIGN(in) (1+((in & (long)0x80000000)>>30)) |
#define | MAKE_QD(real, imag, out) out.d=real; out.q=imag |
#define | REAL_QD(in) (in.d) |
#define | IMAG_QD(in) (in.q) |
#define | REAL_QD_DATA(in) (in.d[N]) |
#define | IMAG_QD_DATA(in) (in.q[N]) |
#define | MODARG2QD(mod, arg, out) |
#define | MODARG2QD_NDATA(mod, arg, out, n) |
#define | MODARG2QD_DATA(mod, arg, out) |
#define | _CONJ_QD(in) in.q=-in.q |
#define | CONJ_QD(in, out) {out.d=in.d;out.q=-in.q;} |
#define | CONJ_QD_NDATA(in, out, n) {out.d[n]=in.d[n];out.q[n]=-in.q[n];} |
#define | CONJ_QD_DATA(in, out) |
#define | _PHASE_QD(in) (_IQatan2(in.q,in.d)) |
#define | PHASE_QD(in, out) out= _PHASE_QD(in); |
#define | PHASE_QD_NDATA(in, n) (_IQatan2(in.q[n],in.d[n])) |
#define | PHASE_QD_DATA(in, out) |
#define | TIMES_D(s1, s2) (_IQmpy(s1.d,s2.d)-_IQmpy(s1.q,s2.q)) |
#define | TIMES_Q(s1, s2) (_IQmpy(s1.q,s2.d)+_IQmpy(s1.d,s2.q)) |
#define | TIMES_QD(s1, s2, out) out.d=TIMES_D(s1,s2);out.q=TIMES_Q(s1,s2) |
#define | TIMES_D_DATA(s1, s2, n) (_IQmpy(s1.d[n],s2.d[n])-_IQmpy(s1.q[n],s2.q[n])) |
#define | TIMES_Q_DATA(s1, s2, n) (_IQmpy(s1.q[n],s2.d[n])+_IQmpy(s1.d[n],s2.q[n])) |
#define | TIMES_QD_NDATA(s1, s2, out, n) |
#define | TIMES_QD_DATA(s1, s2, out) |
#define | SQRT_QD(in, out) |
#define | DIV_QD(s1, s2, temp, out) |
#define | DIV_QD_DATA(s1, s2, temp, out) |
Complex number operations in dq format.
File Name : QDOperations.h Project : TIMotorLIB
TI Doc: na
Definition in file QDOperations.h.
#define _NEG_QD | ( | in | ) | {in.q=-in.q;in.d=-in.d;} |
negate variable
Definition at line 153 of file QDOperations.h.
#define ASSIGN_QD | ( | in, | |||
out | ) | {out.q=in.q;out.d=in.d;} |
assign in variable to out variable
Definition at line 159 of file QDOperations.h.
#define INV_QD | ( | in, | |||
out | ) | {out.q=_IQdiv(_IQ(1),in.q);out.d=_IQdiv(_IQ(1),in.d);} |
Calculate the inverse of qd variable
Definition at line 143 of file QDOperations.h.
#define MAKE_QD | ( | real, | |||
imag, | |||||
out | ) | out.d=real; out.q=imag |
make qd variable from real and imag components
Definition at line 224 of file QDOperations.h.
#define MULT_REAL | ( | dq, | |||
sc, | |||||
out | ) | {out.q=_IQmpy(dq.q,sc);out.d=_IQmpy(dq.d,sc);} |
Multiplication of qd variable and sc real value
Definition at line 148 of file QDOperations.h.
#define NEG_QD | ( | in, | |||
out | ) | {out.q=-in.q;out.d=-in.d;} |
Definition at line 154 of file QDOperations.h.
#define SIGN | ( | in | ) | (1+((in & (long)0x80000000)>>30)) |
obtain sign of _iq variable. It returns 1 if positive and -1 if negative
Definition at line 164 of file QDOperations.h.