Subsections

Quadrature detection is a demodulation technique which builds on the utilization of a quadrature signal. This appendix will introduce quadrature signals in section N.1 and N.2 and proceeds with the different ways these can be used to obtain FM demodulation, see sections N.3, N.4 and N.5.

# Theory

The first of the following sections will introduce the mathematics behind quadrature signals. The second will describe how a continous wave modulated signal can be represented by quadrature signals. The reference for this section is [Haykin, 2001, pages 723-730].

## Quadrature representation of bandpass signals

This section will introduce three new terms; the pre-envelope of a signal, the complex envelope of a signal and finally the and components of a signal. By this it is shown how to represent a signal at baseband using complex quantities and avoiding information loss normally occuring with direct downconversion.

### Pre-envelope

In a communication system the signal that is physically transmitted is a real-valued bandpass signal, as shown in figure N.1(a). In handling bandpass signals the pre-envelope of has shown to be particularly useful, but one should remember that the pre-envelope is purely a theoretical function. The pre-envelope of such signal is defined as
 (N.1)

where:

 is the pre-envelope of is a real-valued signal is the Hilbert transform of

The Hilbert transform shifts the phase of all negative frequencies in a signal by and of all positive frequencies by . The signals and are said to be a Hilbert transform pair. Amplitudes are not affected by the Hilbert transform. To sum up; the pre-envelope of a signal is nothing but the signal itself as the real part and its Hilbert transform as the imaginary part. The Fourier transform of is given by
 (N.2)

where is the sign of . Knowing this, the Fourier transform of the pre-envelope of , can be derived:
 (N.3) (N.4)

From this it is found that the pre-envelope has no frequency content for all negative frequencies, and that the magnitude of the positive frequency content is doubled as shown by figure N.1(b). This proporty will show its importance later.

### Complex envelope

Now consider a bandpass signal, , centered about the frequency and limited to the band . This signal contains a baseband signal, and normally downconverting this to baseband directly would cause sideband overlap, hence information would be lost. The quadrature representaion is complex and avoids this.

The pre-envelope of such signal only contains information in the positive frequencies. The pre-envelope of such signal can always be expressed as a baseband signal with a frequency displacement of . The base band signal is called the complex envelope, .
 (N.5)

where:

 is the pre-envelope of is the complex envelope of

The complex frequency shift is obtained by multiplication of the complex signal conforming with the Fourier transform property:
 (N.6)

Note about the above formulas that the only difference between the complex envelope, , and the pre-envelope, , is that the complex envelope is shiftet to base band while the pre-envelope is still on a carrier. None of the signals have mirrors in the frequency plane. In contrary to direct downconversion, where side band ovelap usually occurs, the quadrature representaion, which can be considered a form of complex downconversion, does not have this problem; i.e the signals can be represented by the complex envelope at baseband without loosing information. This is possible because the complex envelope is a complex-valued function, which will be addressed further in the next section.

### I and Q signals

While the pre-envelope is bandlimitted to the band , the complex envelope is limitted to the band , and is therefore a lowpass signal. This is illustrated by figure N.1(c). In general, is a complex-valued lowpass quantity that may be described on rectangular form:
 (N.7)

where:

 is the in-phase component of is the quadrature component of

The lowpass property of and is inherited from . The original bandpass signal, , can be represented also by means of and :
 (N.8) (N.9) (N.10)

To sum up; all information content of is preserved within the - and -signals since these are the real and imaginary components of the complex envelope of . This is a base band representation that avoids sideband overlap, that would normally occur with direct downconversion.

## Quadrature representation of continous-wave modulated signals

Until now the bandbass signal has been treated as arbitrary. This section will focus on the quadrature representation of signals that are modulated using AM, PM or FM. In these cases the bandpass signal can be expressed generally as
 (N.11)

where:

 is a continuous wave modulated signal is the envelope of is the phase of [rad]

The and components are derived following the steps presented in the last section:
 (N.12) (N.13) (N.14) (N.15) (N.16)

From the above and equation (N.7) it follows that

 (N.17) (N.18)

Note that all the information content is preserved in the complex envelope no matter if it is in terms of and or in envelope and phase. The conversion between the two forms can of course be done both ways. Note that in complex envelope, is not only the envelope, but the actual amplitude. It can therefore be calculated as the absolute length of . The phase of the signal is simply the angle of the same complex number:

 (N.19) (N.20)

To sum up; The - and -signals are both lowpass signals, and they both contain both ampltitude and phase information. Usually the signals are used to determine the amplitude and phase of some received signal, i.e. , and in this context both and are required to uniquely determine the phase. Determination of the instantanous phase of a received signal is the key in quadrature FM detection, which will be described in the following sections.

# IQ generator

In this section the principle for obtaining the - and -signals are described. Recalling from section N.1 that the - and -signals for an FM signal where is constant are defined as

 (N.21) (N.22)

These are the signals that are to be derived from the FM signal.

In figure N.2 the principle for making the - and -signals is shown.

As seen in the figure, the - and -signals are made by multiplying the FM-signal with 2 or -2 , and afterwards low pass filtering the signal. How this gives the - and -signals is shown by the following mathematical description.

## Mathematical description of the I- and Q-signals

Because the calculations of the - and -signals are almost identical, only a mathematical description of the -signal is made. The -signal can be calculated by using the same procedure.

If the FM-signal is given as then the signal after the mixer is given by

 (N.23)

From appendix B.2, it is known that an FM signal can be described as

 (N.24)

Substituting the expression for into equation N.23 the signal after the mixer can be described as (using Eulers formel)

 (N.25) (N.26)

The desired -signal is the part of the signal centered around zero. In order to obtain this signal, the signal is low pass filtered, which gives the -signal

 (N.27)

This shows that the - and -signal can be derived from the FM signal by using the above described method in an ideal situation. Often this will not be the case because the carrier frequency will have a frequency offset , and a phase offset , with respect to the internal oscillator. This gives the following FM-signal

 (N.28)

It can be shown that a variation in the carrier frequency gives the following - and -signals

 (N.29) (N.30)

This means that a change in the carrier frequency results in a frequency offset of both the - and -signals.

Similarly it can be shown that a change in the phase of the signal multiplied with the FM signal results in the following - and -signals.

 (N.31) (N.32)

This shows that a change in the phase gives a phase offset in both the - and -signals.

How these results influence the demodulation will be described for each of the following demodulation algorithms.

Now that the method for finding the - and -signals is described, an algorithm that calculates the - and -signals can be made.

## Digitalization considerations

Most af the calculations shown above can directly be implemented as a discrete time function. Some considerations must however be made when designing the low pass filter. This is because different methods can be used in designing a digital filter. For further information on filter design see appendix M.

## MATLABTM implementation

The MATLABTM implementation is made by following the method described above and shown in figure N.2. This means that the carrier frequency of the FM signal needs to be known, for the algorithm to work.

A digital oscillator needs to be made in order to generate the sine and cosine signal. In MATLABTM this can easily be made by first constructing a time vector, and then using this to generate the sine and cosine signals.

## Evaluation of MATLABTM implementation

The MATLABTM implementation is evaluated using a 9 kHz cosine signal with zero phase as input. Because the phase of the input signal is zero the - and -signals should be

 (N.33) (N.34)

The test shows that the I- and Q-signals give the desired values, and the algorithm is therefore assumed to be working.

## C implementation considerations

When implementing the algorithm in C the time vector used to generate the digital oscillator is not as easy to make as in MATLABTM. The reason for this is that when working in MATLABTM the sound sample has a finite length and therefore also the time vector has a finite length. When working in C the length of the sound sample is dynamical allocated and the time vector can therefore not be generated in the same way. A solution to this problem to divide the sound samples into samples with a known length, and then demodulate the samples one at a time.

# Arctan demodulator

The arcus tangent method for FM demodulation is propably the mathematically most straightfarward method, when the and signals are present.

## Principle

The principle is to derive the instantanous phase of the received FM signal by deriving the angle of the complex number as depicted by equation (N.20). From the definition of FM modulation it is known that the time derivative of the instantanous phase is directly proportional to the message signal, see equation B.16. The principle block diagram is shown in figure N.3.

## Mathematical description

The signals at hand are

 (N.35) (N.36)

The proof of this method to derive the message signal, , is carried out in three steps referring to the blocks of figure N.3. For the calculation of equation (N.20) is used. For the calculation of , the time derivative of the phase of an FM signal is used:

 (N.37) (N.38) (N.39) (N.40) (N.41) (N.42)

In practice a signal received always has a frequency offset, and phase offset, as described in section N.2.1. Carrying out a similar calculation as in the above section with the offset frequency and offset phase yields:

 (N.43) (N.44) (N.45)

Hence a frequency tolerance will introduce a DC offset in the demodulated message signal. Since the phase is differentiated, a constant phase offset will have no influence on the demodulation.

## Digitization considerations

All of the above calculations can be carried out on samples instead of continous time signals. The only calculation that may introduce approximation errors is the differentiator, which can not be accurate when operating in discrete time. A discrete time differentiator will use the approximation

 (N.46)

where:

 is a continous time signal is an integer sample number is the sample time [s]

## MATLABTM implementation

The arcus tangent is implemented using the function atan2() which is a four quadrant arcus tangent. The problem with using its two quadrant counterpart; the regular atan(), is that it only gives output in the range between and . As both and can take on both positive and negative values, and they are divided with each other in order to use the arcus tangent, the two expressions atan(-1/-1)() and atan(1/1)() would of course yield the same result even though they are in opposite quadrants. The function atan2() can handle this situation, thus producing the correct output in the full unit circle range between and .

The function unwrap() is used to correct jumps in angles that are over . This is a MATLABTM function which will not be available in C. Figure N.4 explains the difference between a wrapped and an unwrapped signal, and also presents a different approach to work around a wrapped angle. This approach is only relevant is only relevant for eventually implementation in C.

The differentiator is implemented using the approximate derivative function diff(). The resulting algorithm is so short that it is pasted here:

sigdem = diff(unwrap(atan2(qb, ib)));


## C implementation considerations

Implementation should be straightforward since the function atan2() is present in the standard C math library. A way to work around the wrapped angle output from the function is presented above. The rest should be trivial as well.

# Baseband delay demodulator

The Baseband delay demodulator is another straightforward method to obtain the information signal from the - and -signals.

## Principle

The principle is the same as that of the arctan demodulation. Namely to derive the instantanous phase of the received FM signal by use of the - and -signal.

Figure N.5 shows the principle for the Baseband delay demodulator.

In order to understand precisely how this method generates the information signal from the - and -signal, a mathematical description of the method is made.

## Mathematical description of the Baseband delay demodulator

The signals at hand are the - and -signals discretized

 (N.47) (N.48)

From the - and -signals and are found.

 (N.49) (N.50)

By substrating from , is achieved.

 (N.51) (N.52)

It is now possible to find by taking arcsine to . If the angle between two samples a sufficient small, and is approximately the same. The following shows this approximation.

 (N.53) (N.54) (N.55) (N.56)

and

 (N.57)

From this approximation is given as

 (N.58)

The following shows how the message signal is derived by multiplying with a constant K.

 (N.59) (N.60) (N.61)

As described in section N.2 the - and -signals can change due to a change in the carrier frequency or change in the phase.

Carrying out a similar calculation as in the above section with the offset frequency and phase yields

 (N.62)

This gives (n)

 (N.63) (N.64)

This means that a change in the carrier frequency results in a DC offset of the message signal, and a change in the phase will have no effect on the message signal.

## Digitalisation considerations

The method described above can directly be implemented in discrete time. The only calculation that can result in an error is the differentiaton as described in section N.3.3.

## MATLABTM implementation

In MATLABTM the method described above can directly be implemented by following the procedure shown in figure N.5.

## C implementation considerations

Implementing the algorithm in C should be no problem.

# Baseband differentiator demodulator

The Baseband differentiator demodulator is yet another way to demodulate the FM signal by use of the - and -signals.

## Principle

The principle for the Baseband differentiator demodulator is like the preceding methods to obtain the instantaneous phase of the FM signal.

In figure N.6 the principle for the method is shown.

As seen in the figure, the principle can be expressed mathematical as

 (N.65)

In order to see how this method gives the information signal , a mathematical description is made.

## Mathematical description of the Baseband differentiator demodulator

In order to find the two signals (t) and (t), the differentiated form of the - and -signal needs to be known

 (N.66) (N.67) (N.68) (N.69)

It is now possible to find (t) and (t)

 (N.70) (N.71)

and

 (N.72) (N.73)

It is now possible to find (t) by subtracting (t) from (t). This gives

 (N.74) (N.75) (N.76)

knowing that is equal to

 (N.77)

Equation N.76 can be rewritten as

 (N.78)

Finaly (t) can be derived by multiplying (t) with

 (N.79)

The calculations made above are for the ideal case. As described in section N.2.1 the - and -signals can change due to a error in the carrier frequency or a error in the phase of the local oscillator.

Carrying out a similar calculation as in the above section with the offset frequency and phase yields

 (N.80)

This gives (t)

 (N.81) (N.82)

This means that a change in the carrier frequency results in a DC offset of the message signal, and a change in the phase will have no effect on the message signal.

## Digitalisation considerations

All of the calculations described above can also be made in discrete time. The only calculation that may introduce an approximation is the differentiation as described in section N.3.3.

## MATLABTM implementation

The method described above can directly be implementated in MATLABTM without further considerations.

## C implementation considerations

Like the implementations in MATLABTM the implementation in C can be made without further considerations.

# Conclusion

The three presented algorithms hase some important characteristics in common. They use baseband quadrature signals to determine the phase or the time derivative of the phase of the received FM signal. Filtering is only used in the generation of the quadrature signals where two FIR lowpass filters of order 20 are used. The algorithms themselves only have to look at one sample back in time in order to demodulate.

A frequency offset in the received signal (mistuning) will result in a DC-offset in the message signal derived. A phase offset will have no influence on the demodulation.

The three algorithms have been tested briefly and the sound output is understandable.

Jes Toft Kristensen 2005-12-13