Main Content

GSM Digital Down Converter in MATLAB

This example shows how to simulate steady-state behavior of a fixed-point digital down converter for GSM (Global System for Mobile) baseband conversions. The example uses signal processing System objects to emulate the operation of the TI Graychip 4016 Quad Digital Down Converter and requires a Fixed-Point Designer™ license.

Introduction

数字下转换器(DDC)是数字收音机的重要组成部分。它执行频率翻译以将高输入样本速率转换为较低的采样率以进行有效处理。在此示例中,DDC接受带有样本速率的带通信号,约70兆菜(MSP),并执行以下操作:

  • Digital mixing or down conversion of the input signal using a Numerically Controlled Oscillator (NCO) and a mixer.

  • 窄带低通滤波和使用级联的集成板(CIC)和FIR滤波器的滤链进行了拆卸。

  • 获得数据流的调整和最终重采样。

The DDC produces a baseband signal with a sample rate of 270 kilosamples per seconds (KSPS) that is ready for demodulation. A block diagram of a typical DDC is shown below.

if〜iSfixptinstalled错误(消息(消息)'dsp:dspDigitalDownConverter:noFixptTbx'));结尾

Initialization

Create and configure a sine wave source System object to model the GSM source. You set the object's frequency to 69.1e6*5/24 MSPS because, after digital mixing, the object will have a baseband frequency of around 48 KSPS. Because the system you are modeling resamples the input by a factor of 4/(3*256), you need to set the object's frame size to be the least common multiplier of these factors.

FS = 69.333E6;框架= 768;正弦= DSP.SineWave(...'Frequency',69.1e6*5/24,...'采样率',fs,...'方法',,,,'Trigonometric function',,,,...“ SampleSperFrame”,,,,FrameSize);

创建并配置NCO系统对象以混合并转换转换GSM信号。Ti Graychip要求调谐频率(相位启动属性)为具有32位分数长度的32位数据类型。相位偏移量必须是具有16位分数长度的16位数据类型。为了减少幅度量化噪声并将伪频率传播到可用的带宽上,请在累加器相值中添加抖动信号。通常,抖动位(14)的数量是累加器单词长度(32)和表地址单词长度(18)之间的差异。

nco = dsp.nco(...'PhaseIncrementSource',,,,'Property',,,,...'PhaseIncrement',int32((5/24) *2^32),...“阶段”,,,,int16(0),...'numditherbits',14,...'NumQuantizerAccumulatorBits',18,...'Waveform',,,,“复杂指数”,,,,...“ SampleSperFrame”,框架,...“累积”,,,,'Custom',,,,...“ CustomAccumulatOtatype”,numerictype([],32),...'OutputDataType',,,,'Custom',,,,...'CustomOutputDataType',,,,numerictype([],20,18));

Create and configure a CIC decimator System object that decimates the mixer output by a factor of 64. CIC filters can achieve high decimation or interpolation rates without using any multipliers. This feature makes them very useful for digital systems operating at high rates.

M1 = 64;cicdec = dsp.cicdecectarator(...“取理”,,,,M1,...“数字”,,,,5,...'FixedPointDataType',,,,'Minimum section word lengths',,,,...“输出Wordlength”,,,,20);

Create and configure an FIR decimator System object to compensate for the passband droop caused by the CIC filter. This filter also decimates by a factor of 2.

GSMCoeffs;% Read the CFIR and PFIR coeffsM2 = 2; cfir = dsp.FIRDecimator(M2, cfir,...“系数数据型”,,,,'Custom',,,,...“ CustomCoefficientsDatatype”,numerictype([],16),...“ Full PrecisionOverride”, 错误的,...'OutputDataType',,,,'Custom',,,,...'CustomOutputDataType',numerictype([],20,-12));

Create and configure an FIR decimator System object to reduce the sample rate by another factor of 2.

M3 = 2;pfir = dsp.firdecimator(m3,pfir,...“系数数据型”,,,,'Custom',,,,...“ CustomCoefficientsDatatype”,numerictype([],16),...“ Full PrecisionOverride”,,,,false,...'OutputDataType',,,,'Custom',,,,...'CustomOutputDataType',numerictype([],20,-12));

创建并配置FIR速率转换器系统对象,以重新置于最终输出为4/3。

firrc = dsp.FIRRateConverter(4, 3, fir1(31,0.25),...“系数数据型”,,,,'Custom',,,,...“ CustomCoefficientsDatatype”,,,,numerictype([],12),...“ Full PrecisionOverride”,,,,false,...'OutputDataType',,,,'Custom',,,,...'CustomOutputDataType',numerictype([],24,-12));

创建指定数字类型的FI对象,以充当正弦输出的数据类型转换。

gsmsig = fi(Zeros(768,1),true,14,13);

Create a fi object of specified numerictype to store the fixed-point mixer output.

mixsig = fi(zeros(768,1),true,20,18);

Create and configure two Time Scope System objects to plot the real and imaginary parts of the FIR rate converter filter output.

timescope1 = timescope(...'姓名',,,,'Rate Converter Output: Real Signal',,,,...'采样率',FS/256*4/3,...'TimeSpanSource',,,,'财产',,,,...'时间跨度',,,,1.2e-3,...'ylimits',[-2E8 2E8]);pos = timescope1.position;timescope1.position(1:2)= [pos(1)-0.8*pos(3)pos(2)+0.7*pos(4)];timescope2 = timescope(...'姓名',,,,'Rate Converter Output: Imaginary Signal',,,,...'Position',,,,[pos(1)-0.8*pos(3) pos(2)-0.7*pos(4) pos(3:4)],...'采样率',FS/256*4/3,...'TimeSpanSource',,,,'财产',,,,...'时间跨度',,,,1.2e-3,...'ylimits',[-2E8 2E8]);

创建和配置两个频谱分析仪系统对象,以绘制NCO输出的功率谱和补偿的CIC分解器输出的功率谱。

specScope1 = dsp.SpectrumAnalyzer(...'姓名',,,,'DSPDC:NCO输出',,,,...'采样率',,,,Fs,...'FrequencySpan',,,,“开始和停止频率”,,,,...“ starterfquency',,,,0,'StopFrequency',FS/2,...'rbwsource',,,,'Property',,,,'RBW',,,,4.2e3,...'SpectralAverages',1,...'Title',,,,'Power spectrum of NCO output',,,,...'Position',,,,[pos(1)+.8*pos(3) pos(2)+0.7*pos(4) pos(3:4)]); FsCICcomp = Fs/(M1*M2); specScope2 = dsp.SpectrumAnalyzer(...'姓名',,,,“ DSPDC:补偿的CIC解剖器输出”,,,,...'采样率',fsciccomp,...'FrequencySpan',,,,“开始和停止频率”,,,,...“ starterfquency',,,,0,'StopFrequency',,,,FsCICcomp/2,...'rbwsource',,,,'Property',,,,'RBW',,,,4.2e3,...'SpectralAverages',1,...'Title',,,,'Power spectrum of compensated CIC decimator output',,,,...'Position',[pos(1)+。8*pos(3)pos(2)-0.7*pos(4)pos(3:4)]);

处理循环

在处理循环中,混音器前端数字下降将GSM信号转换为基带。CIC的分解和补偿过滤了信号128倍,可编程FIR滤波器的另一个因素为2,以达到256的总体拆卸。重新采样后端执行其他应用特定的过滤。运行100次迭代的处理循环等同于处理重采样输出的1.1毫秒左右。

%为四个范围创建一个容器scopescontainer = HelperCreatesCopesContainer(...{timeScope1,specScope1,timeScope2,specScope2},...'姓名',,,,'Digital Down Converter',,,,...'布局',[2 2],,...'ExpandToolstrip',,,,false);为了ii = 1:100 gsmsig(:) = sine();%GSM信号ncosig = nco();%NCO信号mixsig(:) = gsmsig。*ncosig;% Digital mixer% CIC filtering and compensationycic = cfir(cicdec(mixsig));%可编程的FIR和样品速率转换yrcout = firrc(pfir(ycic));%频率和时间域图timescope1(real(yrcout));timescope2(imag(yrcout));Specscope1(ncosig);Specscope2(YCIC);结尾release(timeScope1); release(timeScope2); release(specScope1); release(specScope2);

Conclusion

In this example, you used DSP System Toolbox™ System objects to simulate the steady-state behavior of a fixed-point GSM digital down converter. The Time Scope and Spectrum Analyzer System objects enable you to analyze the various stages of a DDC.