PDM转PCM参考文献文献

所需积分/C币:34 2017-12-26 17:28:40 755KB PDF
收藏 收藏 8
举报

在PDM转PCM中使用cic滤波器,半带滤波器,低通滤波器,有MATLAB仿真图和部分代码,对理解原理有很好的作用
t ANALOG DEVICES CLK UTEN 1QUTDIS DATA1 OUTDIS DATA2 -,ouTEN Figure 2. Timing diagram of the data driven by the microphone Figure 2 shows the timing of the data driven by the microphones with respect to the clock based on the l/R pin of the microphone. If the L/R pin is tied to the GND pin, the data is driven on the rising edge of the clock. If the l/R pin is tied to VDD pin the data is driven on the falling edge of the clock The ADMP421 device has a high signal-to-noise-ratio(SNR) and high sensitivity, making it an excellent choice for far field applications. The ADMP42 1 part has a flat wideband frequency response, resulting in natural sound with high intelligibility. Low current consumption and a slecp mode enable long battery lifc for portable applications. a built-in particle filter provides for high reliability. The ADMP421 device complies with the TIA-920 Telecommunications Telephone Terminal equipment Transmission Requirements for wideband Digital Wire line Telephones standard 3 Introduction to Pulse Density Modulation 21 Pulse density modulation, or PDM, is a form of modu lation used to represent an analog signal in the digital domain. In a PDM signal, specific amplitude values are not encoded into pulses as they would be in PCM. Instead it is the relative density of the pulses that corresponds to the analog signal s amplitude In a pulse density modulation bit stream a"1 corresponds to a pulse of positive polarity(+A)and a"0 corresponds to a pulse of negative polarity (-A) Mathematically, this can be represented as Equation 1. Pulse density modulation Where x[n] is the bipolar bit stream(either -A or +A)and a [n] is the corresponding binary bit stream (either o or 1) To get the framed data from the pdm bit stream, decimation filters are usually used in sigma delta analog- to-digital converters(ADCs). a widely adopted approach in this context is using CiC filters(also known as sinc filters)at the first stage of decimation to reduce the sampling frequency, followed by 2: 1 half- Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 2 of 10 ANALOG DEVICES band low-pass decimation filters to take out the high frequency noise introduced in the sigma delta modulation process and the further decimation. This EE-Note demonstrates a way to achieve a seamless interface between a Blackfin processor and the MEMs microphones by implementing the above mentioned filter functionalities in software 4 System Level design A system level block diagram of the set up is shown in Figure 3 below. The data coming out of the microphone is sent to the decimation process which consists of three parts: a cic decimation filter converting 1-bit Pdm data to framed data, followed by two 2: 1 half band filters and an fir filter in the final stage eliminating the high frequency noise generated in the sigma delta modulation process in the Microphone. The reconstructed audio is sent to a dac for audio output purpose L/R DATA1 DATA BLACKFIN Microphone 1 CLOCK DAC 2 1HB 2-1HB FIR low GND Decimator filt filter s filter 2-1HB 2-1HB FIR lOW DATA2 Decimator fil Iter filter pass filter Microphone 2 SPEAKER CLOCK GND Figure 3. Interfacing two MEMS microphones to a blackfin processor 4. 1 Hardware Interface The ADMP421 MEMS microphone is interfaced to the blackfin processor over the Serial Port(SPORT) The microphones can drive the pdm data on either rising edge or falling edge of the clock based on the logic level at the L/R select pin. Inter facing a single microphone to the dsp is straight forward. All that needs to be done is to provide the same clock (in the range of 1 to 3 Mhz to the microphone and the SPORT and receive the Pdm data into the processor from the SPORT, while keeping the l/R pin tied to GND or VDD. To connect two such microphones to a sing le serial port data line, the L/R select pin of one microphone has to be grounded. The I/R select pin of the other microphone must be connected to VDD This ensures that the microphones drive data on opposite edges of clock. To make the SPOrT receive data from both microphones, the microphones have to be clocked at half the rate of the clock at which the SPORT RX is running. Either an external clock source or the SPort itself can generate these clocks. The microphone modulates audio signals with respect to the clock fed to it 4.2 Software routines The frequency of the Pdm data output from the microphone(which is the clock input to the microphone must be a multiple of the final audio output needed from the system. For example, in the current implementation, we are doing a decimation of 32; for the output rate of 96 kHz, we need to provide a Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 3 of 10 ANALOG DEVICES clock frequency 3.072 MHz to the microphone. For a two-microphone interface, the clock to the microphones remains the same but the SPORt should run at double the frequency of the microphones to catch bits from both microphones. In either case, the software routines should operate on bits(not words as the data coming out of MEMs microphone is I bit PDM stream. For a two-microphone interface, the data in the receive buffer will inter laced bit by bit. Therefore, software routines must ensure that the data from two microphones are processed separately since the sigma-delta modulator inside the microphone is of the 4 order, a 5 order Cic decimator is implemented in the Blackfin processor to reconstruct the audio bit stream. The CIC stage will be followed by two 2: I half-band decimation stages and then low- pass filtered to get framed audio data. System designers can add custom audio algorithms(such as audio compression) on the audio data taken from microphones, after the fir stage. The example code included in the associated. ZIp file provides details on the described implementation methods 4.3 Identifying the Source Microphones of the Interlaced Data For a two-microphone interface, the data inside the receive buffer will be inter laced bit by bit. This means that every alternate bit belongs to the same microphone To understand which microphone the alternate bits belong, you need only to connect the microphone's clock( which is one half of the clock at which the SPORT is running) to the sPort frame sync pin and run the sPort in unframed mode. The SPORT only starts receiving the data from the first rising edge of the microphones clock and this will be the data from that microphone, whose l/R select pin is shorted to vDd(which means that the microphone drives the data on the rising edge of the clock). For details, refer to the aDMP421 device data sheet 5). So, in all cases, the data stream inside the data buffers starts from the data from this microphone and the software routines are written such that data from different microphones are processed separately 4.4 CIC Filters Cascaded Integrator-Comb(CIC) filters are a class of linear phase Fir filters comprised of a comb part and an integrator part. The transfer function of a cic decimator filter is 1 2RM)N RM-1 H(2=HN(HN(2)=-IN ∑ h=0 Equation 2. Cc decimator filter transfer function Where HI is the transfer function of the integrator part of the filter Hc is the transfer function of the comb part of the filter n is the number of sections The number of sections in a CiC filter is defined as the number of sections in either the comb part or the integrator part of the filter, not as the total number of sections throughout the entire filter R is the decimation factor M is the differential delay Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 4 of 10 ANALOG DEVICES Figure 4 shows the block diagram of a t h order cic decimation filter used for reconstructing the audio which comprises integrators, comb filters, and decimator Integrator Section Comb section Stage1…… Stage5 tage l Stage 5 Input Output x(n) +-R →X Figure 4.5 order cic decimator block diagram igure 5 and Figure 6 taken using MATLAB Software show the magnitude and frequency responses of the cic decimation filter with decimation factor 8 and order 5 Magncude R:eponee (B) - Fra :t: erene Normalized Frequency (z rad/ sample) Figure 5 Magnitude response of C/C filter Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 5 of 10 ANALOG DEVICES Figure 6. Freguency response of cic filte 4.4.1 Software Implementation of CIC Decimation Filter The CIC decimation filter, which plays the major role in the application, has been implemented in C language. The snippet below explains the code flow / Below is The CIc decimation filter functionality which gets called after every time one input buffer is ready for the processing* / loop over 16 bits and operate on every alternate bit for two microphones which leans an operation of divide by 8 decimation * / GetBit( functions extracts each bit from the received pdM data in the buffer */ //Sigma operations =or the PDM data from L Microphone for(i=C; i<l6; i=i+2) Sigma I 1 + GetBit(buffrj,i L 2 + Sigma L ma l 3 + Sigma I 2 Sigma t 4 + sigma T. 3 Sigma I 5 Sigma L 1 //Delta operations for the PDM data from L, Microphone Delta l 1= Sigma l 5 -oldsigma I 5 Delta l 2= Delta l 1-0ldDelta De⊥taI3=De⊥ta2-O⊥dDe⊥taL2; Delta I 4= Delta l 3- 0ldDelta L 3 Result Delta l 4 -olade lta l 4 Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 6 of 10 ANALOG DEVICES / framed data from I microphone to be sent for FIR decimation is stored in Result Since the operation is 5 stage divided by 8 decimation this field car grow upto 13 bits. In case the designers want higher decimation than 8 bits (say 16) in the CIC stage, they need to take care of the register growth of the CIC egisters. * input[j]= Resultli /* Same procedure has to be applied on the data from the other microphone as well Refer the code attached with the application note for complete filter function Listing 1. C/C decimation filter code snippet 4.5 Half-Band Filtering Half-band filters are widely used in multi-rate signal processing applications when nterpolating/decimating by a factor oftwo Half-band filters have two important characteristics: the passband and stopband ripples must be the same and the passband-edge and stopband-edge frequencies are equidistant from the half-band frequency pi/2 4. 6 FIR LOW-Pass Filter Low-pass filtering must occur after the Cic stage to remove the high frequency noise introduced by the analog-to-digital conversion process in the microphone MATLAB was used to generate the Fir filter coefficients and the optimized library functions for a 16-bit Fir operating on fractional values in blackfin processors uscd for the filtering purposc. Figure 7 shows the frequcncy response for the 6-kHz Fir low pass filter with 297 taps -20 号40………一………… …====== m 10 Frequency(kHz) Figure 7 Magnitude response of FIR low-pass filter Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 7 of 10 t ANALOG DEVICES 5 Experimental results The experimental set up consists of two MEMS microphones. Both microphones are connected to the Blackfin SPORt interface. The ADSP-BF533 EZ-KIT Lite@ evaluation platform has been selected for interfacing to the microphones. Having said this, any of the existing blackfin evaluation boards can be used for this same purpose The microphones are clocked at 3.072 MHz, while the sport receives the data at 6. 144 MHz. The data stream is operated on by a divided-by-& CiC decimator and the received pdm data is being sent out in 13 bit framed data at 384 kHZ. This is followed by two 2: 1 FIR half-band decimators. The final stage is a low-pass fir at 96 kHz To have the complete real-time implementation of the algorithm, the availability of descriptor- based dMa option in the blackfin processor proved to be handy For more information on the implementation, refer to the code associated with this ee-note With the blackfin core running at 594 MHz, Table I provides the number of clock cycles required to execute the various filters per sample, corresponding to a one-microphone interface and a two-microphone interface Filters Number of Core Clock Cycles for One Number of Core Clock Cycles for Microphone Interface Two-Microphone Interfaces Divided-by-8 CIC decimator 560 1320 25 tap half-band 2: 1 decimator 20 20 FIR low-pass filters with 300 taps 36 36 Table 1. Blackfin core clock cycles to perform filter operations The figures below show the PDm data taken from the microphone after feeding it with the sine tone and he waveforms at every stage of the decimation process. The figures are taken from a VisualDSP++( plot window PDM Data From MEMS microphon CIC O/P 5,000.0 00 2,0000 2,500.0 Figure 8. PDM data coming out of microphone Figure 9. Output of the CiC decimation stage Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 8 of 10 ANALOG DEVICES First stage HB O/P FIR LPF O/P 25000 WW 20,0000 0.0000 1,4000 1,600.0 550.0600.06500700.0 Figure 10. Output of the first stage half-band decimation Figure 12. Output of the final FIR low-pass stage second stage HB o/P 5,000.0 A 5000 600.0 Figure 11. Output of the second stage half-band decimation This document demonstrates a seamless interface of a mems microphone with the blackfin processor Since the hardware inter face is over the dsp serial port, the same concept can be extended to interface a MEMS microphone to the analog devices sharER family of processors as well. The newer ADSP 214xX SHARC family may be attractive in terms of cycle counts due to the processor's hardware accelerators, which can be utilized to perform the low-pass fir filtering in parallel, while the other functions are being computed Seamlessly Interfacing MEMS Microphones with Blackfin@ Processors(EE-350 Page 9 of 10

...展开详情
试读 11P PDM转PCM参考文献文献
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    hxj419594609 挺不错的文章,可以参考
    2020-02-22
    回复
    damonyun 流程又,就是缺少实现
    2019-09-18
    回复
    freebigfish 很好,东西参考的好
    2019-09-05
    回复
    armxing 很不错,ADI的文章经典
    2019-08-14
    回复
    一只快乐的小青年 还可以,流程比较完整。
    2018-12-14
    回复
    xiewolf4 还不错,值得参考
    2018-10-24
    回复
    vowstar 这个还可以,有参考价值,可以跟着去实现
    2018-10-19
    回复
    • 签到新秀

      累计签到获取,不积跬步,无以至千里,继续坚持!
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    PDM转PCM参考文献文献 34积分/C币 立即下载
    1/11
    PDM转PCM参考文献文献第1页
    PDM转PCM参考文献文献第2页
    PDM转PCM参考文献文献第3页
    PDM转PCM参考文献文献第4页

    试读已结束,剩余7页未读...

    34积分/C币 立即下载 >