T
T
ta42014-08-05 01:11:20
C++ / C#
ta4, 2014-08-05 01:11:20

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:
1.png
where
2.png
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

3 answer(s)
S
Sergey Lerg, 2014-08-05
@ta4

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.

J
jcmvbkbc, 2014-08-05
@jcmvbkbc

i is the imaginary unit. t, obviously, it makes sense to consider the interval from -T 0 /2 to T 0 /2.

T
ta4, 2014-08-05
@ta4

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; //тут скорее всего неверно сделано

Runs in a separate thread.
As a result, it draws like this:
but it is necessary like this:
62326_1.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question