您的当前位置:首页正文

基于FPGA的多功能波形发生器的外文文献

2024-03-24 来源:年旅网


毕业设计说明书

英文文献及中文翻译

郭枫 0805074411 学生姓名: 学号: 信息与通信工程学院 学 院: 通信工程 专 业: 李沅 指导教师:

2012年 6 月

An alternative method of precise frequency by the aid of a DDS

Contents

A method of frequency measurement based on a closed loop composed mainly of a Frequency Comparator (FC) and a Direct Digital Synthesizer (DDS) is presented in this paper. The DDS serves as reference sinewave signal generator acting at one of the FC's inputs. The FC accepts the hard-limited waveform of the DDS as well as the unknown frequency. From the comparison of the two signals a logic output that controls an up/down counter is produced. The counter's output acting as the Frequency Setting Word (FSW) instructs the DDS to produce a new sinewave closer in frequency to the unknown one. When the loop settles, the FSW gives the digital estimate of the unknown frequency. Advantage is taken from the inherent high resolution of the DDS and noise immunity of the loop, to design an equally precise and immune frequency meter. All the additional associated stages up to the instrument's display are presented. 1 Introduction

The most commonly used frequency measurement technique adopts counters that count the pulses of the unknown frequency during a predefined time window (aperture). Apart from this, techniques where the pulses of a reference frequency are counted during one or more periods of the unknown one are also common. In the latter case, the period instead of the frequency is estimated .Some papers in [1] in the literature deal with the problem of low frequency measurement and are focusing in the frequency range of cardiac (heart) signals (a few hertz) or in the mains frequency (50-60 Hz). These techniques are actually measuring the period of the signals and use some way to calculate its reciprocal, the frequency. In [2], the frequency is calculated by the method of look-up tables. Others [4-6] are microprocessor or microcontroller based.

The above methods can be characterized as open-loop methods i.e. digital

counters are used to count during a predefined tinle interval and calculate the result afterwards. Its closed-loop form characterizes the proposed method in this paper. By the term \"closed-loop\" we denote some sort of feedback. A waveform with a known (controlled) frequency is produced within the circuit and is fed back to the frequency comparison stage which consecutively forces it to approximate the unknown (input) frequency. The device that produces the above mentioned waveform of controlled frequency is a Direct Digital Synthesizer. 2 Direct Digital Synthesis

A typical Direct Digital Synthesizer consists of a RAM containing samples of a sinewave (sine look-up table, LUT). These samples are swept in a controlled manner by the aid of a Frequency Setting Word (FSW), which determines the phase step. A typical FSW is 32-bit wide, but 48-bit synthesizers leading in higher frequency resolution are also available. A phase accumulator produces the successive addresses of the sine look-up table and generates a digitized sine wave output. The digital part of the DDS, the phase accumulator and the LUT, is called Numerically Controlled Oscillator (NCO). The final stage, which in contrast to the previous one is mostly analog, consists of a D/A converter followed by a filter. The filter smoothes the digitized sinewave, producing a continuous output signal. In the applications where a square wave output is needed, this is obtained by a hard limiter after the filter. It is not equivalent to use e.g. the MSB of the accumulator's output instead of the filtered and hard limited waveform because significant jitter will be encountered.

The frequency of the output signal for an n-bit system is calculated in the following way; If the phase step is equal to one, the accumulator will count by ones, taking 2n clock cycles to address the entire LUT and to generate one cycle of the output sinewave. This is the lowest frequency that the system can generate and is also its frequency resolution. Setting the FSW equal to two, results in the accumulator counting by twos, taking 2n1 clock cycles to complete one cycle of the output sinewave. It can easily be shown that for any integer m, where m<2n1, the number of

clock cycles taken to generate one cycle of the output sine wave is 2n/m, and the output frequency (fDDS) and the frequency resolution (fres) are given by the following formulas:

fDDS=

mfclk 2nfres= fclk/2n

For n = 32 and having a clock frequency of fclk = 33 MHz, the frequency resolution is 7.68 mHz. If n is increased to 48, with the same clock frequency, a resolution of 120 nHz is possible.

3 The proposed frequency measurement technique

The idea that led to our present design came from the extremely high frequency resolution of the DDS devices and is enforced by the noise immunity of its closed loop form. A (known) frequency source, the DDS, is employed in a closed loop and is forced progressively to produce an output with a frequency equal to the unknown input . A rule of thumb in the DDS systems is that the maximum acceptable synthesized frequency is about 25% of the clock frequency (well below the Nyquist limit). According to this, our prototype that uses a 33 MHz clock would effectively count up to 8 MHz. Looking at the GaAs products, we can see that recently available DDS devises can operate at clock frequencies up to the extent of 400 MHz. Therefore, by the present method, frequency counters working up to 100 MHz can be designed. The resolution will depend on the number of FSW bits and the clock frequency. The clock frequency fclk of the DDS is very critical because as it decreases, the resolution of the proposed method (defined as fclk/2n) becomes finer i.e. it improves. The impact of the clock frequency decrease is the subsequent decrease of its maximum output frequency that limits the counter's maximum count. The major blocks have been shown . Among them are the Frequency Comparator and the DDS. To overcome some disadvantages of the specific frequency comparator a correction stage has been incorporated. This stage is also used for the measurement extraction in order to display the correct reading.

3.1 Operation of the circuit

The circuit operates in such a way that at the beginning of a new measurement the DDS output frequency would be controlled in a successive approximation way. The initial DDS frequency would be half of it's maximum. In addition, the frequency step of the approximation would equal the 1/4 of the DDS maximum frequency. On every approximation the frequency step is divided by two and added or subtracted to the FSW of the DDS, depending on the output of the Frequency Comparator. The approximation procedure stops when the step size decreases to one. After that, an up/down counter substitutes the approximation mechanism.

The digital FSW, after the appropriate correction and decoding, is presented in an output device i.e. an LCD display or any other suitable means. Alternatively, it can be digitally recorded or it can be read by a computer.

As conclusion of this initial approach we could say that the proposed method is based on a Digital Controlled Synthesizer which is forced to produce a frequency almost equal to the unknown one. 3.2 Frequency comparison

The frequency comparator seems to be the most critical stage of the design. The implementation is based on a modified phase/frequency comparator proposed by Philips in the 74HC4046 PLL device. It consists primarily of two binary counters, counting up to two and an RS flip-flop.

The function of the frequency comparator is based on the principle that the lower frequency, i.e. larger period, includes (embraces) at least one or more full periods of the higher frequency (smaller period). This means that two or more rising edges of the higher frequency waveform are included within the lower frequency period. Considering the above, the circuit operates as follows: When the first counter (#1) encounters two rising edges of the unknown frequency in one period of the DDS, it sets the output of the RS flip-flop. The logic \"1\" of the RS flip-flop acting at the U/D control input of the Up/Down counter forces the DDS to rise its output frequency. On

the contrary, when the second counter (#2) counts two rising edges of the DDS output within a period of the unknown frequency it resets the RS flip-flop's output. This action decreases the frequency of the DDS.

At a first glance one could think that the synthesized frequency could reach the measured one (fin) and then the operation of the counter stops. Unfortunately this is not the case. A dynamic mechanism takes place instead. The circuit needs some time to realize the correct frequency relation. We will refer to this time as \"hysteresis\". Hysteresis depends on the initial timing relation of the DDS output and on the unknown frequency. Initially, during the hysteresis period, the indication regarding the larger frequency is ambiguous i.e. it can be erroneous. The ambiguity settles when two rising edges of the higher frequency waveform occur during one period of the lower one. If we consider the case of the DDS frequency to be equal to the unknown one, we will find that the comparator's output will toggle, indicating alternatively that the DDS frequency is higher or lower than the unknown. This is actually an acceptable and expected condition, because (as in a voltage comparator) an equality indication could not exist. In our case this is not a problem because the circuit is embedded in a closed loop. The loop will act in a manner that after some short time, the hysteresis, the situation will be reversed and so on. The duration of hysteresis is variable. This situation is controlled, as will be explained later. Although an analog implementation of the frequency comparator would look more robust to noise we insisted to the digital implementation for three reasons: ease of implementation in VLSI or Programmable Logic Devices (PLDs) with no need of analog components, wide frequency range of operation and shorter response time.

3.3 Interaction between frequency comparator and digital synthesizer

After the successive approximation of the unknown frequency the Frequency Comparator \"realizes\" that the synthesized frequency is higher (lower) than the unknown one and produces a logic 0 (1) at the output which commands the up/down counter to count in the down (up) direction. As previously mentioned, the output of

this counter is considered to be the FSW to the DDS stage. In the case when the DDS frequency was initially lower, the synthesized frequency will increase progressively to reach the unknown one. This will not be \"realized\" by the frequency comparator and the synthesized frequency will keep on increasing for some clock cycles, until the comparator detects the correct relation of it's two input frequencies, the unknown one and the DDS output. The same phenomenon will be observed for the opposite (decreasing) case also. This is due to hysteresis that was mentioned earlier.

When DDS output (fDDS) has approached fin, due to hysteresis, no specific frequency is synthesized. Instead, it swings between f1 and f2, where f1 and f2 are the two extreme values of the frequency swing lying symmetrically around fin. The DDS output can be considered as a frequency modulated carrier by a triangular waveform. The triangular waveform is the analog representation of the FSW applied to the DDS. lower trace shows a typical output of the Frequency Comparator. In the same figure, upper trace, is shown in analog form the FSW variation as it is trying to approach the correct value. This waveform has been captured using an auxiliary hardware circuit: A digital-to-analog converter (DAC) was connected to the output of the U/D counter (MSBs) in order to study the operation. This DAC is not shown in the block diagram of the circuit. Stated differently, the lower trace is the U/D command (input) to the counter while the upper trace is a hypothetical \"frequency modulating\" waveform. It is obvious that the term \"hypothetical\" is used because there is not such a waveform available somewhere in the circuit (except for the auxiliary DAC). Instead, its numerical equivalent exists. The magnitude of the slope of the elements of the triangular waveform is constant for constant input frequency and depends on the clock of the U/D counter (horizontal axis) and the voltage reference of the DAC (vertical axis). This slope is k • fin.

3.4 Description of the prototype hardware

For evaluation purposes two prototypes have been built and tested in the laboratory. The first approach was a low frequency instrument (operating up to 15

KHz) . The purpose of this implementation was to study the principles of operation of the proposed method. Next, a higher frequency prototype was built which will be described in more detail here. In order to implement the digital part of the prototype, (Frequency Comparator, Successive Counter, Correction Stage) two PLD devices from Altera (EPF 8064LC68-12) were used. These devices are interconnected with the DDS, which is the Q2240I-3S1 from Qualcomm. The DDS has a 32-bit input and a 12-bit output for the sine lookup table (LUT). The 12-bit output of the LUT is fed into the D/A converter, the AD9713B from Analog Devices. Its analog output is connected to an I/V amplifier (current-to-voltage converter).

The generated sinewave has upper harmonics, due to the DAC operation. These harmonics are removed from the filters that follow the DAC. The correction stage is implemented partially on the PLDs and partially on the microcontroller. Based on the up-down command of the frequency comparator we store the two extreme values, FSW1 and FSW2, which are then transferred into the micro-controller (Atmel AT89C52), transformed into numerical representation and fed to the LCD Display. The micro-controller also controls the whole operation of the prototype.

The behaviour of the instrument was according to the expected and was alike to a conventional bench frequency counter. The speed of measurement was checked using lower trace, obtained by the aid of a digital oscilloscope. Each state, high or low, of this waveform corresponds to the time required for one measurement. 4 Conclusion

In this paper an alternative method of frequency measurement has been proposed. It has been pointed out that in most cases this method is faster than conventional methods for the same frequency resolution. On the other hand, the precision of the method can be very high due to the inherent high frequency resolution characteristic of the DDS that is employed. This synthesizer, which can be thought as an oscillator, is driven to \"oscillate\" in the region of the unknown input frequency. A comparison with conventional methods has been given and two prototypes have been built and

tested in the laboratory.

The second major advantage of this method is that if repetitive frequency measurements are to be taken, the instrument remains locked and the frequency measurement does not restart from the beginning, but instead is automatically driven to lower or higher values. In other words, the loop has the capability to follow the changes in the frequency of the input signal. In the conventional counting techniques the counting procedure is repeated (restarted) for each new measurement.

Another important advantage is the noise immunity of the system, due to its closed loop nature. A detailed study of the noise behavior has not been carried out in this paper. This is mainly because the aim of this text is to present an alternative principle of frequency measurement. Moreover, the final output of the system is taken after some further processing (measurement correction) which also contributes to the noise immunity.

中北大学2012届英文文献及中文翻译

借助DDS的精密频率的一种替代方法

频率测量的方法基于闭环组成,主要是一个频率比较器(FC)和直接数字合成器(DDS),对此在本文中进行了介绍。DDS作为标准信号发生器在FC的投入之中扮演一定的角色。FC接受了DDS的硬限幅波形以及未知的频率。从比较两个信号的输出,控制逻辑向上/向下计数器产生了。计数器的输出频率设定字(FSW)代理指示的DDS产生一个新的正弦波频率接近未知之一。当循环沉淀,频率设定字给出了未知的高频数字估计。优势是从DDS固有的高分辨率和环路噪声免疫力而来,从而设计同样精确和不受影响的频率计。所有额外相关的阶段都被仪器的显示器显示出来。 1简介

最常用的测频技术采用计数在预定的时间窗口(光圈)的未知频率的脉冲的计数器。此外,凡任何参考频率的脉冲在一个或多个未知一期计算方法也很常见。在后一种情况下,代替频率的周期只是估计的。本文献的第[1]部分的某些文件处理了低频率的测量问题并集中在心脏(心脏)信号的频率范围(几赫兹)或在电源频率(50-60赫兹)。这些技术实际上是在测量讯号的时间,并使用一些方法来计算它的倒数,即频率。在第[2]中,频率由查找表的方法计算。其他[4-6]的内容是关于微处理器或以微控制器为基础的。上述方法的特点是开环方法,即数字计数器来计数在预定tinle间隔,之后计算结果。其闭环形式刻画了本文提出的方法。这个术语“闭环”我们用来记一些反馈排序。一个已知(控制)的频率波形在电路中产生,并反馈到强制它来接近未知的(输入)的频率的频率比较阶段。产生上述提及的受控的频率波形是一个直接数字合成器。 2.直接数字频率合成器

一个典型的直接数字频率合成器包含一个正弦波(正弦查找表LUT)样品的RAM。在限定相位跳跃的频率设置字的控制方式下来搜寻这些样本。一个典型的频率设置字是32位宽,但48位合成器在较高的频率分辨率也可使用。一个相位累加器产生连续的正弦查找表的地址,并生成一个数字正弦波输出。DDS的数

第1页 共6页

中北大学2012届英文文献及中文翻译

字部分,即相位累加器和查表,被称为数控振荡器(NCO)。最后阶段,这相对于前一个主要是模拟,包括一个D / A转换器在一个过滤器之后。过滤器使数字化的正弦波更平稳,生产连续输出信号。在凡方波输出需要的应用中,这由一个硬限制器在经过过滤器之后得到。这不等于使用例如蓄电池的,而不是硬过滤和波形输出最高位有限,因为会遇到很大的抖动。对于n位系统的输出信号的频率是按以下方式计算的;如果相位步等于1,将累加器的计数加1,以时钟周期,以满足整个LUT和生成一个周期的输出正弦波。这是该系统能生成的最低的频率,也是它的频率分辨率。设置FSW为二,计数器的结果间隔数为二,以时钟周期来完成一个周期的正弦波输出。它可以很容易地表明,对于任意整数m,其中m <,所采取的时钟周期数旨在产生一个输出的正弦波周期/米,输出频率(fDDS)和频率分辨率(fres)给出由下列公式:

fDDS=

mfclk 2nfres= fclk/2n

对于n = 32,有一个fclk = 33 MHz的时钟频率,频率分辨率为7.68兆赫兹。如果n是增加至48个具有相同的时钟频率,分辨率为120 nHz是可能的。 3.被提议的频率测量技术

产生我们目前的设计的想法来自DDS的频率分辨率极高的设备并且由它的封闭循环的形式抗干扰执行。一个(已知)频率源,即DDS,采用于一个闭环并且被迫逐步产生频率等于未知输入输出。一个在DDS系统的经验法则是可以接受的最大合成频率为时钟频率的25%(远低于奈奎斯特限制)。根据这一点,我们的原型使用一个33 MHz的时钟将有效地数到8兆赫。在砷化镓产品来看,我们可以看到,最近的DDS设计可以在高达400兆赫的时钟频率范围运作。因此,目前的方法,频率计数器工作频率达100 MHz是可以设计的。该决议将取决于FSW的数量和时钟频率。 DDS的时钟频率是非常重要的,因为它减小,该方法的决议(定义为fclk /)更出色,即它变得更精细的改进。时钟频率下降的影响是其最大输出频率,限制计数器的最大计数随之降低。主要模块已被证明。其中包括:频率比较和DDS。为了克服特定频率比较器的一些缺点校正阶段已被纳入。

第2页 共6页

中北大学2012届英文文献及中文翻译

这一阶段也可用于测量提取,以显示正确的读数。 3.1电路的操作

该电路工作在一个新的测量DDS的输出频率会在一开始以逐次逼近的方法控制这样一种方式。最初的DDS频率将有一半为它的最大值。此外,该步骤将频率近似等于 DDS的最大频率的1/ 4。根据比较器输出的频率,在每一个近似值中频率被分成两个并且增加或减少到DDS的FSW中。在步长下降到一时逼近过程停止。在此之后,向上/向下计数器替代逼近机制。在适当的修正和解码后,数码的FSW被显示在在一个输出设备中,即一台液晶显示器或任何其他合适的方式。或者,也可以进行数字记录,也可以由计算机阅读。由于这一初步的方法,我们可以说,被提议的方法是基于被迫产生和未知几乎相等的频率的数字控制合成器。 3.2频率比较

频率比较似乎是在设计中最关键的阶段。该实现是基于一种改进的相位/频率比较器,由飞利浦在74HC4046 PLL设备中生产。它主要包括两个二进制计数器,共计两个和一个RS触发器。频率比较器的功能是基于频率较低,即较大的时期的原则,包括(拥抱)至少有一个或多个频率较高(小周期)完整周期。这意味着,两个或两个以上的较高频率上升边缘的波形在较低频率周期内。鉴于上述情况,电路操作如下:当第一个计数器(#1)在一个时期内遇到DDS的两个未知频率的上升边缘,它设置RS触发器的输出。RS触发器的逻辑“1”在向上/向下计数器的U / D的控制输出中起作用,强制DDS升高输出频率。相反,当第二个计数器(#2)在一个周期内记录两个未知的频率的上升的DDS输出的边缘,它又恢复成RS触发器的输出的。这个动作降低了DDS的频率。乍一看人们可以认为,合成频率可达到实测(鳍),然后计数器停止运作。不幸的是并非如此。一个充满活力的机制代替了。该电路需要一些时间来实现正确的频率的关系。我们将把这个时间称为“迟滞”。迟滞取决于最初的DDS输出时序关系和未知频率。最初,在滞后期,有关更大的频率的指示是不明确的,即它可以是错误的。当两个歧义在更高的频率上升边缘波形发生在较低的一个时期。如果我们考虑到案件

第3页 共6页

中北大学2012届英文文献及中文翻译

的DDS的频率等于未知之一,我们会发现,比较器的输出将切换,说明或者是DDS的频率高于或低于下限未知。这实际上是一个可以接受的和预期的条件,因为(在电压比较器)的平等是不可能存在的迹象。在我们的例子中,这不是一个问题,因为这个电路是在一个封闭的循环之中。该循环将采取,经过一段短暂的时间,迟滞等情况将得到扭转的行动方式。滞后的时间是可变的。这种情况被控制,也将在后面解释。虽然模拟执行频率的比较将产生更加强劲的噪音,我们坚持数字实现,原因有三:在超大型积体电路或可编程逻辑器件(PLD)实现容易,没有模拟组件,频率范围宽的操作和更短的需要响应时间。 3.3频率比较器和数字合成器之间的互动

在频率比较器“实现” 的未知频率逐次逼近之后,合成的频率较高(低)于未知,并在控制向上/向下计数器的输出端产生计算向下(上)一个逻辑0(1)的方向。如前所述,这个计数器的输出被认为是从FSW到DDS的阶段。在最初的DDS频率低时,合成频率将会逐步增加,达到未知之一。这不会通过频率比较器“实现”和合成频率将会在一些时钟周期继续增加,直到比较器检测出它的两个输入频率的正确关系,未知的一方和DDS输出。在相反(降低)的情况下,同样的现象也将会被观察到。这是因为前面提到的滞后作用。当DDS输出(fDDS)已接近鳍,由于滞后性,没有特定的频率合成。相反,它摇摆于F1和F2之间,其中F1和F2是频率对称摆动的两个极端值。 DDS的输出可以被看作是一个三角波形的频率调制的载体。三角波形是FSW施加到DDS的模拟表示法。较低的形迹显示一个比较典型的频率输出。在相同的图上,上部的描绘,以模拟的形式显示的FSW的变化,这是因为它企图接近正确的值。利用辅助硬件电路这个波形已被俘获:数字至模拟转换器(DAC)连接到U / D转换计数器(最高位),以研究操作的输出。这款DAC不会显示在电路的框图中。下跟踪的U / D命令(输入)到计数器上,而跟踪是一个假设的“调频”波形被不同的规定。很明显,使用“假设”是因为没有一个可用的波形在电路(除辅助DAC)中。相反,其相等数值存在。三角波形的坡度大小对于常数输入频率是恒定并且取决于U/ D转换计数器(水平轴)时钟和DAC(垂直轴)的电压基准。这里的坡度为k • fin。

第4页 共6页

中北大学2012届英文文献及中文翻译

3.4原型硬件的描述

用于评估的目的,两个原型在实验室已建成。第一种方法是一个低频率的工具(工作达15千赫)。这次实施的目的是研究该原则的操作方法。接下来,一个更高的频率原型制造出来了,在此进行更详细的描述。为了使原型的数字部分(频率比较,连续计数器,校正阶段)生效,两个产自Altera(EPF8064LC68 - 12)的 PLD器件被使用了。这些设备和由高通Q2240I - 3S1所生产DDS相互联系。DDS具有32位输入和一个12位输出的正弦查找表(LUT)。该12位输出的LUT送入到由模拟设备AD9713B发出的D / A转换器中。其模拟输出连接到I / V放大器(电流电压转换器)。由于DAC工作,生成的正弦波具有较高的谐波。这些谐波在DAC之后将从过滤器删除。这次调整阶段一部分实施在PLD一部分在微控制器。基于频率比较器的上下命令,我们存储两个极端值,FSW1和FSW2,然后再进入微控制器Atmel AT89C52)转换成数字表示并反馈到LCD显示器。该微控制器还控制着整个运作的原型。仪器的行为和预期的一样,和常规的频率计数器工作台是一样的。在数字示波器的帮助下,测量采用较低速度跟踪检查。每个状态,波形的高或低,相当于一个测量所需的时间。 4结论

在该文件中频率测量的替代方法已经提出。已经被指明,在大多数情况下,对于相同频率的解决方案,这种方法比传统方法更快。另一方面,由于DDS的固有高频率的特点,该方法的精度非常高。这种可作为振荡器的合成器,在未知的输入频率范围被驱使“振荡”。与常规方法的比较已经给出,两个原型已建成并在实验室测试。这种方法的第二个主要优点是,如果重复频率测量,工具一直锁定,频率测量不重新从头开始,而是自动驱使到更低或更高的值。换句话说,循环有能力按照输入信号频率的变化而改变。在传统的计算技术里,计算过程为每个新的测量而重复(重新启动)。另一个重要优势是该系统的抗噪声能力,由于其闭环的性质。一个详细的噪音行为的研究已经在本文中指出。这主要是因为本文的目的是要提出一个频率测量的替代原理。此外,该系统的最终输出采取了一些进一步的(测量校正)有助于抗噪声能力的后处理。

第5页 共6页

因篇幅问题不能全部显示,请点此查看更多更全内容