# Complex format signal source block

**URL:** <https://www.ruby-forum.com/t/complex-format-signal-source-block/220422>\
**Category:** GNU Radio\
**Created:** [June 8, 2012, 6:46pm UTC](https://www.ruby-forum.com/t/complex-format-signal-source-block/220422 "2012-06-08T18:46:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 8, 2012, 6:46pm UTC](https://www.ruby-forum.com/t/complex-format-signal-source-block/220422/1 "2012-06-08T18:46:28Z")

</div>

Hi community,

I have a basic question when simulating and displaying complex signals  
Gnu  
Radio (GRC 3.5.1). I tried to solve them by myself but they are not yet  
clear to me. I am simply using the signal source block, generating some  
signals, and visualizing them with a scope block. By using the float  
format  
everything is fine. However, troubles come when using and interpreting  
the  
complex format:

1. 

Firstly, books say that In-phase and Quadrature components are lowpass  
and  
related with the complex envelope of the signal,  
i.e., let’s suppose a real signal s(t), it’s complex envelope will be:

s\_complex\_envelope(t) = si(t) + j\*sq(t) ; being si(t) and sq(t) the  
in-phase and quadrature components, respectively.

For a simple cosine wave s(t) = cos(wt) I think si(t) = 1 for all t and  
sq(t) = 0, provided that s(t) = si(t) \* cos(wt) - sq(t) \* sin(wt)

I think the source block outputs the “pre-envelope” or analytic signal,  
which is the complex envelope shifted at w, being w the carrier  
frequency.  
Questions:

a. I think I am correct when I interpret channels 1-2 in the scope block  
as  
the real and imaginary parts of the analytic signal, which are NOT the  
in-phase and quadrature components of the signal.  
However, Am I wrong about what I said related with the in-phase and  
quadrature components of a cosine wave. To get the in-phase and  
quadrature  
components of a cosine wave I tried the grc scheme shown in the attached  
“I\_Q\_components\_cosine.png”. In this case, I expected channel 1 = 1  
(in-phase component) and channel 2 = 0 (quadrature component), however  
nothing appears. Am I wrong in my understanding?. How could I get the  
in-phase and quadrature components of a cosine wave?

1. 

I think, as I said in 1, that the block source outputs the pre-envelope  
(analytic signal). So, when I select a cosine wave in the block it is  
the  
same as selecting a “complex exponential”, i.e. s(t) = exp(jwt) =  
cos(wt) +  
j\*sin(wt),  
being sin(wt) the Hilbert transform of cos(wt). If I select a sine wave  
in  
the block source I can see in the scope block sin(wt) - j \* cos(wt),  
being  
-cos(wt) the Hilbert transform sin(wt). Thus, both cases seems logical.  
Questions:

a. When displaying the channels 1-2 of a cosine function and using the T  
Offsset option in the scope to see the waveform at time = 0, I should  
see  
the values of cos(w_0) = 1 for channel 1 and sin(w_0) = 0 for channel  
two.  
Why it seems channel 1 and 2 are delayed? (see figure  
“analytic\_cosine\_wave.png”)

b. Why when I select the square waveform in the source block (with  
complex  
format) I see in channel 2 the squared waveform delayed instead of its  
Hilbert transform (see “square\_wave.png”)?

Thanks in advance,

–Mario

References: Skatz Tutorial 4 in  
[http://www.csun.edu/~skatz/katzpage/sdr\_project/sdrproject.html](http://www.csun.edu/~skatz/katzpage/sdr_project/sdrproject.html)
