I would like to ask how to perform phase rotating in the wave form.
I know that I need to multiply by j - imaginary number to rotate for 90 degree, and j^2 to rotate 180 degree, and j^3 for 270 degree and so on.
But it takes me to 3 questions:
what should I multiply by to get some between 90 degree angles, for example 45 degree or 60 degree?
what exactly should I multiply by j? Each sample of the wave? I am not sure, because each sample of wave is real component but for multiplying by j I need complex form, need I? If yes, how to get complex form from each sample of real wave? Do I need perform DFT and then inverse DFT? It seems to be too processor consuming for such thing, but maybe it’s necassery?
How exactly multiply by j in C++. I know there is
std::complexvariables, but I see only access to real number, like
someComplex.real()and imaginary number by calling
someComplex.imag()But it gives me just value that stand next to j. But how to get just j? That I can use in multiplication, like
j*sameWave[sample]? I tried to derclare
int i = pow(sqrt(-1));but obviously it doesn’t work.
Please help. Thanks in advance