File Exchange Pick of the Week

我们最好的用户提交

Delta Sigma Toolbox

念客本周的选择是Delta Sigma ToolboxbyRichard Schreier

Delta-Sigma(或Sigma-Delta)调制器通常在电子元件中找到,例如模数和数模转换器(ADC和DAC),越来越多地在[Fractional-N]频率合成器(PLL)中,以及切换 -模式电源。一般而言,Δ-Σ调制器在其输出(0/1)处产生高度采样的二进制信号,其可以是低通滤波以再现输入信号。下面的图1显示了示例输入和输出信号。阅读更多关于Delta-Sigma调制器的更多信息,去这里,这里, 和这里。Richard的教科书也是一个很好的资源:Schreier和Temes(ISBN 0-471-46585-2)“了解Delta-Sigma数据转换器”。

There is a large body of literature dedicated to analysis and design of delta-sigma modulators, and the Delta Sigma Toolbox provides a great tool for analyzing these components in MATLAB. The toolbox contains a fairly complete list of well documented functions to construct, analyze, and simulate delta-sigma modulators of arbitrary order. The full documentation for the toolbox is provided in DSToolbox.pdf (part of the download).

要开始使用工具箱,我强烈建议在研究提供的示例和演示文件(DSDEMO1-8.M.Dsexample1-4.1). I like dsdemo2.m as a starting tutorial. It begins by creating a noise transfer function (NTF), and then simulates the modulator with an example sinusoidal input:

OSR = 32; H = synthesizeNTF(5,OSR,1); N = 8192; fB = ceil(N/(2*OSR)); ftest=floor(2/3*fB); u = 0.5*sin(2*pi*ftest/N*[0:N-1]);% half-scale sine-wave inputv = simulateDSM(u,H);

时域输出显示正弦输入(红色)和二进制输出(绿色)。

还可以使用MATLAB的FFT功能轻松计算输出的频谱:

This figure looks like the superposition of two signals: the spike at ftest/N (0.0104 in this case) which represents the input sinusoid, and some high frequency "noise". The high-pass noise is in fact one of the desirable properties of delta-sigma converters; these converters shift the quantization noise to high frequencies, i.e., away from our signal/carrier of interest. It should be self-evident from Figure 2 that a simple low-pass filter of this output signal would yield the original sinusoidal input.

在DSDEMO2.M中,在输出信号上计算SNR,也使用Delta Sigma Toolbox功能计算和显示调制器的预期(理论)响应(粉红色打击所示)。

该代码的下一部分计算预期和模拟的信号到量化噪声(SQNR),这是分析模数转换器时的优点。

该演示的其余部分基本上重复相同的过程,而是用于带通信信号。也就是说,它不使用低频正弦曲线作为输入,它使用载波信号,这使得我们的输出频谱外观如图5所示(这里的载波在归一化频率轴上的FS / 8或0.125处)。

I encourage you to download the toolbox and run through the demos. Even if you do not use the toolbox for any simulations of your own, these demos can serve as a great learning tool (along with freely available online resources mentioned above).

Other MathWorks resources:

如果您对Delta-Sigma调制器(以及其他混合信号组件)感兴趣,请考虑下载Mixed-Signal Library for Simulink。另外,看看MathWorks混合信号页, particularly the ADC section.

Delta-Sigma Toolbox使用说明:

  • A few C files are provided in the Toolbox that the user needs to compile to MEX (e.g., simulateDSM.c). This is generally done as:
梅克斯simulateDSM.c

但正如文件交换的评论所指出的那样,某些系统失败。简单地定义_STDC_符号应该解决问题:

梅克斯simulateDSM.c-d__stdc__

Note that you will need a C compiler for this step. Run梅克斯–setup在MATLAB命令提示符以设置C编译器。

  • If you plan on using the Delta Sigma Toolbox frequently, you should probably add the toolbox folder to your MATLAB path:
addpath('\delsig')保存灵活

Suggestions for improvements

  • 一个伟大的除了provided example/demo files would be the use ofsections,也许是publish功能要包含每个文件的完整写入和描述。
  • Providing an Install script would be great (to take care of MATLAB path and compiling MEX files).

评论

As always, your thoughts and comments这里非常感谢。




Published with MATLAB® R2013a

|
  • print
  • send email

评论

To leave a comment, please click这里to sign in to your MathWorks Account or create a new one.