# Difference between revisions of "User:CSeguinot"

Line 81: | Line 81: | ||

A theorem ([[#ancre1|[1]]],[[#ancre2|[2]]],[[#ancre3|[3]]]) states that any high frequency bandpass signal having a limited bandwidth ''B'' can be represented by a baseband equivalent signal having the same bandwidth. This baseband equivalent signal also called the complex envelope is used in simulators since its allow to lower sampling rate as compare to directly sampling the bandpass signal. | A theorem ([[#ancre1|[1]]],[[#ancre2|[2]]],[[#ancre3|[3]]]) states that any high frequency bandpass signal having a limited bandwidth ''B'' can be represented by a baseband equivalent signal having the same bandwidth. This baseband equivalent signal also called the complex envelope is used in simulators since its allow to lower sampling rate as compare to directly sampling the bandpass signal. | ||

The equivalent baseband representation help us for the simulation of bandpass signals. At this step we need some math. We will consider a carrier modulated in phase and/or amplitude (in the sake of simplicity, Frequency modulation is not considered but it can be related to phase modulation.). Such a modulated signal ''m(t)'' and it's complex representation <math>\tilde{m}(t)</math> is : | |||

: <math>m(t)=a(t) \cos(2\pi F_0t + \phi(t))</math> | |||

: <math>\tilde{m}(t)=a(t) e^{(j(2\pi F_0t + \phi(t)))} = a(t) e^{j \phi(t)} e^{j2\pi F_0t} = m^{bb}(t) e^{j2\pi F_0t}</math> | |||

For modulated signal, the complex representation is obtained by replacing the cos function by an exponent function . For a more general definition see [[#ancre1|[1]]],[[#ancre2|[2]]],[[#ancre3|[3]]] . The real signal correspond to the real part of the complex signal <math>m(t)=\text{Re}(\tilde{m}(t))</math>. | |||

One important property of <math>\tilde{m}(t)</math> spectrum <math>\tilde{M}(f)</math> is that it has only energy in the positive frequency range and verify. | |||

: <math>\tilde{M}(f)=M^+(f)</math> | |||

where <math>=M^+(f)</math> denotes the restriction of <math>=M(f)</math> to the positive frequency range. | |||

Let us now look at the complex envelope or equivalent baseband signal <math>m^{bb}(t)</math> of bandpass signal <math>m(t)</math> defined by : | |||

: <math>m^{bb}(t)= \tilde{m}(t) e^{+j2\pi F_0t} = a(t) e^{j \phi(t)} </math> | |||

Multiplying a signal by <math>e^{+j2\pi F_0t}</math> correspond to a frequency translation of the spectrum so that we have: | |||

:<math>M^{bb}(f)=M+(f+F_0)</math> | |||

So the spectrum of the complex enveloppe is a baseband signal whose spectrum has the same shape as <math>=M+(f)</math>. For this reason, knowing <math>\tilde{m}(t)</math> or <math>M^{bb}(f)</math> is sufficient to reconstruct <math>m(t)</math> or <math>M(f)</math>. |

## Revision as of 10:07, 22 January 2021

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 intended for non specialist, it involves as less maths as possible and present most results with GNURadio flowgraph. Some examples involving simple modulation scheme used in HAM radio are presented. While introducing complex signal can be seen as increasing complexity, we will see that it drastically simplify some impairment such as synchronization.

If you are searching for more detailed information please refer to corresponding literature such as references [1],[2],[3].

## Some maths

This section summarize complex numbers properties used in this tutorial. More information can be found on complex number Wikipedia page.

A complex number is a number of the form *a* + *jb*, where *a* and *b* are real numbers, and *j* is an indeterminate satisfying *j*^{2}=-1 (Mathematician prefer using *i* instead of *j* used by physicist and radio engineers). For example, z_{1}=2+3*j* is a complex number. The real part Re{*z*} of z_{1} is 2 and its imaginary part Im{*z*} is 3.

Complex numbers can be represented in the complex plane as vectors. The modulus or magnitude *r* of a complex number *z* = *a* + *jb* is

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

- (for a≠0)

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

The exponential form is convenient for computing the multiplication of two complex numbers.

Following complex number have a unit magnitude *r*=1 :

A complex signal *c(t)* can be seen as two real signal *i(t), q(t)* combined to create a complex signal. It can also be represented by its time varying amplitude *a(t)* and its phase *φ(t)*

## 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 _{0}*. The most common modulation for analog transmissions are Amplitude modulation (AM) Phase modulation (PM) and Frequency modulation (FM).

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 is a multiplier.

- SCHéMA

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 _{0}* with

*A(f)*being the whole spectrum using both positive and negative frequencies

- SCHéMA

N.B. Negative frequencies are often omitted since for real signal (*a(t)*, *m(t)* are real) the power spectrum are symetric around zero as will be detailed later.

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 _{s}* (i.e; one sample each 1/

*f*second). Nyquist Sampling theorem states that the sampling rate must be greater than twice the maximum frequency

_{s}*F*to be able to reconstruct the original signal from the sampled signal.

_{Max}For an HIFI audio signal, maximum audio frequency is closed to 20 kHz, sampling rate must be higher then 40 kHz (44.8 kHz is often used in computer sound card, 8 kHz is used for mobile phone since voice has a lower frequency range then HIFI audio).

For an AM signal modulated by an audio signal, maximum frequency is . Direct sampling of such signal is not possible with conventionnal hardware such as low cost SDR dongle. If the carrier frequency is close to 1 GHz, the sampling rate should be 2 GHz. This is obviously too much then computer cans handle (higher then most computer clock).

## Complex enveloppe, equivalent baseband signal

Baseband signals have a spectrum at low frequency near 0 Hz. Audio, video and NRZ line code are baseband signals.

Bandpass signals have no energy near 0 Hz and a spectrum located near a high frequency (generally the carrier frequency). Analog and digital AM PM and FM modulated signals are bandpass signals.

A theorem ([1],[2],[3]) states that any high frequency bandpass signal having a limited bandwidth *B* can be represented by a baseband equivalent signal having the same bandwidth. This baseband equivalent signal also called the complex envelope is used in simulators since its allow to lower sampling rate as compare to directly sampling the bandpass signal.

The equivalent baseband representation help us for the simulation of bandpass signals. At this step we need some math. We will consider a carrier modulated in phase and/or amplitude (in the sake of simplicity, Frequency modulation is not considered but it can be related to phase modulation.). Such a modulated signal *m(t)* and it's complex representation is :

For modulated signal, the complex representation is obtained by replacing the cos function by an exponent function . For a more general definition see [1],[2],[3] . The real signal correspond to the real part of the complex signal .

One important property of spectrum is that it has only energy in the positive frequency range and verify.

where denotes the restriction of to the positive frequency range.

Let us now look at the complex envelope or equivalent baseband signal of bandpass signal defined by :

Multiplying a signal by correspond to a frequency translation of the spectrum so that we have:

So the spectrum of the complex enveloppe is a baseband signal whose spectrum has the same shape as . For this reason, knowing or is sufficient to reconstruct or .