Answer the question
In order to leave comments, you need to log in
How to programmatically generate a simple rectangular radio pulse?
They gave the task: to generate a signal: a simple rectangular radio pulse. It needs to be done in C++
. I found an expression that describes this signal:
where
I can't figure out what i is in the formula. E - amplitude. I still can’t understand what should be equal to t at the beginning and what is the gain. If anyone knows, please explain.
Answer the question
In order to leave comments, you need to log in
The formula uses Euler's formula to write orthogonal sine and cosine in complex form.
You only need the real part.
In fact, you are just drawing a sinusoid of duration T.
i is the imaginary unit. t, obviously, it makes sense to consider the interval from -T 0 /2 to T 0 /2.
this is how I transferred the formula to c++
if(qAbs(time)>T/2)
{
u = 0;
}
else
{
u = 1*qExp(2*3.1415/T*time);
}
time+=0.1;
if(time>T/2) time = -T/2; //тут скорее всего неверно сделано
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question