主要内容

数字上下转换家庭广播服务

此示例显示了如何使用数字UP转换器(DUC)和数字下转换器(DDC)系统对象来设计家庭无线电服务(FRS)发射器和接收器。这些对象提供了设计插值/拆卸过滤器的工具,并简化了实现向上/下转换过程所需的步骤。此示例说明了MATLAB®和SIMULINK®实现。万博1manbetxMATLAB版本使用DUC和DDC的系统对象,而Simulink版本则使用DUC和DDC的块。万博1manbetx在这两个版本中,语音信号都被用作输入,并且传输后的信号会播放。

FRS is an improved walkie talkie FM radio system authorized in the United States since 1996. This personal radio service uses channelized frequencies in the ultra high frequency (UHF) band. Devices operating in the FRS band must be authorized under Part 95 Subpart B "Family Radio Service" (Sections 95.191 through 95.194) of the FCC rules. The authorized bandwidth of FRS channels is 12.5 KHz and the center frequency separation between channels is 25 KHz.

介绍

该示例讨论了要通过FRS通道传输的信号的数字上升转换,以及来自FRS无线电发射机的信号的向下转换。

8 kHz的演讲首先重新采样至50kHz。发射机上的DUC将信号从50 kHz转换为2 MHz,并将信号转移到IF频率为455 kHz。

The receiver has an analog front end that brings the received signal to an IF frequency of 455 KHz. The signal is then sampled at a rate of 2 MHz. The DDC at the receiver brings the signal back to baseband with a sample rate of 50 KHz. This is brought back to 8 KHz speech range.

数字转换器设计

You design a digital up converter by creating a DUC System object. The DUC object consists of a cascade of three interpolation filters and an oscillator that up converts the interpolated signal to a specified passband frequency. A block diagram of the DUC object is shown next.

DUC对象提供了定义插值过滤器的选项。例如,您可以使用正弦波发生器或数值控制的振荡器设计振荡器。以下一节展示了用于设计FRS发射器的插值过滤器的不同选项。

设计插值过滤器

The DUC object implements the interpolation filter using three filter stages. When the DUC object designs the filters internally, the first stage consists of a halfband, or a lowpass filter, the second stage consists of a CIC compensator, and the third stage consists of a CIC interpolation filter. The DUC object allows you to specify several characteristics that define the response of the cascade for the three filters, including passband and stopband frequencies, passband ripple, and stopband attenuation.

最低订单过滤器设计

By default (when the最小订购设计property is set to true) the DUC object obtains minimum order interpolation filter designs using the passband and stopband specifications you provide.

For this FRS example, you must up sample the transmitted signal from 50 KHz to 2 MHz. This yields an interpolation factor of 40. The DUC object automatically factors the interpolation value so that the first filter stage interpolates by 2, the second filter stage interpolates by 2, and the CIC filter interpolates by 10.

FRS通道双面带宽为12.5 kHz。设置BandwidthDUC对象的属性为12.5 kHz,因此插值过滤器的级联反应的通频频率为12.5e3/2 = 6.25 kHz。

设置passband ripple to a small value of 0.05 dB to avoid distortion of the FRS signal. Set the stopband attenuation to 60 dB.

By default (when theStopbandfrequencysourceproperty is set to 'Auto') the DUC object sets the cutoff frequency of the cascade response approximately at the input Nyquist rate of 25 KHz. The object also sets the stopband frequency at 2Fc-Fpass = 2*25e3 - 12.5e3/2 = 43.75 KHz, where Fc is the cutoff frequency and Fpass is the passband frequency. In this scenario, the DUC object relaxes the stopband frequency as much as possible, obtaining the lowest filter orders at the cost of allowing some energy of interpolation replicas in the transition band of the cascade response. This design tradeoff is convenient when your priority is to minimize filter orders.

DUC = dsp.DigitalUpConverter(...'SampleRate',50E3,...'InterpolationFactor',40,...'带宽',12.5e3,...'PassbandRipple',0.05,...“ stopbandAttantuation”,,,,60);

Visualize the cascade response of the decimation filters using thefvtoolorVisualizeFilterStagesDUC对象的方法。将算术指定为'double'so that the filter coefficients and operations are double-precision.

fvt = fvtool(DUC,'算术',,,,'double');

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

close(fvt) fvt = visualizeFilterStages(DUC,'算术',,,,'double');

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含5个类型线的对象。这些对象代表半带插值器,插值因子= 2,CIC补偿器,插值因子= 2,CIC插值因子,插值因子= 10,级联反应。

使用使用的过滤器的订单getFilterOrders方法。

s = getFilterOrders(DUC); s.FirstFilterOrder
ANS = 10
S.secondfilterorder
ANS = 12

The FRS channel separation is 25 KHz. Most commercial FRS radios offer 50 dB or higher adjacent channel rejection (ACR). Clearly, the cascade response of the decimation filters designed above does not achieve a 50 dB attenuation at 25 KHz. One possible solution to this problem is to filter the baseband FRS signal with a lowpass filter with the required transition width and stopband attenuation before passing the signal through the DUC object. Another solution is to set the DUC object so that it designs a cascade response with a narrower transition bandwidth that meets the required spectral mask. To design an overall filter response with a narrower transition bandwidth, set theStopbandfrequencysource财产为'Property'StopbandFrequency属性为所需的值。

Design the filters so that the cascade response has a stopband frequency at the edge of the passband of the adjacent FRS channel, i.e. at 25e3-12.5e3/2 = 18.75 KHz. Set theStopBandAttAntuation财产为60 dB to achieve a 60 dB ACR.

duc.stopbandfrequencysource ='Property';duc.StopbandFrequency = 18.75e3;duc.StopbandAttAttenuation = 60;关闭(fvt)fvt = fvtool(duc,'算术',,,,'double');

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

获取过滤器订单

s = getFilterOrders(DUC); s.FirstFilterOrder
ANS = 23
S.secondfilterorder
ANS = 7

新的级联反应在25 kHz(即相邻FRS通道的中心)达到60 dB的衰减。第一阶段过滤器(低通插机)的顺序从10增加到23。但是,请注意,第二阶段过滤器(CIC补偿器)的顺序从12降低到7。因为第一阶段响应的带宽较窄,所以第二阶段的带宽可以将停止带更大的放松到第一阶段过滤器的第一副本的左停靠带的边缘。由于第二个滤波器阶段以较高的速度运行,因此这是一个非常方便的订单降低。

控制过滤器订单

在某些情况下,过滤器订单是主要设计约束。设置最小订购设计属性为False以设计特定订单设计插值过滤器。在此配置中,您仍然可以指定所需的PassBand和stopband频率。过滤器的订单控制级联反应的停止带衰减和波纹。

要满足第一个滤波器阶段中最多20个系数的约束,请设置FirstFilterOrder财产为20. Set the第二次换句话财产为7, and the number of CIC sections to 4.

% Keep a copy of the minimum order design so that we can use it later on%示例。DUCMinOrder = clone(DUC);%指定过滤器订单并可视化级联反应。duc.minimumorderdesign = false;duc.firstfilterorder = 20;duc.secondfilterorder = 7;duc.numcicsections = 4;关闭(fvt)fvt = fvtool(duc,'算术',,,,'double');

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含2个类型线的对象。

由于第一个过滤器订单减少,新设计具有较低的停止带衰减和较大的通带纹波。

振荡器设计

使用振荡器属性要选择对象用来执行频率向上转换的振荡器类型。将属性设置为'Sine wave'从使用三角函数的样品计算的正弦的振荡器信号。或者,将属性设置为'NCO'so the object designs a numerically controlled oscillator. Set the center frequency of the oscillator to the IF frequency of 455 KHz.

DUC.Oscillator ='Sine wave';duc.centerfquency = 455e3;

数字下转换器设计

You design a digital down converter (DDC) by creating a DDC System object. The DDC System object consists of an oscillator that down converts an input signal from a specific passband frequency to 0 Hz. The object down samples the down converted signal using a cascade of three decimation filters. The following block diagram shows the DDC object.

与DUC情况一样,DDC对象提供了定义拆卸过滤器的不同选项。例如,您可以使用正弦波发生器或数值控制的振荡器设计振荡器。另外,您可以提供振荡器信号作为输入。

设计拆卸过滤器

The DDC object implements decimation using three filter stages. When the object designs the filters internally, the first stage consists of a CIC decimator, the second stage consists of a CIC compensator, and the third stage consists of a halfband, or a lowpass, decimation filter. As in the DUC case, the DDC object allows you to specify characteristics that define the response of the cascade of the three filters, including passband and stopband frequencies, passband ripple, and stopband attenuation.

设计最小订单拆卸过滤器以接收以455 kHz频率为中心的FRS信号。将信号降低40,将其从2 MHz缩短到50 kHz。设置Stopbandfrequencysource财产为'Property'止回局局限于60 dB,以设计达到60 dB的级联反应。

ddcminorder = dsp.digitaldownconverter(...'SampleRate',2e6,...“取理”,40,...'带宽',12.5e3,...'PassbandRipple',0.05,...“ stopbandAttantuation”,,,,60,...“ stopbandfrequencysource',,,,'Property',,,,...“ stopbandfquency',18.75e3,...“中心频率”,455E3);

分析清除器过滤器的响应,并验证级联反应是否达到25 kHz的60 dB的衰减。请注意,DDC如何放松第二阶段(CIC补偿器)对第三阶段(低通删除器)第一个别名的左挡侧边缘的响应,以最大程度地减少顺序。

关闭(fvt)fvt = visualizeFilterStages(ddcminorder,'算术',,,,'double');

图量响应(DB)包含一个轴对象。带有标题幅度响应(DB)的轴对象包含5个类型线的对象。这些对象代表CIC清除剂,分解因子= 10,CIC补偿器,分解因子= 2,低通切除剂,分解因子= 2,级联反应。

与DUC情况类似,您可以通过设置过滤器定义过滤器订单最小订购设计属性为false。

MATLAB处理循环

FCC第95部分指定最大频率偏差为2.5 kHz的FM调制,最大音频频率为3.125 kHz。频率调节音频信号以获得FRS基带信号(该信号不包括静脉音调)。使用DUC和DDC对象转换并向下转换基带FRS信号,这些DUC和DDC对象使用最小订单过滤器在先前的部分中设计。解码信号并使用音频播放器播放。

% Initialize simulation parameters关闭(FVT)FS = 50E3;Framelength = 1000;maxaudiofquency = 3.125e3;% Maximum allowed audio frequency for FRS radiosdeltaf = 2.5e3;FRS收音机的最大允许频率偏差%freqsensitivityGain = deltaf*2*pi/fs;%k = fd/a*(2*pi*ts)ModulationFilter = DSP.IIRFILTER('分子',1,“分母”,[1,-1]);DemoDulationDelay = dsp.delay(1);AudiorAder = DSP.AudioFilereAder('speech_dft_8kHz.wav',,,,...'PlayCount',,,,3,'SamplesPerFrame',,,,frameLength); SRCTx = dsp.SampleRateConverter(“输入更采样”,,,,audioReader.SampleRate,...“输出更采样”,fs,'带宽',,,,6.25e3); SRCRx = dsp.SampleRateConverter(“输入更采样”,fs,...“输出更采样”,,,,audioReader.SampleRate,'带宽',,,,6.25e3); audioWriter = audioDeviceWriter('SampleRate',,,,8e3); DUCMinOrder.CenterFrequency = 455e3; basebandSignalSpectrum = spectrumAnalyzer(...'方法',,,,'welch',,,,'AveragingMethod',,,,'exponential',,,,...“忘记factor',,,,0.1,...'SampleRate',fs,'ShowLegend', 真的,...“频道名称”,{'Baseband input',,,,“输出输出”},,...'标题',,,,'Power spectrum of baseband signal'); upConvertedSignalSpectrum = spectrumAnalyzer(...'方法',,,,'welch',,,,'AveragingMethod',,,,'exponential',,,,...“忘记factor',,,,0.1,...'SampleRate',,,,Fs*DUCMinOrder.InterpolationFactor,...'标题',,,,'Power spectrum of signal after DUC');

Stream data

尽管~isDone(audioReader)%输入语音信号audioIn = audioReader();% ResampleAUDIOIN_200KHz = SRCTX(AUDIOIN);% FM ModulationXFMBASEBASE = EXP(1J * freqsensitivityGain * ModulationFilter(AudioIn_200KHz));% Up conversionxup = ducminorder(xfmbaseband);UpConvertedSignalSpectrum(XUP);% Down conversionxDown = ddcminorder(xup);BaseBandSignalSpectrum([XFMBaseBand,XDown]);% FM Demodulationaudioout_200khz = angle(demodulationdelay(xdown)。* conj(xdown));% ResampleAudioOut = SRCRX(AudioOut_200KHz);%播放音频AudioWriter(AudioOut);end% Cleanuprelease(audioReader); release(SRCTx); release(ModulationFilter); release(DUCMinOrder); release(DDCMinOrder); release(DemodulationDelay); release(SRCRx); release(basebandSignalSpectrum);

release(upConvertedSignalSpectrum);

释放(AudioWriter);

Simulink Version

上面显示的家庭无线电服务设置可以使用Simulink建模万博1manbetx该服务l Down-Converterand该服务l Up-Converter块。这是在模型中实现的FamilyRadioserviceExample.slx。在运行仿真时,您可以使用模型中的开关处理输入语音信号或信号。

open_system('familyRadioServiceExample'); sim('familyRadioServiceExample');

Figure UpConverted Signal Spectrum Analyzer contains an axes object and other objects of type uiflowcontainer, uimenu, uitoolbar. The axes object with title Power spectrum of signal after DUC contains an object of type line. This object represents Dataflow Subsystem/Up-converted signal.

Figure Baseband Spectrum Analyzer contains an axes object and other objects of type uiflowcontainer, uimenu, uitoolbar. The axes object with title Power spectrum of baseband signal contains 2 objects of type line. These objects represent Dataflow Subsystem/Baseband signal, Dataflow Subsystem/Down-converted signal.

Using Dataflow in Simulink

您可以配置此示例使用数据驱动的execution by setting the Domain parameter to dataflow for Dataflow Subsystem. With dataflow, blocks inside the domain execute based on the availability of data as opposed to Simulink's sample time. Simulink automatically partitions the system into concurrent threads. This autopartitioning accelerates simulation and increases data throughput. To learn more about dataflow and how to run this example using multiple threads, seeMulticore Execution using Dataflow Domain

结论

在此示例中,您使用DUC/DDC系统对象为FRS发射器和接收器设计了一个数字上下转换器。该示例探索了DUC/DDC对象提供的不同选项,以设计插值和拆卸过滤器。该示例还探索了DDC/DUC对象中可用的过滤分析工具,例如VisualizeFilterStages,,,,fvtool, 和getFilterOrdersmethods. A Simulink implementation for the configuration was also modeled.

The DUC/DDC objects designed in this example operate with double-precision filter coefficients and double-precision arithmetic. See the数字下转换器的设计和分析例如,如果您有兴趣设计使用定点输入的DUC或DDC。

CLOSS_SYSTEM('familyRadioServiceExample',,,,0);