# Editing IQ Complex Tutorial

**Warning:** You are not logged in. Your IP address will be publicly visible if you make any edits. If you **log in** or **create an account**, your edits will be attributed to your username, along with other benefits.

The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision | Your text | ||

Line 1: | Line 1: | ||

<!-- IQ_complex_Signal_Tutorial --> | <!-- IQ_complex_Signal_Tutorial --> | ||

− | This tutorial originates from discussions on discuss-gnuradio@gnu.org. We will explain why simulating digital communications requires equivalent baseband representation of | + | This tutorial originates from discussions on discuss-gnuradio@gnu.org. We will explain why simulating digital communications requires equivalent baseband representation of signal which in fact are complex signals. For this unique reason, complex signals are essential in GNURadio. |

− | This tutorial is also intended for non | + | This tutorial is also intended for non specialist, it involves as little maths as possible and present most results with GNURadio flowgraph. Some examples involving simple modulation scheme used in HAM radio are presented. Whilst introducing complex signal can be seen as increasing complexity, we will see that it drastically simplify studying impairment such as synchronization. |

− | If you are searching for more detailed information | + | If you are searching for more detailed information please refer to corresponding literature such as references [[#ancre1|[1]]],[[#ancre2|[2]]],[[#ancre3|[3]]]. |

== Some maths == | == Some maths == | ||

− | This section | + | This section summarize complex numbers properties used in this tutorial. More information can be found on |

[[wikipedia: Complex number|complex number Wikipedia page]]. | [[wikipedia: Complex number|complex number Wikipedia page]]. | ||

Line 23: | Line 23: | ||

: <math>r=|z|=\sqrt{a^2+b^2}</math> | : <math>r=|z|=\sqrt{a^2+b^2}</math> | ||

− | The phase φ of ''z'' | + | The phase φ of ''z'' mathematically referred to as the argument is the angle of the radius Oz with the positive real axis. |

: <math>\phi=\arg(z)=\arctan(b/a) </math> (for a≠0) | : <math>\phi=\arg(z)=\arctan(b/a) </math> (for a≠0) | ||

− | Together, r and φ | + | Together, r and φ give another way of representing complex numbers, the polar form and the exponential form. |

: <math>z=r \left(cos(\phi) + j sin(\phi) \right) = r e^{j\phi}</math> | : <math>z=r \left(cos(\phi) + j sin(\phi) \right) = r e^{j\phi}</math> | ||

Line 38: | Line 38: | ||

: <math>z=z_1z_2= r_1r_2 e^{j(\phi_1+\phi_2)}</math> | : <math>z=z_1z_2= r_1r_2 e^{j(\phi_1+\phi_2)}</math> | ||

− | + | Following complex number have a unit magnitude ''r''=1 : | |

: <math>+1=e^{j0}</math> | : <math>+1=e^{j0}</math> | ||

Line 45: | Line 45: | ||

: <math>-j=e^{j3\pi/2} </math> | : <math>-j=e^{j3\pi/2} </math> | ||

− | A complex signal ''c(t)'' can be seen as two real signals ''a(t), b(t)'' | + | A complex signal ''c(t)'' can be seen as two real signals ''a(t), b(t)'', often written as ''i(t), q(t)'', and combined to create a complex signal. It can also be represented by its time varying amplitude ''r(t)'' and its phase ''φ(t)'' |

: <math>c(t) = a(t) + j b(t) = r(t) e^{j\phi (t)} </math> | : <math>c(t) = a(t) + j b(t) = r(t) e^{j\phi (t)} </math> | ||

== Why we need complex and IQ signals == | == Why we need complex and IQ signals == | ||

− | GNURadio software is mainly used to design and study radio communications. Making high frequency transmission requires modulating a high frequency carrier at frequency ''F<sub>0</sub>''. The most common modulation for analog transmissions are | + | GNURadio software is mainly used to design and study radio communications. Making high frequency transmission requires modulating a high frequency carrier at frequency ''F<sub>0</sub>''. The most common modulation for analog transmissions are Amplitude modulation (AM) Phase modulation (PM) and Frequency modulation (FM). |

[[File:IQ_complex_tutorial_AM_spectrum.png|thumb|400px|AM spectrum]] | [[File:IQ_complex_tutorial_AM_spectrum.png|thumb|400px|AM spectrum]] | ||

− | For analog AM, the modulated signal ''m(t)'' is simply the mathematical product of the carrier ''c(t)'' and the baseband signal ''a(t)''. The corresponding hardware is a mixer whose scheme and mathematical representation is a multiplier. | + | For analog AM, the modulated signal ''m(t)'' is simply the mathematical product of the carrier ''c(t)'' and the baseband signal to transmit ''a(t)''. The corresponding hardware is a mixer whose scheme and mathematical representation is a multiplier. |

: <math>m(t) = a(t) c(t) = a(t) \cos(2\pi f_0t)</math> | : <math>m(t) = a(t) c(t) = a(t) \cos(2\pi f_0t)</math> | ||

− | We call ''a(t)'' a baseband signal since its spectrum is in a low frequency range | + | We call ''a(t)'' a baseband signal since its spectrum is in a low frequency range starting near 0 Hz (For example [0-20kHz] for an HIFI audio signal). |

The spectrum of an AM modulated signal ''M(f)'' is the translation or the audio spectrum ''A(f)'' around ±''F<sub>0</sub>'' with ''A(f)'' being the entire spectrum of the modulating signal, using both positive and negative frequencies | The spectrum of an AM modulated signal ''M(f)'' is the translation or the audio spectrum ''A(f)'' around ±''F<sub>0</sub>'' with ''A(f)'' being the entire spectrum of the modulating signal, using both positive and negative frequencies | ||

Line 63: | Line 63: | ||

: <math>M(f) = \frac{1}{2}\big(A(f-f_0) + A(f+f_0)\big)</math> | : <math>M(f) = \frac{1}{2}\big(A(f-f_0) + A(f+f_0)\big)</math> | ||

− | N.B. Negative frequencies are often omitted in spectrum representation since, for real signal (''a(t)'', ''m(t)'' are real) the power spectrum are symmetric around zero | + | N.B. Negative frequencies are often omitted in spectrum representation since, for real signal (''a(t)'', ''m(t)'' are real) the power spectrum are symmetric around zero as will be detailed later. |

− | Up to now we have been dealing with real | + | Up to now we have been dealing with real signal. The need for complex signal appears in the next step. Simulation requires sampled signal. Sampling is the operation of observing a continuous signal and taking a finite number of sample at a given sampling rate ''f<sub>s</sub>'' (i.e; one sample each 1/''f<sub>s</sub>'' second). simulator can only make calculations on a finite number of samples, they require sampled signal. Nyquist Sampling theorem states that the sampling rate must be greater than twice the maximum frequency ''F<sub>Max</sub>'' to be able to reconstruct the original signal from the sampled signal. |

: <math>f_s > 2F_{Max}</math> | : <math>f_s > 2F_{Max}</math> | ||

Line 76: | Line 76: | ||

* study the modulator part which simply multiply the baseband signal and the sine carrier | * study the modulator part which simply multiply the baseband signal and the sine carrier | ||

* look at the influence of the carrier frequency on the modulated signal spectrum (carrier frequency must stay lower than half the sampling rate) | * look at the influence of the carrier frequency on the modulated signal spectrum (carrier frequency must stay lower than half the sampling rate) | ||

− | * look at the spectrum shape for sawtooth input and random bit sequence (QT | + | * look at the spectrum shape for sawtooth input and random bit sequence (QT Gui chooser and Selector) |

− | * When transmitting random bits, you can | + | * When transmitting random bits, you can desactivate the interpolating FIR Filter and replace it by a root raised cosine filter |

− | == Spectrum properties of signals == | + | == Spectrum properties of signals== |

Amplitude spectrum is calculated using the Fourier Transform. It represents how the power is spread in the frequency domain. It allows for determining the signal bandwidth. Power Spectral Density or PSD correspond to the average magnitude of the Amplitude spectrum. | Amplitude spectrum is calculated using the Fourier Transform. It represents how the power is spread in the frequency domain. It allows for determining the signal bandwidth. Power Spectral Density or PSD correspond to the average magnitude of the Amplitude spectrum. | ||