Automatic detection method and system for double MEMS microphones based on FFT algorithm

文档序号:196478 发布日期:2021-11-02 浏览:32次 中文

阅读说明:本技术 基于fft算法的双mems麦克风自动检测方法及系统 (Automatic detection method and system for double MEMS microphones based on FFT algorithm ) 是由 吕德平 高照 秦楠 唐璇 冯妙贤 谢兰珠 于 2021-06-30 设计创作,主要内容包括:本发明涉及麦克风检测技术领域,公开一种基于FFT算法的双MEMS麦克风自动检测方法及系统,包括主控模块、信号放大模块、麦克风模块及音频总线,主控模块生成正弦波信号,并发送至信号放大模块,信号放大模块将正弦波信号转换成音频数据,麦克风模块采集音频数据,主控模块通过音频总线获取麦克风模块的脉冲密度数据。通过自动化检测双MEMS麦克风,相对于传统的检测方法,能够大幅度减少检测的时间,同时,采用FFT计算操作,根据音频极值对应的频率去判断MESM麦克风的工作性能,避免了外界噪音对检测结果的影响,同时,整套系统只需要主控模块、信号放大模块、麦克风模块及音频总线,成本低廉。(The invention relates to the technical field of microphone detection, and discloses a double-MEMS microphone automatic detection method and system based on an FFT algorithm. Through the automatic detection of the double MEMS microphones, compared with the traditional detection method, the detection time can be greatly reduced, meanwhile, the FFT calculation operation is adopted, the working performance of the MESM microphone is judged according to the frequency corresponding to the audio extreme value, the influence of external noise on the detection result is avoided, and meanwhile, the whole system only needs the main control module, the signal amplification module, the microphone module and the audio bus, and the cost is low.)

1. An automatic detection system of a double-MEMS microphone based on an FFT algorithm is characterized by comprising: the main control module generates sine wave signals and sends the sine wave signals to the signal amplification module, the signal amplification module converts the sine wave signals into audio data, the microphone module collects the audio data, and the main control module acquires the pulse density data of the microphone module through the audio bus.

2. The FFT algorithm-based automatic detection method for dual-MEMS microphone according to claim 1, wherein the signal amplification module comprises a power amplification module and a speaker module, the power amplification module is connected with the speaker module, and the power amplification module is used for receiving and amplifying the sine wave signal and driving the speaker module to generate the audio data.

3. A double-MEMS microphone automatic detection method based on an FFT algorithm is characterized by comprising the following steps:

the method comprises the steps that a main control module generates sine wave signals, a signal amplification module amplifies the sine wave signals and outputs audio, a microphone module collects the audio, and the main control module acquires a plurality of pulse density data of the microphone module through an audio bus;

the main control module judges whether the pulse density data are the same or not, if so, the main control module checks the connection line, then re-collects and judges whether the pulse density data are the same or not, and if so, double-microphone fault data are generated; if not, separating the pulse density data to generate left wheat data and right wheat data, judging whether the left wheat data is the same as the right wheat data, and if so, generating right wheat damage data; and modifying the left wheat data to generate left wheat data to be detected, comparing the left wheat data with the right wheat data, if the left wheat data and the right wheat data are the same, generating left wheat damaged data, otherwise, respectively performing conversion operation on the left wheat data and the right wheat data to generate a plurality of pulse coded data, performing FFT (fast Fourier transform) calculation operation on each pulse coded data to generate an audio extreme value, and comparing the audio extreme value to generate double-wheat normal data.

4. The FFT algorithm-based automatic detection method for dual MEMS microphones as claimed in claim 3, wherein the calculation operation is specifically as follows:

and performing frequency resolution calculation on each pulse encoding data, and simultaneously generating an inquiry request.

5. The FFT algorithm-based automatic detection method for dual MEMS microphones as claimed in claim 3, wherein the calculation operation is specifically as follows:

and extracting the left wheat data and carrying out displacement processing on the left wheat data.

6. The FFT algorithm-based automatic detection method for dual MEMS microphones as claimed in claim 3, wherein the comparing operation specifically comprises the following steps:

and comparing the frequency value corresponding to the audio frequency extreme value with the frequency value corresponding to the sine wave signal.

Technical Field

The invention relates to the technical field of microphone detection, in particular to a double-MEMS microphone automatic detection method and system based on an FFT algorithm.

Background

At present, compared with the traditional electret microphone, the MEMS microphone has the advantages of excellent temperature stability, good RF and EMI inhibition capability, lower vibration coupling, capability of being produced by using an SMT manufacturing process and the like, and is widely used in a voice acquisition system. Meanwhile, in order to reduce noise of voice, more and more voice acquisition systems adopt a double-microphone design. The two MEMS microphones are distributed on the left side and the right side of the system and share one clock line and one data line, the left side microphone transmits data when the clock is at a high level, and the right side microphone transmits data when the clock is at a low level.

However, whether a fault occurs in the detection of the dual-MEMS microphone at the present stage is generally to integrate the MEMS into a whole machine, record a section of audio, manually listen to the integrity and the definition of the audio, and then judge the sound collection performance.

Disclosure of Invention

The invention aims to overcome the defects in the prior art and provides an FFT algorithm-based automatic detection method and system for a double-MEMS microphone, which can replace manual detection, thereby improving the accuracy of voice acquisition and judgment and reducing the detection time.

The purpose of the invention is realized by the following technical scheme:

an FFT algorithm-based automatic detection system for a dual MEMS microphone, comprising:

the main control module generates sine wave signals and sends the sine wave signals to the signal amplification module, the signal amplification module converts the sine wave signals into audio data, the microphone module collects the audio data, and the main control module acquires the pulse density data of the microphone module through the audio bus.

In one embodiment, the signal amplification module includes a power amplifier module and a speaker module, the power amplifier module is connected to the speaker module, and the power amplifier module is configured to receive and amplify the sine wave signal and drive the speaker module to generate the audio data.

A double-MEMS microphone automatic detection method based on an FFT algorithm comprises the following steps:

the method comprises the steps that a main control module generates sine wave signals, a signal amplification module amplifies the sine wave signals and outputs audio, a microphone module collects the audio, and the main control module acquires a plurality of pulse density data of the microphone module through an audio bus;

the main control module judges whether the pulse density data are the same or not, if so, the main control module checks the connection line, then re-collects and judges whether the pulse density data are the same or not, and if so, double-microphone fault data are generated; if not, separating the pulse density data to generate left wheat data and right wheat data, judging whether the left wheat data is the same as the right wheat data, and if so, generating right wheat damage data; and modifying the left wheat data to generate left wheat data to be detected, comparing the left wheat data with the right wheat data, if the left wheat data and the right wheat data are the same, generating left wheat damaged data, otherwise, respectively performing conversion operation on the left wheat data and the right wheat data to generate a plurality of pulse coded data, performing FFT (fast Fourier transform) calculation operation on each pulse coded data to generate an audio extreme value, and comparing the audio extreme value to generate double-wheat normal data.

In one embodiment, the calculating operation specifically includes the following steps:

and performing frequency resolution calculation on each pulse encoding data, and simultaneously generating an inquiry request.

In one embodiment, the calculating operation specifically includes the following steps:

and extracting the left wheat data and carrying out displacement processing on the left wheat data.

In one embodiment, the alignment operation specifically comprises the following steps:

and comparing the frequency value corresponding to the audio frequency extreme value with the frequency value corresponding to the sine wave signal.

Compared with the prior art, the invention has the following advantages and beneficial effects:

the invention relates to a method and a system for automatically detecting double MEMS microphones based on an FFT algorithm, which can greatly reduce the detection time compared with the traditional detection method by automatically detecting the double MEMS microphones, and simultaneously, adopt FFT calculation operation to judge the working performance of an MESM microphone according to an audio extreme value, thereby avoiding the influence of external noise on the detection result.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.

Fig. 1 is a functional block diagram of an FFT algorithm based dual MEMS microphone automatic detection system according to an embodiment of the present invention;

FIG. 2 is a flowchart illustrating steps of a method for automatically detecting a dual MEMS microphone based on an FFT algorithm according to an embodiment of the present invention;

FIG. 3 is a diagram illustrating dual-microphone pulse density data according to an embodiment of the present invention.

Detailed Description

To facilitate an understanding of the invention, the invention will now be described more fully with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

It will be understood that when an element is referred to as being "secured to" another element, it can be directly on the other element or intervening elements may also be present. When an element is referred to as being "connected" to another element, it can be directly connected to the other element or intervening elements may also be present. The terms "vertical," "horizontal," "left," "right," and the like as used herein are for illustrative purposes only and do not represent the only embodiments.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

In one embodiment, the double-MEMS microphone automatic detection system based on the FFT algorithm comprises a main control module, a signal amplification module, a microphone module and an audio bus, wherein the main control module generates a sine wave signal and sends the sine wave signal to the signal amplification module, the signal amplification module converts the sine wave signal into audio data, the microphone module collects the audio data, and the main control module obtains pulse density data of the microphone module through the audio bus. It should be noted that, a digital-to-analog converter and a timer are arranged in the main control module, the digital-to-analog converter and the timer are matched to generate a 1KHz sine wave signal, the signal amplification module is used for amplifying the signal and driving the loudspeaker to generate audio, the microphone module is used for collecting the audio, and the audio bus is used for transmitting data.

Specifically, in an embodiment, the signal amplification module includes a power amplifier module and a speaker module, the power amplifier module is connected to the speaker module, and the power amplifier module is configured to receive and amplify the sine wave signal and drive the speaker module to generate audio data. It should be noted that the power amplifier module is configured to receive and amplify the sine wave signal, and the speaker module is configured to play audio data.

Referring to fig. 2, an automatic detection method for a dual MEMS microphone based on an FFT algorithm includes the following steps:

s101, a sine wave signal is generated by a main control module, the sine wave signal is amplified by a signal amplification module and then audio is output, a microphone module collects the audio, and the main control module acquires a plurality of pulse density data of the microphone module through an audio bus;

s102, the main control module judges whether the pulse density data are the same or not, if so, the main control module checks the connection line, then re-collects and judges whether the pulse density data are the same or not, and if so, double-microphone fault data are generated; if not, separating the pulse density data to generate left wheat data and right wheat data, judging whether the left wheat data and the right wheat data are the same, and if so, generating right wheat damage data; modifying the left wheat data to generate left wheat data to be detected, comparing the left wheat data with the right wheat data, if the left wheat data is the same as the right wheat data, generating left wheat damaged data, if the left wheat data is not the same as the right wheat data, respectively converting the left wheat data and the right wheat data to generate a plurality of pulse encoding data, performing FFT (fast Fourier transform) calculation operation on each pulse encoding data to generate an audio extreme value, and comparing a frequency value corresponding to the audio extreme value with a frequency value of the sine wave signal to generate double-wheat normal data.

In order to better illustrate the technical concept of the automatic detection method of the dual MEMS microphone based on the FFT algorithm, specifically:

step S101, the main control module generates sine wave signals, the signal amplification module amplifies the sine wave signals and outputs audio, the microphone module collects the audio, and the main control module acquires a plurality of pulse density data of the microphone module through an audio bus.

It should be noted that the main control module outputs a 1KHz sine wave signal to the power amplifier module through the digital-to-analog converter and the timer in a matching manner, the power amplifier module drives a 1.5W horn module to output audio, and the main control module reads the pulse density data of the MEMS microphone through the audio bus at a sampling frequency of 64 KHz. And when 2048 pulse density data are acquired, stopping data acquisition and stopping audio playing. Of these, 4096 data may be acquired, but 2048 pulse density data are acquired for cost savings.

Step S102, the main control module judges whether the pulse density data are the same or not, if so, the main control module checks the connection line, then re-collects and judges whether the pulse density data are the same or not, and if so, double-microphone fault data are generated; if not, separating the pulse density data to generate left wheat data and right wheat data, judging whether the left wheat data and the right wheat data are the same, and if so, generating right wheat damage data; and modifying the left wheat data to generate left wheat data to be detected, comparing the left wheat data with the right wheat data, if the left wheat data and the right wheat data are the same, generating left wheat damaged data, otherwise, respectively performing conversion operation on the left wheat data and the right wheat data to generate a plurality of pulse encoded data, performing FFT (fast Fourier transform) calculation operation on each pulse encoded data to generate an audio extreme value, and comparing the audio extreme value to generate double-wheat normal data. The specific calculation operation specifically comprises the following steps: and performing frequency resolution calculation on each pulse coded data, and generating a query request. More specifically, the calculation operation specifically includes the following steps: and extracting the left microphone data and performing shift processing on the left microphone data. More specifically, the comparison operation specifically comprises the following steps: and comparing the frequency value corresponding to the audio extreme value with the frequency value corresponding to the sine wave signal.

It should be noted that, the main control module is whether the 2048 pulse density data are the same value, because when the two microphones do not work normally, the data line keeps a level signal all the time, if the two microphones are the same value, it indicates that the two microphones do not work, at this moment, the main control module can judge that the voice collecting board is abnormal, the abnormal situation may be caused by bad contact between the voice board and the detection system, or the voice board itself is damaged, the system prompts to "please check the system connection", re-access the voice board, the main control module starts the second detection, if the pulse density data are still the same value, judge that the voice board is damaged. When one wheat is damaged and the other is good, the data of the good wheat can be copied when the data of the damaged wheat is collected. Further, if the collected pulse density data is different from one value, the 2048 pulse density data are separated into 1024 data of the left and right microphones, i.e., left microphone data and right microphone data, which are also pulse density data. And if the pulse density data of the left microphone and the right microphone are consistent after the data are separated, judging that the right microphone is damaged. If the left microphone data of the left microphone is shifted to the left by one bit and the data of the left and right microphones are still consistent, the left microphone is damaged. If the left and right pulse density data are not equal, the pulse density data of the left and right microphones are converted into pulse coded data respectively, and 1024 pulse density data of 64KHz obtain 256 pulse coded data of 16 KHz. The 256-point FFT calculation is performed on the 256 data, and the frequency resolution of each point is 16000/256-62.5 Hz. For the FFT data, the maximum value, i.e. the above audio extremum, is found, and since we broadcast 1KHz audio, the index value corresponding to the maximum value should be 1000/62.5-16. The index value multiplied by the frequency resolution is the frequency value corresponding to the audio extremum, and considering the sampling error, when the index value corresponding to the maximum value is 15-17, it can be determined that the audio frequency collected by the microphone is consistent with the playing frequency, and the playing frequency refers to the frequency value corresponding to the frequency value of the sinusoidal wave signal, that is, the microphone works normally. Therefore, the detection mode realizes the good performance of automatically detecting the double-MEMS microphone voice acquisition board, and greatly improves the detection efficiency compared with the current detection method. Meanwhile, the FFT is used for calculating the audio frequency, the working performance of the MEMS microphone is judged according to the audio frequency, and the influence of external noise on the detection result is avoided. The whole system only needs one MCU, a power amplifier and a loudspeaker, and is low in cost.

It should be noted that the dual MEMS microphones share a data line and a clock line, and the data format is as shown in fig. 3, and the data of the left and right microphones are sequentially arranged according to the clock level. The original 2048 pulse density data are sequentially extracted and recombined according to the mode of the figure, and the original mixed pulse density data can be separated into the respective pulse density data of the left microphone and the right microphone.

Further, because the left and right microphones share one data line, when data of one of the microphones is collected, the data pin of the other microphone is in a high-impedance state, that is, the data of the microphone which is not working is not affected by the microphone which is not working. When a microphone is damaged, the data pin of the microphone is always in a high-impedance state, and when the damaged microphone data is collected, the data of the normal microphone is copied. Therefore, when the data of the left and right microphones are consistent, one of the microphones can be judged to be damaged. From fig. 3, we can see that the data of the left microphone changes when the clock is high, and the data of the right microphone changes when the clock is low. The polarity of an audio bus acquisition clock is set to be high, namely the first acquired data is the data of a left microphone, if a right microphone is damaged, the right microphone copies the data of the front left microphone, and the data of the left microphone and the right microphone are the same. If the left microphone is damaged, the data of the front right microphone is copied from the second L data, the pulse density data of the left microphone is shifted to the left by one bit, and the left and right pulse density data are the same.

The above embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种麦克风声学性能测试设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!