Microphone and loudspeaker collaborative testing method, system, medium and electronic terminal

文档序号:309427 发布日期:2021-11-26 浏览:4次 中文

阅读说明:本技术 一种麦克风扬声器协同测试方法、系统、介质及电子终端 (Microphone and loudspeaker collaborative testing method, system, medium and electronic terminal ) 是由 张娟 于 2021-08-27 设计创作,主要内容包括:本发明提供一种麦克风扬声器协同测试方法、系统、介质及电子终端,方法包括:预先设置一个或多个测试音频文件,多个测试音频文件具备不同的测试频率特性;按照预设的测试顺序,控制待测试扬声器播放对应的测试音频文件,并控制待测试麦克风采集当前音频,获取音频信息;将音频信息中的时域信号转换为频域信号;通过对频域信号进行解析,进行一次测试,获取一次测试结果;若一次测试结果为测试成功,则根据多个测试音频文件,进行依次测试,直至多个测试音频文件测试完成,完成麦克风扬声器协同测试;本发明中的方法,较好地满足了麦克风扬声器协同测试的需求,测试效率较高,自动化程度较高,较好地排除了测试环境对测试过程带来的影响。(The invention provides a method, a system, a medium and an electronic terminal for cooperatively testing a microphone and a loudspeaker, wherein the method comprises the following steps: presetting one or more test audio files, wherein the test audio files have different test frequency characteristics; controlling a loudspeaker to be tested to play a corresponding test audio file according to a preset test sequence, and controlling a microphone to be tested to acquire current audio to acquire audio information; converting a time domain signal in the audio information into a frequency domain signal; analyzing the frequency domain signal, and carrying out a test to obtain a test result; if the test result of one time is successful, sequentially testing according to the plurality of test audio files until the plurality of test audio files are tested, and completing the microphone and loudspeaker cooperative test; the method of the invention better meets the requirement of the microphone and loudspeaker cooperative test, has higher test efficiency and higher automation degree, and better eliminates the influence of the test environment on the test process.)

1. A microphone and loudspeaker collaborative testing method is characterized by comprising the following steps:

presetting one or more test audio files, wherein the test audio files have different test frequency characteristics;

controlling a loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, and controlling a microphone to be tested to acquire the current audio to acquire audio information;

converting a time domain signal in the audio information into a frequency domain signal;

analyzing the frequency domain signal, and carrying out a test to obtain a test result;

and if the one-time test result is successful, sequentially testing according to the plurality of test audio files until the plurality of test audio files are tested, and completing the microphone and loudspeaker cooperative test.

2. The microphone-speaker co-testing method according to claim 1, wherein the testing frequency characteristics include: testing a first test amplitude, a first test frequency and a first test phase of a sine signal in an audio file, and testing a second test amplitude, a second test frequency and a second test phase of a cosine signal in the audio file;

the mathematical expression of the test frequency characteristic is:

wherein F (n) is a test frequency characteristic, x1Is said first test amplitude, ωx1For the purpose of said first test frequency,for the first test phase, x2Is said second test amplitude, ωx2For the purpose of said second test frequency,is the second test phase.

3. The microphone-speaker co-testing method as claimed in claim 1, wherein the step of obtaining audio information is followed by:

judging whether the data in the audio information are all 0, and acquiring a first judgment result;

if the first judgment result is that the data in the audio information are all 0, judging that the microphone to be tested has a fault, and finishing the microphone and loudspeaker cooperative test;

and if the first judgment result is that the data in the audio information is greater than 0, converting the time domain signal in the audio information into a frequency domain signal.

4. The method for microphone-speaker co-testing as claimed in claim 1, wherein the step of converting the time domain signal in the audio information into a frequency domain signal comprises:

converting the time domain signals in the audio information according to a preset Fourier transform formula to obtain corresponding frequency domain signals, wherein the mathematical expression of the Fourier transform formula is as follows:

wherein, A ' ' (k) is frequency domain signal, A ' (N) is time domain signal, k is value range [0, N-1], j is imaginary unit, N is signal period.

5. The method of claim 1, wherein the step of performing a test by analyzing the frequency domain signal comprises:

acquiring actual frequency characteristics corresponding to the frequency domain signals according to the frequency domain signals;

judging whether the actual frequency characteristics contain all characteristic data of the testing frequency characteristics of the current testing audio file or not, and acquiring a second judgment result;

and carrying out one test according to the second judgment result.

6. The microphone and speaker co-testing method according to claim 5, wherein the step of performing a test based on the second determination result comprises:

if the actual frequency characteristics do not contain all characteristic data of the testing frequency characteristics of the current testing audio file, judging that the loudspeaker to be tested and/or the microphone to be tested have functional faults, and setting the current one-time testing result as testing failure;

if the actual frequency characteristic comprises all characteristic data of the test frequency characteristic of the current test audio file, acquiring an actual signal amplitude in the actual frequency characteristic, wherein the actual signal amplitude comprises: a first actual signal amplitude corresponding to a first test frequency and a second actual signal amplitude corresponding to a second test frequency;

and carrying out a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range.

7. The microphone and speaker co-testing method according to claim 6, wherein the step of performing a test based on the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range comprises:

judging whether the first actual signal amplitude and the second actual signal amplitude are respectively in a preset amplitude threshold range;

if the first actual signal amplitude and/or the second actual signal amplitude are not within the corresponding amplitude threshold range, judging that the loudspeaker to be tested and/or the microphone to be tested generate volume faults, and setting the current test result as test failure;

and if the first actual signal amplitude and the second actual signal amplitude are both in the corresponding amplitude threshold range, setting the current one-time test result as successful test, and completing one-time test.

8. A microphone speaker co-testing system, comprising:

the device comprises a preprocessing module, a frequency conversion module and a frequency conversion module, wherein the preprocessing module is used for presetting one or more test audio files, and the test audio files have different test frequency characteristics;

the playing and collecting module is used for controlling the loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, and controlling the microphone to be tested to collect the current audio to acquire audio information;

the processing module is used for converting the time domain signal in the audio information into a frequency domain signal;

the test module is used for carrying out a test by analyzing the frequency domain signal to obtain a test result; and if the one-time test result is successful, sequentially testing according to the plurality of test audio files until the plurality of test audio files are tested, and completing the microphone and loudspeaker cooperative test.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program, when executed by a processor, implements the method of any one of claims 1 to 7.

10. An electronic terminal, comprising: a processor and a memory;

the memory is for storing a computer program and the processor is for executing the computer program stored by the memory to cause the terminal to perform the method of any of claims 1 to 7.

Technical Field

The invention relates to the technical field of testing, in particular to a method, a system, a medium and an electronic terminal for testing a microphone and a loudspeaker cooperatively.

Background

Microphone and speaker devices are ubiquitous in security equipment. When the microphone and the speaker are preliminarily produced and assembled, the quality of the microphone and the speaker needs to be strictly checked. The inspection standards include: whether the device can work, whether the performance during working reaches the standard, whether the stability during working is qualified, and the like. However, for these requirements, a large amount of manpower is required to strictly ensure the accuracy of the inspection. At present, a microphone or a speaker is usually tested individually, so that a microphone and speaker cannot be tested cooperatively well, a specific testing environment is mostly needed, the implementation is inconvenient, and the testing accuracy is low.

Disclosure of Invention

The invention provides a microphone and loudspeaker collaborative testing method, a microphone and loudspeaker collaborative testing system, a medium and an electronic terminal, and aims to solve the problems that in the prior art, a microphone and a loudspeaker cannot be well collaboratively tested, and the requirement on a testing environment is high.

The invention provides a microphone and loudspeaker collaborative testing method, which comprises the following steps:

presetting one or more test audio files, wherein the test audio files have different test frequency characteristics;

controlling a loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, and controlling a microphone to be tested to acquire the current audio to acquire audio information;

converting a time domain signal in the audio information into a frequency domain signal;

analyzing the frequency domain signal, and carrying out a test to obtain a test result;

and if the one-time test result is successful, sequentially testing according to the plurality of test audio files until the plurality of test audio files are tested, and completing the microphone and loudspeaker cooperative test.

Optionally, the testing the frequency characteristics includes: testing a first test amplitude, a first test frequency and a first test phase of a sine signal in an audio file, and testing a second test amplitude, a second test frequency and a second test phase of a cosine signal in the audio file;

the mathematical expression of the test frequency characteristic is:

wherein F (n) is a test frequency characteristic, x1Is said first test amplitude, ωx1For the purpose of said first test frequency,for the first test phase, x2Is said second test amplitude, ωx2For the purpose of said second test frequency,is the second test phase.

Optionally, the step of obtaining the audio information includes:

judging whether the data in the audio information are all 0, and acquiring a first judgment result;

if the first judgment result is that the data in the audio information are all 0, judging that the microphone to be tested has a fault, and finishing the microphone and loudspeaker cooperative test;

and if the first judgment result is that the data in the audio information is greater than 0, converting the time domain signal in the audio information into a frequency domain signal.

Optionally, the step of converting the time domain signal in the audio information into a frequency domain signal includes:

converting the time domain signals in the audio information according to a preset Fourier transform formula to obtain corresponding frequency domain signals, wherein the mathematical expression of the Fourier transform formula is as follows:

wherein, A ' ' (k) is frequency domain signal, A ' (N) is time domain signal, k is value range [0, N-1], j is imaginary unit, N is signal period.

Optionally, the step of performing a test by analyzing the frequency domain signal includes:

acquiring actual frequency characteristics corresponding to the frequency domain signals according to the frequency domain signals;

judging whether the actual frequency characteristics contain all characteristic data of the testing frequency characteristics of the current testing audio file or not, and acquiring a second judgment result;

and carrying out one test according to the second judgment result.

Optionally, the step of performing a test according to the second determination result includes:

if the actual frequency characteristics do not contain all characteristic data of the testing frequency characteristics of the current testing audio file, judging that the loudspeaker to be tested and/or the microphone to be tested have functional faults, and setting the current one-time testing result as testing failure;

if the actual frequency characteristic comprises all characteristic data of the test frequency characteristic of the current test audio file, acquiring an actual signal amplitude in the actual frequency characteristic, wherein the actual signal amplitude comprises: a first actual signal amplitude corresponding to a first test frequency and a second actual signal amplitude corresponding to a second test frequency;

and carrying out a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range.

Optionally, the step of performing a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range includes:

judging whether the first actual signal amplitude and the second actual signal amplitude are respectively in a preset amplitude threshold range;

if the first actual signal amplitude and/or the second actual signal amplitude are not within the corresponding amplitude threshold range, judging that the loudspeaker to be tested and/or the microphone to be tested generate volume faults, and setting the current test result as test failure;

and if the first actual signal amplitude and the second actual signal amplitude are both in the corresponding amplitude threshold range, setting the current one-time test result as successful test, and completing one-time test.

The invention also provides a microphone and loudspeaker collaborative testing system, which is characterized by comprising:

the device comprises a preprocessing module, a frequency conversion module and a frequency conversion module, wherein the preprocessing module is used for presetting one or more test audio files, and the test audio files have different test frequency characteristics;

the playing and collecting module is used for controlling the loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, and controlling the microphone to be tested to collect the current audio to acquire audio information;

the processing module is used for converting the time domain signal in the audio information into a frequency domain signal;

the test module is used for carrying out a test by analyzing the frequency domain signal to obtain a test result; and if the one-time test result is successful, sequentially testing according to the plurality of test audio files until the plurality of test audio files are tested, and completing the microphone and loudspeaker cooperative test.

The invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method as defined in any one of the above.

The present invention also provides an electronic terminal, comprising: a processor and a memory;

the memory is adapted to store a computer program and the processor is adapted to execute the computer program stored by the memory to cause the terminal to perform the method as defined in any one of the above.

The invention has the beneficial effects that: according to the microphone and loudspeaker collaborative testing method, the system, the medium and the electronic terminal, one or more testing audio files are preset, the testing audio files have different testing frequency characteristics, the corresponding testing audio files are controlled to be played by the loudspeaker to be tested according to a preset testing sequence, the microphone to be tested is controlled to collect the current audio, audio information is obtained, a time domain signal in the audio information is converted into a frequency domain signal, and a test is carried out by analyzing the frequency domain signal to obtain a testing result; if the test result of the first time is successful, the test is performed in sequence according to the plurality of test audio files until the test of the plurality of test audio files is completed, the microphone and loudspeaker cooperative test is completed, the requirement of the microphone and loudspeaker cooperative test is well met, the test efficiency is high, the automation degree is high, the influence of the test environment on the test process is well eliminated, the test method can be suitable for different test environments, the universality is high, and the cost is low.

Drawings

Fig. 1 is a schematic flow chart of a microphone and speaker cooperation testing method according to an embodiment of the present invention.

Fig. 2 is a schematic flow chart illustrating a process of converting a time domain signal into a frequency domain signal in the microphone and speaker co-testing method according to the embodiment of the present invention.

Fig. 3 is a schematic flow chart illustrating a test performed in the microphone and speaker cooperation testing method according to the embodiment of the present invention.

Fig. 4 is a schematic structural diagram of a microphone and speaker cooperation testing system according to an embodiment of the present invention.

Fig. 5 is a schematic diagram illustrating another result of the cooperative testing system for microphone and speaker in the embodiment of the present invention.

Detailed Description

The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.

It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.

The inventor finds that microphone and speaker devices are ubiquitous in security devices. When the microphone and the speaker are preliminarily produced and assembled, the quality of the microphone and the speaker needs to be strictly checked. The inspection standards include: whether the device can work, whether the performance during working reaches the standard, whether the stability during working is qualified, and the like. However, for these requirements, a large amount of manpower is required to strictly ensure the accuracy of the inspection. At present, a microphone or a loudspeaker is usually tested independently, so that the microphone and the loudspeaker cannot be tested in a coordinated mode well, most of the microphones and the loudspeaker need a specific test environment, the implementation is inconvenient, the test accuracy is low, and the automation degree is low. Therefore, the inventor provides a method, a system, a medium and an electronic terminal for testing a microphone and a loudspeaker in a coordinated manner, wherein one or more test audio files are preset, the test audio files have different test frequency characteristics, the corresponding test audio files are controlled to be played by the loudspeaker to be tested according to a preset test sequence, the microphone to be tested is controlled to acquire current audio, audio information is acquired, a time domain signal in the audio information is converted into a frequency domain signal, and a test is performed by analyzing the frequency domain signal to acquire a test result; if the test result of the first time is successful, the test is performed in sequence according to the plurality of test audio files until the test of the plurality of test audio files is completed, the microphone and loudspeaker cooperative test is completed, the requirement of the microphone and loudspeaker cooperative test is well met, the test efficiency is high, the automation degree is high, the influence of the test environment on the test process is well eliminated, the test method can be suitable for different test environments, the universality is high, the cost is low, the implementation is convenient, and the test accuracy is high.

As shown in fig. 1, the method for testing the cooperation of a microphone and a speaker in this embodiment includes:

s1: presetting one or more test audio files, wherein the test audio files have different test frequency characteristics; through setting up one or more test audio files, for follow-up microphone speaker collaborative test provides the test data basis to, through setting up different test frequency characteristics respectively to a plurality of test audio files, can be convenient for follow-up test in-process, get rid of the interference that environmental noise brought. The test frequency characteristics of the test audio files can be set according to actual conditions, the number of the test audio files can be set according to the actual conditions, and the test audio files are not repeated here.

S2: controlling a loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, and controlling a microphone to be tested to acquire the current audio to acquire audio information; the method and the device have the advantages that the corresponding test audio file is played by the to-be-tested loudspeaker under control, the current audio is collected by the to-be-tested microphone under control, the audio information is obtained, follow-up test is carried out according to the audio information, the requirement for carrying out collaborative test on the microphone and the loudspeaker is well met, the playing function of the to-be-tested loudspeaker and the collecting function of the to-be-tested microphone are flexibly utilized, and the test efficiency of the to-be-tested microphone and the to-be-tested loudspeaker is improved. For example: when three test audio files with different test frequency characteristics are preset, the three test audio files are sequenced, a test sequence is determined, the playing sequence of the loudspeaker to be tested is controlled to be arranged in the first test audio file according to the test sequence, the microphone to be tested is controlled to collect the current audio, the audio information is obtained, and therefore the microphone to be tested can collect the current audio.

In some embodiments, the step of obtaining audio information comprises: receiving a test instruction, setting the playing gain of a loudspeaker to be tested to be a preset playing gain test value according to the test instruction, setting the acquisition gain of a microphone to be tested to be a preset acquisition gain test value, controlling the loudspeaker to be tested to play a corresponding test audio file according to a preset test audio file and a corresponding test sequence, and simultaneously controlling the microphone to be tested to acquire the current audio to acquire audio information, wherein the audio information comprises: and audio information and environmental noise emitted by the loudspeaker to be tested. Through the steps, the current audio frequency of the microphone to be tested can be better acquired, and the microphone to be tested and the loudspeaker to be tested can be conveniently and cooperatively tested subsequently.

In some embodiments, a plurality of test audio files may be sequentially labeled, the test audio files are imported into the intermediate module, when a test instruction is generated, the playing gain of the speaker to be tested is set to a preset playing gain test value, the acquisition gain of the microphone to be tested is set to a preset acquisition gain test value, the imported test audio files are read by using the intermediate module according to the sequential labeling corresponding to the audio files, the speaker to be tested is further controlled to play the read audio signals, and meanwhile, the microphone to be tested is controlled to acquire the current audio.

S3: converting a time domain signal in the audio information into a frequency domain signal; because the audio information collected by the loudspeaker to be tested is time domain data and is discrete data, data analysis is not convenient to carry out, and the testing efficiency of the collaborative testing of the microphone and the loudspeaker is reduced.

S4: and analyzing the frequency domain signal, testing for the first time to obtain a testing result, and if the testing result of the first time is successful, sequentially testing according to a plurality of testing audio files until the testing of the plurality of testing audio files is completed, so as to complete the microphone and loudspeaker collaborative testing. And if the test result of one time is successful, carrying out secondary test on the next test audio according to the plurality of test audio files and the test sequence, and when all the test audio files are tested, finishing the microphone and loudspeaker cooperative test. And if the test result of one time is test failure, stopping the test, and feeding back the test result of one time to the corresponding terminal. The testing accuracy of the microphone to be tested and the loudspeaker to be tested is improved by utilizing the plurality of testing audio files with different testing frequency characteristics to test the microphone to be tested and the loudspeaker to be tested for a plurality of times, and the influence of environmental noise on the testing process is eliminated, so that the method is suitable for different testing environments, the requirement on the testing environment is reduced, the universality is strong, the maintenance cost of the testing environment is reduced, the automation degree is high, and the implementation is convenient.

In order to improve the testing effect of the test audio file, the inventor proposes that the test frequency characteristic of the test audio file is a superposition of a sine signal and a cosine signal, and in some embodiments, the test frequency characteristic includes: testing a first test amplitude, a first test frequency and a first test phase of a sine signal in an audio file, and testing a second test amplitude, a second test frequency and a second test phase of a cosine signal in the audio file;

the mathematical expression of the test frequency characteristic is:

wherein F (n) is a test frequency characteristic, x1Is said first test amplitude, ωx1For the purpose of said first test frequency,for the first test phase, x2Is said second test amplitude, ωx2For the purpose of said second test frequency,is the second test phase.

In the testing process, the microphone to be tested collects the audio currently played by the speaker to be tested, and even if the speaker to be tested does not play sound, the microphone to be tested should also collect the ambient noise, so in order to test the microphone well, the inventor proposes that the step of acquiring the audio information includes:

A. judging whether the data in the audio information are all 0, and acquiring a first judgment result;

B. if the first judgment result is that the data in the audio information are all 0, judging that the microphone to be tested has a fault, meanwhile, judging that the current one-time test result is a test failure, and feeding back the one-time test result to a corresponding terminal to complete the microphone and loudspeaker cooperative test; and if the first judgment result is that the data in the audio information is greater than 0, converting the time domain signal in the audio information into a frequency domain signal.

As shown in fig. 2, in order to better realize the conversion of the time domain signal, the inventor proposes that the step of converting the time domain signal in the audio information into the frequency domain signal comprises:

s31: converting the time domain signals in the audio information according to a preset Fourier transform formula to obtain corresponding frequency domain signals, wherein the mathematical expression of the Fourier transform formula is as follows:

wherein, A ' ' (k) is frequency domain signal, A ' (N) is time domain signal, k is value range [0, N-1], j is imaginary unit, N is signal period. By the mode, the time domain signals in the audio information can be well converted into the frequency domain signals, so that the frequency domain signals can be conveniently analyzed subsequently, and the data processing difficulty is reduced.

Referring to fig. 3, in some embodiments, the step of performing a test by analyzing the frequency domain signal includes:

s41: acquiring actual frequency characteristics corresponding to the frequency domain signals according to the frequency domain signals, wherein the actual frequency characteristics comprise: the first actual signal amplitude, the first actual signal frequency and the first actual signal phase of the sine signal in the frequency domain signal, and the second actual signal amplitude, the second actual signal frequency and the second actual signal phase of the cosine signal in the frequency domain signal.

S42: judging whether the actual frequency characteristics contain all characteristic data of the testing frequency characteristics of the current testing audio file or not, and acquiring a second judgment result; the actual frequency characteristic is compared with all characteristic data of the test frequency characteristic of the corresponding test audio file, and whether the actual frequency characteristic contains all characteristic data of the test frequency characteristic of the corresponding test audio file is judged.

S43: and carrying out one test according to the second judgment result. By the judgment, whether the microphone to be tested and the loudspeaker to be tested have functional faults or not can be conveniently identified.

In some embodiments, the step of performing a test according to the second determination result includes:

s431: if the actual frequency characteristics do not contain all characteristic data of the testing frequency characteristics of the current testing audio file, judging that the loudspeaker to be tested and/or the microphone to be tested have functional faults, and setting the current testing result as testing failure.

S432: if the actual frequency characteristic comprises all characteristic data of the test frequency characteristic of the current test audio file, acquiring an actual signal amplitude in the actual frequency characteristic, wherein the actual signal amplitude comprises: a first actual signal amplitude corresponding to a first test frequency and a second actual signal amplitude corresponding to a second test frequency. That is, if the actual frequency characteristic includes all characteristic data of the test frequency characteristic of the current test audio file, ω and ω are obtainedx1Corresponding first actual signal amplitude, and ωx2A corresponding second actual signal amplitude.

S433: and carrying out a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range.

In some embodiments, the step of performing a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range includes:

judging whether the first actual signal amplitude and the second actual signal amplitude are respectively in a preset amplitude threshold range;

if the first actual signal amplitude and/or the second actual signal amplitude are not within the corresponding amplitude threshold range, judging that the loudspeaker to be tested and/or the microphone to be tested generate volume faults, and setting the current test result as test failure;

and if the first actual signal amplitude and the second actual signal amplitude are both in the corresponding amplitude threshold range, setting the current one-time test result as successful test, and completing one-time test. The amplitude threshold range can be set according to the test amplitude of the current test audio file, for example, according to the first test amplitude of the current test audio file, a corresponding first amplitude threshold range is set, according to the second test amplitude of the current test audio file, a corresponding second amplitude threshold range is set, whether the first actual signal amplitude is in the first amplitude threshold range is judged, whether the second actual signal amplitude is in the second amplitude threshold range is judged, if the first actual signal amplitude is in the first amplitude threshold range and the second actual signal amplitude is in the second amplitude threshold range, a primary test result is set as a successful test, the primary test result is fed back to a corresponding terminal, and further, the sequential test is performed according to a plurality of preset test audio files, completing the microphone and loudspeaker cooperative test; and if the first actual signal amplitude is not in the first amplitude threshold range and/or the second actual signal amplitude is not in the second amplitude threshold range, judging that the volume fault occurs to the loudspeaker to be tested and/or the microphone to be tested, setting a primary test result as test failure, feeding the primary test result back to the corresponding terminal, and completing the microphone and loudspeaker cooperative test.

For example: receiving a test instruction, setting the playing gain of a loudspeaker to be tested to be a preset playing gain test value according to the test instruction and the acquisition gain of a microphone to be tested to be a preset acquisition gain test value, and importing a plurality of preset test audio files A, B, C into an intermediate module, wherein the mathematical expressions of the test frequency characteristics corresponding to the test audio files A, B, C are respectively as follows:

wherein A (n) is the test frequency characteristic corresponding to the test audio file A, a1For testing a first test amplitude, omega, corresponding to the audio file Aa1To test the first test frequency corresponding to audio file a,for testing a first test phase, a, corresponding to the audio file A2For testing a second test amplitude, ω, corresponding to the audio file Aa2To test the second test frequency corresponding to audio file a,for testing the second testing phase corresponding to the audio file A, B (n) for testing the testing frequency characteristic corresponding to the audio file B, B1For testing a first test amplitude, ω, corresponding to the audio file Bb1To test the first test frequency corresponding to audio file B,for testing the first test phase corresponding to audio file B, B2For testing a second test amplitude, ω, corresponding to the audio file Bb2To test the second test frequency corresponding to audio file B,for testing the second testing phase corresponding to the audio file B, C (n) for testing the frequency characteristic corresponding to the audio file C, C1For testing a first test amplitude, omega, corresponding to the audio file Cc1To test the first test frequency corresponding to audio file C,for testing a first test phase, C, corresponding to the audio file C2For testing a second test amplitude, ω, corresponding to the audio file Cc2To test the second test frequency corresponding to audio file C,a second test phase corresponding to the test audio file C.

Reading a test audio file A by using the intermediate module, controlling a loudspeaker to be tested to play a corresponding audio signal, controlling a microphone to be tested to acquire a current audio, acquiring corresponding audio information, judging whether data in the audio information is 0, if the data in the audio information is 0, judging that the microphone to be tested has a fault, completing a microphone and loudspeaker cooperation test, if the first judgment result is that the data in the audio information is greater than 0, converting a time domain signal in the audio information by using a preset Fourier transform formula, acquiring a corresponding frequency domain signal, and acquiring an actual frequency characteristic corresponding to the frequency domain signal according to the frequency domain signal, wherein the actual frequency characteristic comprises: a first actual signal amplitude, a first actual signal frequency, a first actual signal phase of the sine signal in the frequency domain signal, and a second actual signal amplitude, a second actual signal of the cosine signal in the frequency domain signalFrequency and second actual signal phase. Determining whether the actual frequency characteristic includes ωa1And ωa2If ω is not included in the actual frequency characteristica1And ωa2If the actual frequency characteristic data contains omega, the first test result is fed back to the corresponding terminal, and if the actual frequency characteristic data contains omega, the first test result is fed back to the corresponding terminala1And ωa2Obtaining the ω in the actual frequency characteristic dataa1And ωa2A corresponding actual signal amplitude, the actual signal amplitude comprising: a first actual signal amplitude and a second actual signal amplitude, and judging whether the first actual signal amplitude is in a1And whether the second actual signal amplitude is within a2If the first actual signal amplitude is not in the fluctuation range of a1And/or the second actual signal amplitude is not within a2Judging that the loudspeaker to be tested and/or the microphone to be tested generate volume faults within the fluctuation range, setting the current primary test result as test failure, and feeding the primary test result back to the corresponding terminal; if the first actual signal amplitude is in a1And the second actual signal amplitude is within a2And in the fluctuation range, setting the current primary test result as successful test, feeding the primary test result back to the corresponding terminal, sequentially testing according to a plurality of test audio files, and finishing the microphone and loudspeaker cooperative test after the plurality of test audio files are successfully tested. In order to avoid the interference of environmental noise to the test, other test audio files with different test frequency characteristics are utilized to perform secondary test until the test of the test audio file C is completed, the test result is fed back, the misjudgment rate of the environmental interference to the test process is reduced, the test accuracy is improved, and the test efficiency is higher.

As shown in fig. 4, the present embodiment further provides a microphone and speaker cooperation testing system, including:

the device comprises a preprocessing module, a frequency conversion module and a frequency conversion module, wherein the preprocessing module is used for presetting one or more test audio files, and the test audio files have different test frequency characteristics;

the playing and collecting module is used for controlling the loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, and controlling the microphone to be tested to collect the current audio to acquire audio information;

the processing module is used for converting the time domain signal in the audio information into a frequency domain signal;

the test module is used for carrying out a test by analyzing the frequency domain signal to obtain a test result; if the one-time test result is successful, sequentially testing according to the plurality of test audio files until the plurality of test audio files are tested, and completing the microphone and loudspeaker cooperative test; the preprocessing module, the playing acquisition module, the processing module and the testing module are connected. The processing module and the testing module can be arranged in the same device or terminal. The system presets one or more test audio files, wherein the test audio files have different test frequency characteristics, controls a loudspeaker to be tested to play the corresponding test audio file according to a preset test sequence, controls a microphone to be tested to acquire current audio to acquire audio information, converts a time domain signal in the audio information into a frequency domain signal, and performs one-time test by analyzing the frequency domain signal to acquire a one-time test result; if the test result of the first time is successful, the test is performed in sequence according to the plurality of test audio files until the test of the plurality of test audio files is completed, the microphone and loudspeaker cooperative test is completed, the requirement of the microphone and loudspeaker cooperative test is well met, the test efficiency is high, the automation degree is high, the influence of the test environment on the test process is well eliminated, the test method can be suitable for different test environments, the universality is high, and the cost is low.

As shown in fig. 5, in some embodiments, the microphone to be tested is disposed opposite to the speaker to be tested, i.e., the collecting end of the microphone to be tested faces the playing end of the speaker to be tested.

In some embodiments, further comprising: and the display module is connected with the test module.

Optionally, the testing the frequency characteristics includes: testing a first test amplitude, a first test frequency and a first test phase of a sine signal in an audio file, and testing a second test amplitude, a second test frequency and a second test phase of a cosine signal in the audio file;

the mathematical expression of the test frequency characteristic is:

wherein F (n) is a test frequency characteristic, x1Is said first test amplitude, ωx1For the purpose of said first test frequency,for the first test phase, x2Is said second test amplitude, ωx2For the purpose of said second test frequency,is the second test phase.

In some embodiments, the step of obtaining audio information is followed by:

judging whether the data in the audio information are all 0, and acquiring a first judgment result;

if the first judgment result is that the data in the audio information are all 0, judging that the microphone to be tested has a fault, and finishing the microphone and loudspeaker cooperative test;

and if the first judgment result is that the data in the audio information is greater than 0, converting the time domain signal in the audio information into a frequency domain signal.

In some embodiments, the step of the processing module converting the time domain signal in the audio information into a frequency domain signal comprises:

converting the time domain signals in the audio information according to a preset Fourier transform formula to obtain corresponding frequency domain signals, wherein the mathematical expression of the Fourier transform formula is as follows:

wherein, A ' ' (k) is frequency domain signal, A ' (N) is time domain signal, k is value range [0, N-1], j is imaginary unit, N is signal period.

In some embodiments, the step of performing a test by the test module by analyzing the frequency domain signal comprises:

acquiring actual frequency characteristics corresponding to the frequency domain signals according to the frequency domain signals;

judging whether the actual frequency characteristics contain all characteristic data of the testing frequency characteristics of the current testing audio file or not, and acquiring a second judgment result;

and carrying out one test according to the second judgment result.

In some embodiments, the step of performing a test according to the second determination result includes:

if the actual frequency characteristics do not contain all characteristic data of the testing frequency characteristics of the current testing audio file, judging that the loudspeaker to be tested and/or the microphone to be tested have functional faults, and setting the current one-time testing result as testing failure;

if the actual frequency characteristic comprises all characteristic data of the test frequency characteristic of the current test audio file, acquiring an actual signal amplitude in the actual frequency characteristic, wherein the actual signal amplitude comprises: a first actual signal amplitude corresponding to a first test frequency and a second actual signal amplitude corresponding to a second test frequency;

and carrying out a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range.

In some embodiments, the step of performing a test according to the first actual signal amplitude, the second actual signal amplitude and a preset amplitude threshold range includes:

judging whether the first actual signal amplitude and the second actual signal amplitude are respectively in a preset amplitude threshold range;

if the first actual signal amplitude and/or the second actual signal amplitude are not within the corresponding amplitude threshold range, judging that the loudspeaker to be tested and/or the microphone to be tested generate volume faults, and setting the current test result as test failure;

and if the first actual signal amplitude and the second actual signal amplitude are both in the corresponding amplitude threshold range, setting the current one-time test result as successful test, and completing one-time test.

The present embodiment also provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements any of the methods in the present embodiments.

The present embodiment further provides an electronic terminal, including: a processor and a memory;

the memory is used for storing computer programs, and the processor is used for executing the computer programs stored by the memory so as to enable the terminal to execute the method in the embodiment.

The computer-readable storage medium in the present embodiment can be understood by those skilled in the art as follows: all or part of the steps for implementing the above method embodiments may be performed by hardware associated with a computer program. The aforementioned computer program may be stored in a computer readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.

The electronic terminal provided by the embodiment comprises a processor, a memory, a transceiver and a communication interface, wherein the memory and the communication interface are connected with the processor and the transceiver and are used for completing mutual communication, the memory is used for storing a computer program, the communication interface is used for carrying out communication, and the processor and the transceiver are used for operating the computer program so that the electronic terminal can execute the steps of the method.

In this embodiment, the Memory may include a Random Access Memory (RAM), and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory.

The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.

The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种麦克风检测装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!