Professional Documents
Culture Documents
Introduction
The HERON-FPGA family is ideal for many of the building blocks of digital communications. Providing large easily-programmed gate arrays, often combined with interface elements like ADC or DACs, they can be used to implement many system components. The availability of hardware such as the HERON system is enabling designers to build radio systems where more and more of the system is digital. This often requires new techniques and terminology. This is an introduction to one such technique the Digital Down Converter, or DDC. This paper is not meant as a definitive reference on DDCs. Instead, it is a grounding in the basic concepts. It is enough for an experienced signal processing engineer to build his own DDC, but we have also provided references to other information sources for further reading.
How It Works
A DDC works by first shifting the bandwidth of interest to baseband by multiplying the received signal by a close approximation to the original carrier. This works on the (simplified) mathematical principle: Frequency(A) * Frequency(B) = Frequency(A-B) + Frequency(A+B) So, for our example, we need to shift the 39-40MHz band (our Frequency A) down to DC. We do this by multiplying by our estimate of the carrier say 39MHz. We now have: Input Signal * 39MHz = Signal at 0-1MHz + Signal at 78-79MHz Of course, our sampling rate (Fs) is still 100MHz. Nyquists theory says that we need to sample twice as fast as the highest frequency of interest, or we get aliasing; and that is indeed what happens. The 78-79MHz signal is aliased, and would also appear in the 0-50MHz band. In fact, aliases are something we need to be acutely aware of. To understand where the signal will appear, look at the following table, for a tone of frequency F, sampled at Fs: Lower Edge of Band DC Fs/2 Upper Edge of Band Fs/2 Fs Where Signal Appears F Fs F
Notes Conventional Nyquist sampling Spectrum inverted. Increasing the input frequency will decrease the output frequency. Signal appears as normal, but frequency shifted by Fs. Spectrum inverted. Frequency shifted by 2Fs
Fs 3Fs/2 2Fs
From this, we can see that the 78-79MHz signal is aliased back down to the 21-22MHz band, and its frequency inverted. All other signals present in the input are also shifted and may be aliased. This can be an important factor to consider in the design of a DDC; it is possible to alias significant noise sources into the bandwidth of interest to us. For example, noise signals in the 99101MHz region would alias to 1MHz right on top of our signal. (In fact, we can use the frequency shift introduced by aliasing to good effect. The principle is that with our 100MHz sample rate, we could sample a signal at 105MHz and it would be frequency shifted down to 5MHz. This is called bandpass sampling, and well look at it later.)
This process is shown in Figure 2. The hardware to implement it comprises an oscillator capable of generating our estimate of the carrier, and a multiplier these are often known as the Local Oscillator or LO, while the multiplier is often known as a mixer terminology carried over from the days of analog.
Following the mixer, all we have to do is remove the unwanted signals and their aliases, then reduce the sampling rate. This process is performed by filtering the signal to limit the bandwidth to our signal of interest, centred close to baseband. This is implemented with linear phase filters. Once this is complete, we can reduce the sampling rate by "decimating" the original signal throwing away samples until we reach the desired output rate. For integer decimation ratios this is simple for example, reducing the sampling rate by a ratio 2, 3, or 27. For non-integer decimation ratios, a more complex system is used. Returning to our example, we filter the incoming signal to limit its bandwidth to 0-1MHz. After the filter, the band-limited signal can be decimated again, to keep the maths simple, we will decimate the sampling rate by a factor of 32, dropping the sampling rate from 100MHz to 3.125MHz a far easier challenge to process. In reality wed probably drop the sampling rate to 2.5MHz using the non-integer decimation we hinted at above. We will look at that later.
A signal can have a positive or negative frequency. Sampled using a simple ADC, you cannot tell whether that signals frequency is positive or negative not enough information is available to you. To understand this, imagine a signal generated by a single sensor. That sensor is measuring a rotating bicycle wheel. As each spoke passes the sensor, a pulse is generated. This generates a signal, but there is no way of telling which direction the bicycle wheel is rotating. By adding a second sensor close to the first, we generate two pulse trains; and we can now tell whether the wheel is rotating clockwise or counter-clockwise depending on which pulse is generated first. This is the principle of complex arithmetic. By adding the imaginary part of the sample, we can detect whether our signal has a positive or negative frequency. Now, we can implement filters that genuinely do have passbands of (say) 0-1MHz. We can also recover far more easily from carrier error if after we shift our signal, part of it is negative, we can compensate for this in later processing. In fact, its optimal to shift the signal so that it is symmetric about DC the maximum negative frequency is similar to the maximum positive frequency. In doing this, we minimise the sampling frequency we need to use. Generally, DDCs will introduce complex arithmetic at the local oscillator stage. The local oscillator generates a complex version of the carrier, with precise 90-degree phase shift between its channels. From this point on all further processing is done in complex maths.
However, this is not always the case. In some systems we will want to decimate by non-integer ratios for example, 2,5MHz down to 1MHz. This represents a decimation ratio of 2.5, or 5/2. In this case, we first INCREASE the sampling rate. This is known as interpolation. We add samples, then filter the signal back to its original bandwidth. Here, we double the sample rate up to 5MHz. Once the sample rate has been increased, we can once again decimate by discarding samples. In the example, we discard four samples from every five, giving us the 1MHz output rate. All these concepts are drawn together in the block diagram of Figure 3
The more aggressively this technique is applied, the greater the strains on the anti-aliasing filters. It also places great emphasis on high analog bandwidth for the ADC, and extremely low jitter for the ADC clocks; any errors here will be magnified greatly. However, it can be used very effectively. This technique is complementary to frequency-shifting the signal to an "Intermediate Frequency" or IF. Typically the approach used direct conversion, IF or "bandpass sampling" will be chosen dependent on the frequencies involved and other system issues even down to the type of antenna deployed. Most systems use a combination approach, using an analog IF stage to bring the signal down to something that can then be processed digitally.
Digital stability not affected by temperature or manufacturing processes. With a DDC, if the system operates at all, it works perfectly theres never any tuning or component tolerance to worry about. Controllability all aspects of the DDC are controlled from software. The local oscillator can change frequency very rapidly indeed in many cases a frequency change can take place on the next sample. Additionally, that frequency hop can be large there is no settling time for the oscillator. Size. A single ADC can feed many DDCs, a boon for multi-carrier applications. A single DDC can be implemented in part of an FPGA device, so multiple channels can be implemented or additional circuitry could also be added.
ADC speeds are limited. It is not possible today to digitise high-frequency carriers directly. There are techniques to extend the range of ADCs, but often it is simpler to use analogue circuits to bring the carrier down to an IF that digital circuits can then manage. ADC dynamic range is limited. In many communications systems, the signals amplitude can vary greatly. Fast ADCs often only have 12bits of resolution giving an absolute maximum dynamic range of 72dB. It is often better to use analogue circuits in conjunction with the ADC to implement AGC functions to ensure that this range is best used.
In time, more and more systems will use predominantly digital technology. However, the high speeds of many communication systems will ensure that a hybrid approach, using analogue and digital, will be the best route for many systems for a long time to come. The quest for more spectral space will ensure that new systems will use ever higher frequencies, ensuring that analog approaches will be around for a long time to come!
Further Reading
There are many aspects of DDCs that we have touched on lightly in this tutorial. Try the following for more information: CIC Filters: The original paper on CIC filters is a mathematical work of art however, that doesnt make it useful for engineering purposes! A lighter introduction is available at: DSPGuru - http://www.dspguru.com/info/tutor/cic.htm This references Hogenauers original paper, but its not strictly necessary to understand all the maths to get a CIC working! Complex Maths: Another useful tutorial on the DSPguru website, complex maths explained in simple terminology essential for a full understanding of much of communications theory: DSPGuru - http://www.dspguru.com/info/tutor/quadsig.htm DDC Chips: Take a look at how the fixed-function DDC chips are structured. Many of these are overkill they have to be as they need to match the needs of many users, while your design can be application specific. You can still learn from them; Graychip in particular have excellent datasheets: Graychip has recently been acquired by Texas Instruments but you can still find their datasheets at the TI website, in the Analog & Mixed Signal section.
See also the very good article by Ray Andraka (Andraka Consulting Group, Inc) on the subject of DDC with FPGAs. We provide demo/frameworks of a DDC in a HERON-IO2 and a HERON-IO5 that are similar to the discussion below.
1. How accurate should the frequency control of the oscillator be? With a digital oscillator, you can specify very fine control at the expense of increased FPGA utilisation. 2. Do you need to program the phase of the oscillator? To what resolution? 3. How much noise can you tolerate in the oscillators output? Any noise will be passed through the mixer into the DDCs filters, and will add to the systems noise floor. You may want to analyse this. With this information, you can move to generating a core with the Xilinx toolset. The best approach is to generate the biggest DDS you can squeeze into the FPGA, but record the parameters you use. If you need to optimise the design later, you can regenerate the core with (for example) reduced frequency accuracy to increase speed. Similarly, the mixer is implemented as a pair of hard-coded multipliers. It is usually not worth trying to implement the mixer in a single multiplier. Ensure that the outputs are registered, and select the pipelined multiplier option. It should now be a simple matter to connect the oscillator to two of the multiplier inputs, while the ADC can go on the other input.
Each design has different requirements. However, the following is a rough guide to implementing the filter. The filter is best implemented as an FIR, and in fact the best approach is to use a multirate FIR. This may sound complex, but in fact a multi-rate FIR is simply an efficient way of implementing large filters with decimation. Imagine we need to implement a large filter at a high sampling rate, before decimating the signal. We could implement a 128-tap filter at 100MHz, but this would require a lot of multipliers and a huge FPGA. However, suppose we split the filter. The first filter can perform enough filtering to allow us to perform some decimation. The second filter is now operating at a much reduced sampling rate. Typically by splitting the filter in this way we can reduce the number of taps in the filter, and reduce the sampling rate that some of these taps operate it. Both reduce the amount of FPGA resource we require to build the filter. So, to implement your filter: start with a simple FIR. This stage should have a small number of taps - if you are operating at a high sampling rate, each FPGA multiplier will implement a very small number of taps. Use symmetric FIRs here the processing load is about half a nonsymmetric filter, and the core generator provides this as an option. Regardless of which FPGA you are using, this stage will take a lot of silicon! The filters bandwidth should match the output bandwidth of the DDC, but dont worry too much about the filters performance later filters will improve this. (Note: the output bandwidth is the band that were interested in typically only a few hundred KHz wide) Immediately after this filter, decimate the signal by 2, and implement a larger filter. Again, the filters bandwidth should match the DDC output bandwidth. This will improve the response of the first filter. You can afford to have more taps in this stage, as the sampling rate is lower. If you are operating a low decimation ratio, this could be all you have to do. That means that these filters have to have more taps than if we can use an additional stage. Experiment by trying cascades of filters with varying numbers of taps you will probably have to do this iteratively, using the Xilinx tools to try several different scenarios. For higher decimation ratios (e.g. 8 and up), you can afford to use a third stage filter. This can have significantly more taps than the first two, as each multiplier here can implement at least 4x as many taps as in the first stage. Again, you will want to experiment with the layout of the filters to see what gives best performance.
off for relatively few stages. Best of all, it is implemented using only adders and delays, which makes it very well suited to FPGA implementation. The CIC has one failing it has a lot of "droop" in its passband, and serious ripples in its stopband. However, we can compensate for these with additional filtering of its output. Because of the need for additional filtering on a CICs output, it is at its best with large decimation ratios. The larger the decimation ratio, the smaller the overhead of the filters used to compensate for the CIC. This makes it unsuitable for the wideband DDC we looked at earlier as the compensation filter becomes significant. However, for the narrowband DDC, it is ideal as a first stage. We would then follow that with a multi-rate FIR filter, as with the wideband DDC. Now, we can use as many taps as a single multiplier will allow. Generally a two-stage FIR works well, decimating by 2 between the stages. For many applications, 23 taps will work well in the first filter, and should be realisable with a single multiplier design; while 63 would be ideal in the second. Again, use symmetric FIRs to reduce the processing load.
The Xilinx tool will even generate decimating FIRs for you. Specify the decimation ratio, and the output will signal a valid sample at the decimated output rate an incredibly powerful tool for this type of work. Note that the Xilinx FIR tool also allows you to specify the number of clocks per output sample. Make sure you specify the maximum number of clocks; that way, the tools will be able to use the least possible amount of FPGA resource to implement your filter. Note that in a multi-rate filter, the later stages will have more clocks per output than the early stages! Once the filters have been generated, theyll be in the library for your Xilinx design. Build up the DDCs processing chain. It is worth registering the data along the chain (specify the "register output" option on the filters). Make sure the system clock is connected to all elements well see how to control the DDC in just a moment.
The Decimator
The final decimator can be implemented within the last FIR stage, if the decimation ratio is an integer. To do this, simply specify the required decimation ratio as part of the filter design. However, you may require a non-integer decimation ratio, or you may require a variable decimation ratio. In these cases, we must treat the decimator as a separate block. For non-integer decimation, run the FIR Core Generator one more time. Select an interpolating filter; this will automatically increase the sampling rate by the given amount. Place this in your design. The decimator can now be implemented as a register & counter. An example of this type of decimator can be found in the middle of the CIC filter used in this example.
This demo/framework for a HERON-IO2V or a HERON-IO5V uses an example implementation of a DDC to show you how to design and build a Digital Down Converter (DDC) using blocks from the Xilinx Core Generator. It discusses how to design and implement a DDC, but also shows that the Core Generator DDC block can often be used to perform the whole task. This demonstration can be run using a HEPC9 module carrier, using a HERON-IO2V or a HERON-IO5V without re-compiling. It would be easy to recompile it to use with another HERON-IO module, or perhaps the combination of a HERON-FPGA module with a separate Analogue I/O module. The FPGA outputs a modulated signal on its DAC outputs, and digitising that signal, performs the DDC function and outputs baseband data to the HERON FIFO using the Hardware Interface Layer. There is a multiplexor controlled by the Heron Serial Bus that allows you to view the signal at various points along the processing pipeline. This helps you to better understand the operation of the DDC. The Host API is used to receive the results using a graph program running on the host PC. The demo demonstrates communicating between an FPGA and the PC, using the Heron Serial Bus to control FPGA logic and drawing a graph on the PC screen as well as using an FPGA to make a DDC.