Microphone mixed use method and device, storage medium, electronic equipment and system
By calculating and setting the delay of the downsampling filter module in the microphone mixing system, the problem of difficult phase difference between the output signals of analog microphone and digital microphone is solved, and a more stable and predictable signal processing effect is achieved.
Patent Information
- Application Number
- CN202311045315.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2025-02-21
AI Technical Summary
In the existing microphone mixing system, there is a phase difference between the same sampling rate and synchronized data output by analog microphone and digital microphone, and there is uncertainty in the phase difference, which is difficult to predict and control.
By determining the input clock frequency of the microphone mixing system and the target sampling rate of the output signal, the delays of the first down-sampling filter module and the second down-sampling filter module are calculated and set to control the phase difference between the analog microphone and the digital microphone output signal.
The phase difference between the analog microphone and digital microphone output signals is effectively controlled, reducing the absolute delay of the two channels of data, and improving the stability and predictability of the system.
Smart Images

Figure CN119497005A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of signal processing, and in particular, to a microphone mixing method, device, storage medium, electronic device and system. Background Art
[0002] In the related art, an ADC system that mixes LINE IN / AMIC and DMIC, that is, a mixed system of analog microphones and digital microphones, is often used to collect and process digital signals and analog signals to obtain two channels of data with the same sampling rate.
[0003] However, there is often a phase difference between the two data outputs of the hybrid system, that is, there is a phase difference between the data with the same sampling rate and synchronization output by the LINE IN / AMIC channel and the DMIC channel. In addition, there is a certain degree of uncertainty in the phase difference, which is sometimes large and sometimes small, and is difficult to predict. Summary of the invention
[0004] The present disclosure provides a microphone mixing method, device, storage medium, electronic device and system to solve the technical problems in the prior art.
[0005] According to a first aspect of the present disclosure, a microphone mixing method is provided, which is applied to a microphone mixing system in which an analog microphone and a digital microphone are mixed. The method comprises:
[0006] In response to the microphone mixing signal, determining an input clock frequency and a target sampling rate of an output signal of the microphone mixing system;
[0007] Determine, according to the input clock frequency and the target sampling rate, a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone;
[0008] The first down-sampling filter module is controlled to perform down-sampling filtering on the signal output by the analog microphone according to the first delay, and the second down-sampling filter module is controlled to perform down-sampling filtering on the signal output by the digital microphone according to the second delay.
[0009] Optionally, determining a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone according to the input clock frequency and the target sampling rate includes:
[0010] Determining a target counting period according to the input clock frequency and the target sampling rate;
[0011] The first delay is determined according to the target counting period and a first coefficient length of the first down-sampling filter module, and the second delay is determined according to the target counting period and a second coefficient length of the second down-sampling filter module.
[0012] Optionally, determining the first delay according to the target counting period and a first coefficient length of the first down-sampling filter module, and determining the second delay according to the target counting period and a second coefficient length of the second down-sampling filter module includes:
[0013] determining a first clock frequency of the analog microphone and a second clock frequency of the digital microphone;
[0014] Determine a first downsampling ratio of the first downsampling filter module according to the first clock frequency and the target sampling rate, and determine a second downsampling ratio of the second downsampling filter module according to the second clock frequency and the target sampling rate;
[0015] The first delay is determined according to the first coefficient length and the first downsampling ratio, and the second delay is determined according to the second coefficient length and the second downsampling ratio.
[0016] Optionally, the determining the first delay according to the first coefficient length and the first downsampling ratio, and determining the second delay according to the second coefficient length and the second downsampling ratio includes:
[0017] Determine, according to the first coefficient length and the first downsampling ratio, a first counting point at which the first downsampling filter module starts filtering, and, according to the second coefficient length and the second downsampling ratio, determine a second counting point at which the second downsampling filter module starts filtering;
[0018] Determine, according to the first counting point and the first coefficient length, a third counting point at which the first downsampling filtering module stops filtering, and, according to the second counting point and the second coefficient length, determine a fourth counting point at which the second downsampling filtering module stops filtering;
[0019] Determine the first delay according to the first counting point and the third counting point, and determine the second delay according to the second counting point and the fourth counting point;
[0020] The first downsampling ratio and the second downsampling ratio are both greater than the difference between the third counting point and the fourth counting point.
[0021] Optionally, the determining the first delay according to the first counting point and the third counting point, and determining the second delay according to the second counting point and the fourth counting point, includes:
[0022] Determine a first initial delay according to the first counting point and the third counting point, and determine a second initial delay according to the second counting point and the fourth counting point;
[0023] adjusting the first initial delay and the second initial delay according to the third counting point and the fourth counting point;
[0024] When the third counting point and the fourth counting point coincide with each other, the first delay, the second delay and the target counting point are determined.
[0025] Optionally, before determining the first time delay, the second time delay and the target counting point, the method further includes:
[0026] It is determined that the first down-sampling filtering module and the second down-sampling filtering module stop filtering simultaneously when the third counting point and the fourth counting point coincide with each other.
[0027] According to a second aspect of the present disclosure, a microphone mixing device is provided, the device comprising:
[0028] A first determination module, configured to determine an input clock frequency of the microphone mixing system and a target sampling rate of an output signal in response to a microphone mixing signal;
[0029] A second determination module, configured to determine a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone according to the input clock frequency and the target sampling rate;
[0030] The control module controls the first down-sampling filter module to perform down-sampling filtering on the signal output by the analog microphone according to the first delay, and controls the second down-sampling filter module to perform down-sampling filtering on the signal output by the digital microphone according to the second delay.
[0031] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0032] According to a fourth aspect of the present disclosure, there is provided an electronic device, including:
[0033] a memory having a computer program stored thereon;
[0034] A processor is used to execute the computer program in the memory to implement the steps of any one of the methods in the first aspect.
[0035] According to a fifth aspect of the present disclosure, a microphone mixing system is provided, the microphone mixing system comprising:
[0036] An analog microphone module, a digital microphone module, a first downsampling filter module, a second downsampling filter module, a third downsampling filter module and a controller;
[0037] The input end of the first downsampling filter module is connected to the output end of the analog microphone module, and is used to perform downsampling filtering on the signal output by the analog microphone module;
[0038] The input end of the second downsampling filter module is connected to the output end of the digital microphone module, and is used to perform downsampling filtering on the signal output by the digital microphone module;
[0039] The input end of the third down-sampling filter module is connected to the output end of the first down-sampling filter module and the output end of the second down-sampling filter module, and is used to perform down-sampling filtering on the signals output by the first down-sampling filter module and the second down-sampling filter module to obtain a target signal with a sampling rate of a target sampling rate;
[0040] The controller is connected to both the first downsampling filter module and the second downsampling filter module, and the controller is used to execute any one of the methods in the first aspect.
[0041] Optionally, the third downsampling filter module includes a first downsampling filter submodule and a second downsampling filter submodule;
[0042] The input end of the first downsampling filter submodule is connected to the output end of the first downsampling filter module, and is used to perform downsampling filtering on the signal output by the first downsampling filter module to obtain a target signal with a sampling rate of a target sampling rate;
[0043] The input end of the second downsampling filter submodule is connected to the output end of the second downsampling filter module, and is used to perform downsampling filtering on the signal output by the second downsampling filter module to obtain a target signal with a sampling rate of a target sampling rate.
[0044] Optionally, the microphone mixing system further includes a clock module, the clock module is connected to the analog microphone module, the digital microphone module, the first downsampling filter module, the second downsampling filter module and the third downsampling filter module, and the clock module is used to:
[0045] Providing a first clock signal to the analog microphone module and the first downsampling filter module according to the clock frequency of the analog microphone module;
[0046] Providing a second clock signal to the digital microphone module and the second downsampling filter module according to the clock frequency of the digital microphone module;
[0047] An input clock signal is provided to the third down-sampling filter module according to the input clock frequency.
[0048] Optionally, the microphone mixing system further includes an oversampling counter, configured to count according to a target counting period after receiving the input clock signal.
[0049] Optionally, the microphone mixing system further includes a pulse generator, one end of the pulse generator is connected to the oversampling counter, and the other end of the pulse generator is connected to the controller, and the pulse generator is used to generate a sampling pulse to the controller according to the counting status of the oversampling counter.
[0050] Through the above technical solution, the first delay and the second delay are determined according to the input clock frequency of the microphone mixing system and the target sampling rate of the output signal, and then the first downsampling filter module is controlled to downsample and filter the signal output by the analog microphone according to the first delay, and the second downsampling filter module is controlled to downsample and filter the signal output by the digital microphone according to the second delay, so as to control the phase difference between the signal output by the first downsampling filter module and the signal output by the second downsampling filter module. In this way, the problem that the phase difference between the two channels of data with the same sampling rate output by the analog microphone and the digital microphone in the microphone mixing system is difficult to control can be solved, and at the same time, the absolute delay of the two channels of data can also be reduced.
[0051] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0053] Figure 1 The figure is a flow chart of a microphone mixing method according to an exemplary embodiment.
[0054] Figure 2 is a structural diagram of a microphone mixing system according to an exemplary embodiment.
[0055] Figure 3 The figure is a schematic diagram showing the operation of a microphone mixing system according to an exemplary embodiment.
[0056] Figure 4 The figure is a working timing diagram of a microphone mixing system according to an exemplary embodiment.
[0057] Figure 5 The figure is a block diagram of a microphone mixing device according to an exemplary embodiment.
[0058] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0059] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0060] The present disclosure provides a microphone mixing method, device, storage medium, electronic device and system to solve technical problems in related technologies.
[0061] Figure 1 FIG. 1 is a flow chart of a microphone mixing method according to an exemplary embodiment. The microphone mixing method is applied to a microphone mixing system in which analog microphones and digital microphones are mixed, such as Figure 1 As shown, the microphone mixing method includes the following steps:
[0062] Step S11 , determining an input clock frequency of the microphone mixing system and a target sampling rate of an output signal in response to the microphone mixing signal.
[0063] Step S12, determining a first delay of a first down-sampling filter module connected to the analog microphone and a second delay of a second down-sampling filter module connected to the digital microphone according to the input clock frequency and the target sampling rate.
[0064] Step S13, controlling the first down-sampling filter module to perform down-sampling filtering on the signal output by the analog microphone according to the first delay, and controlling the second down-sampling filter module to perform down-sampling filtering on the signal output by the digital microphone according to the second delay.
[0065] First, it should be understood that the microphone mixing system in the present disclosure is a microphone mixing system that mixes analog microphones and digital microphones. Figure 2 FIG. 1 is a schematic diagram showing a structure of a microphone mixing system according to an exemplary embodiment. Figure 2 As shown, the microphone mixing system includes:
[0066] An analog microphone module 10, a digital microphone module 20, a first downsampling filter module 30, a second downsampling filter module 40, a third downsampling filter module 50 and a controller 60;
[0067] The input end of the first down-sampling filter module 30 is connected to the output end of the analog microphone module 10, and is used to down-sample and filter the signal output by the analog microphone module 10;
[0068] The input end of the second down-sampling filter module 40 is connected to the output end of the digital microphone module 20, and is used to perform down-sampling filtering on the signal output by the digital microphone module 20;
[0069] The input end of the third down-sampling filter module 50 is connected to the output end of the first down-sampling filter module 30 and the output end of the second down-sampling filter module 40, and is used to perform down-sampling filtering on the signals output by the first down-sampling filter module 30 and the second down-sampling filter module 40 to obtain a target signal with a sampling rate of a target sampling rate;
[0070] The controller 60 is connected to both the first down-sampling filter module 30 and the second down-sampling filter module 40 , and the controller 60 is used to execute the microphone mixing method.
[0071] For example, the controller 60 can control the first downsampling filter module to downsample and filter the signal output by the analog microphone after a first delay, and control the second downsampling filter module to downsample and filter the signal output by the digital microphone according to a second delay, so as to control the phase difference between the signal output by the first downsampling filter module and the signal output by the second downsampling filter module.
[0072] For example, the controller 60 may include a first start controller 601 and a second start controller 602. The first start controller 601 is connected to the first down-sampling filter module and is used to generate a first start signal according to the first delay, that is, to generate the first start signal after the first delay to start the first down-sampling filter module. The second start controller 602 is connected to the second down-sampling filter module and is used to generate a second start signal according to the second delay, that is, to generate the second start signal after the second delay to start the second down-sampling filter module. The embodiment of the present disclosure is not limited to this.
[0073] It should also be understood that the first downsampling filter module, the second downsampling filter module, and the third downsampling filter module can all be composed of a combination of one or more filters, which is not limited in the embodiments of the present disclosure. In addition, the first downsampling filter module, the second downsampling filter module, and the third downsampling filter module can all be sampling filters with fixed sampling rates, or sampling filters with adjustable sampling rates, which is not limited in the embodiments of the present disclosure.
[0074] In one embodiment, if Figure 2 As shown, the third down-sampling filter module 50 includes a first down-sampling filter submodule 501 and a second down-sampling filter submodule 502;
[0075] The input end of the first down-sampling filter submodule 501 is connected to the output end of the first down-sampling filter module 30, and is used to perform down-sampling filtering on the signal output by the first down-sampling filter module 30 to obtain a target signal with a sampling rate of a target sampling rate;
[0076] The input end of the second down-sampling filter submodule 502 is connected to the output end of the second down-sampling filter module 40 , and is used to perform down-sampling filtering on the signal output by the second down-sampling filter module 40 to obtain a target signal with a sampling rate of the target sampling rate.
[0077] In one embodiment, if Figure 2 As shown, the microphone mixing system further includes a clock module 70, which is connected to the analog microphone module 10, the digital microphone module 20, the first downsampling filter module 30, the second downsampling filter module 40 and the third downsampling filter module 50. The clock module 70 is used to:
[0078] Providing a first clock signal to the analog microphone module 10 and the first downsampling filter module 30 according to the clock frequency of the analog microphone module 10;
[0079] Providing a second clock signal to the digital microphone module 20 and the second down-sampling filter module 40 according to the clock frequency of the digital microphone module 20;
[0080] An input clock signal is provided to the third down-sampling filter module 50 according to the input clock frequency.
[0081] In one embodiment, if Figure 2 As shown, the microphone mixing system further includes an oversampling counter 80 for counting according to a target counting cycle after receiving an input clock signal.
[0082] In one embodiment, if Figure 2 As shown, the microphone mixing system also includes a pulse generator 90 , one end of the pulse generator 90 is connected to the oversampling counter 80 , and the other end is connected to the controller 60 . The pulse generator 90 is used to generate a sampling pulse to the controller 60 according to the counting status of the oversampling counter 80 .
[0083] For example, the input clock frequency is the frequency of the input clock signal provided by the clock module 70 to the third down-sampling filter module 50 , and the target sampling rate is the sampling rate of the target signal output by the third down-sampling filter module 50 .
[0084] Through the above technical method, the first delay and the second delay are determined according to the input clock frequency of the microphone mixing system and the target sampling rate of the output signal, and then the first downsampling filter module is controlled according to the first delay to downsample and filter the signal output by the analog microphone, and the second downsampling filter module is controlled according to the second delay to downsample and filter the signal output by the digital microphone, so as to control the phase difference between the signal output by the first downsampling filter module and the signal output by the second downsampling filter module. In this way, the problem of the difficulty in controlling the phase difference between the two channels of data with the same sampling rate output by the analog microphone and the digital microphone in the microphone mixing system can be solved, and at the same time, the absolute delay of the two channels of data can also be reduced.
[0085] In a possible manner, according to the input clock frequency and the target sampling rate, determining the first delay of the first downsampling filter module connected to the analog microphone and the second delay of the second downsampling filter module connected to the digital microphone may be:
[0086] Determine the target counting period according to the input clock frequency and the target sampling rate;
[0087] A first delay is determined according to a target counting period and a first coefficient length of a first down-sampling filter module, and a second delay is determined according to a target counting period and a second coefficient length of a second down-sampling filter module.
[0088] For example, the input clock frequency f0 and the target sampling rate f s , determine the target counting period T, that is, T = f0 / f s , in this case T is a relative period, and its unit is "period", which refers to the number of periods of the second clock. It can also be determined only according to the input clock frequency f0, that is, T = 1 / f0, in this case T is an absolute period, and its unit is "second", which refers to the concept of time.
[0089] After determining the target counting period, the first delay may be determined according to the target counting period and the first coefficient length of the first downsampling filter module, and the second delay may be determined according to the target counting period and the second coefficient length of the second downsampling filter module.
[0090] For example, in order to simplify the calculation steps, a number can be directly selected from 0 to T-1 as the target counting point C2, so that the controller of the pulse generator generates a sampling pulse when the sampling counter counts to the target counting point C2. At this time, it can be concluded that M1 = T2-L1, M2 = T2-L2. Among them, according to the following text, in the actual application process, it is not necessary to generate the first delay M1 and the second delay M2 after the pulse generator generates the sampling pulse through a real delay device, and then generate the first start signal and the second start signal, but directly generate the first start signal when the oversampling counter counts to C11, and generate the second start signal when the oversampling counter counts to C12. Therefore, in order to avoid the problem of negative numbers in M1 and M2, it should be noted that the value of C2 should not be too small, and C11 = C2-L1, C12 = C2-L1, so improper selection of C2 will result in negative numbers.
[0091] It is worth noting that the coefficient length in the present disclosure refers to the number of data in the corresponding data sequence when the digital filter performs convolution operation.
[0092] In a possible manner, the first delay is determined according to the target counting period and the first coefficient length of the first down-sampling filter module, and the second delay is determined according to the target counting period and the second coefficient length of the second down-sampling filter module. It can be:
[0093] determining a first clock frequency for the analog microphone and a second clock frequency for the digital microphone;
[0094] Determine a first downsampling ratio of the first downsampling filter module according to the first clock frequency and the target sampling rate, and determine a second downsampling ratio of the second downsampling filter module according to the second clock frequency and the target sampling rate;
[0095] A first delay is determined according to the first coefficient length and the first downsampling ratio, and a second delay is determined according to the second coefficient length and the second downsampling ratio.
[0096] It should be understood that the first clock frequency is the device frequency f of the analog microphone. a , the second clock frequency is the device frequency f of the digital microphone d The method for determining the first clock frequency of the analog microphone and the second clock frequency of the digital microphone is not specifically limited in the embodiment of the present disclosure.
[0097] For example, assuming the target sampling rate is f s The sampling rates of the signals output by the first downsampling filter module and the second downsampling filter module are both f s2 , based on the target sampling rate f s The preset multiple relationship between and determines f s2, then can be based on the first clock frequency f a and sampling rate f s2 , determine the first downsampling ratio D11 of the first downsampling filter module, that is, D11 = f a / f s2 , and according to the second clock frequency f b and sampling rate f s2 , determine the second downsampling ratio D12 of the second downsampling filter module, that is, D12 = f d / f s2 Then, a first delay is determined according to the first coefficient length and the first downsampling ratio, and a second delay is determined according to the second coefficient length and the second downsampling ratio.
[0098] In a possible manner, determining the first delay according to the first coefficient length and the first downsampling ratio, and determining the second delay according to the second coefficient length and the second downsampling ratio may be:
[0099] Determine a first counting point at which the first downsampling filter module starts filtering according to the first coefficient length and the first downsampling ratio, and determine a second counting point at which the second downsampling filter module starts filtering according to the second coefficient length and the second downsampling ratio;
[0100] Determine a third counting point at which the first downsampling filter module stops filtering according to the first counting point and the first coefficient length, and determine a fourth counting point at which the second downsampling filter module stops filtering according to the second counting point and the second coefficient length;
[0101] Determine a first delay according to the first counting point and the third counting point, and determine a second delay according to the second counting point and the fourth counting point;
[0102] The first downsampling ratio and the second downsampling ratio are both greater than the difference between the third counting point and the fourth counting point.
[0103] It should be understood that within a target counting cycle T, assuming that the sampling rates of the signals output by the first downsampling filter module and the second downsampling filter module are both f s2 , the first downsampling filter module needs to perform f s2 Extract once, and perform D11*f s2 The second downsampling filter module needs to perform f s2 D12*f s2 The decimation points of the two down-sampling filter modules can be selected at any end point of the filtering, and M1 and M2 can be used to adjust the start time of the two down-sampling filter modules, thereby indirectly selecting the decimation points of the two down-sampling filter modules.
[0104] For example, the filtering and extraction time periods of each downsampling filter module can be drawn on the time axis according to the first coefficient length and the first downsampling ratio, as well as the second coefficient length and the second downsampling ratio, and the first counting point C11 at which the first downsampling filter module starts filtering and the second counting point C12 at which the second downsampling filter module starts filtering can be determined on the time axis, and then according to the first counting point C11, L1 is pushed back to obtain the third counting point C21 at which the first downsampling filter module stops filtering, and according to the second counting point C12, L2 is pushed back to obtain the fourth counting point C22 at which the second downsampling filter module stops filtering. Finally, the first delay can be determined according to the first counting point and the third counting point, and the second delay can be determined according to the second counting point and the fourth counting point.
[0105] The first downsampling ratio D11 and the second downsampling ratio D12 are both greater than the difference between the third counting point and the fourth counting point, so that the phases of the two output data can be basically consistent.
[0106] In a possible manner, determining the first delay according to the first counting point and the third counting point, and determining the second delay according to the second counting point and the fourth counting point may be:
[0107] Determine a first initial delay according to the first counting point and the third counting point, and determine a second initial delay according to the second counting point and the fourth counting point;
[0108] adjusting the first initial delay and the second initial delay according to the third counting point and the fourth counting point;
[0109] When the third counting point and the fourth counting point coincide with each other, the first delay, the second delay and the target counting point are determined.
[0110] For example, after determining the first counting point, the second counting point, the third counting point and the fourth counting point, the first initial delay is determined according to the first counting point and the third counting point, and the second initial delay is determined according to the second counting point and the fourth counting point, and then according to the third counting point and the fourth counting point, the first initial delay and the second initial delay are continuously adjusted so that the third counting point and the fourth counting point coincide with each other. When the third counting point and the fourth counting point coincide with each other, the adjusted first initial delay and second initial delay are determined as the first delay and the second delay.
[0111] It is worth noting that, in the case where the third counting point and the fourth counting point coincide, the counting point when the third counting point and the fourth counting point coincide is the target counting point C2 of the target counting cycle. In the application process of the microphone mixing system, the oversampling counter repeats counting according to the target counting cycle T. When the oversampling counter counts to the target counting point C2, the pulse generator generates a sampling pulse signal. In response to the sampling pulse signal, the controller generates a first start signal after a first delay to control the first downsampling filter module to perform downsampling filtering on the signal output by the analog microphone. And after a second delay, a second start signal is generated to control the second downsampling filter module to perform downsampling filtering on the signal output by the digital microphone, thereby controlling the phase difference between the signal output by the first downsampling filter module and the signal output by the second downsampling filter module, so that the phases of the two channels of data with the same sampling rate output by the analog microphone and the digital microphone output by the third downsampling filter module are consistent.
[0112] In a possible manner, before determining the first delay, the second delay and the target counting point, it is also possible to:
[0113] It is determined that the first down-sampling filtering module and the second down-sampling filtering module stop filtering simultaneously when the third counting point and the fourth counting point coincide with each other.
[0114] It should be understood that if the difference between the first coefficient length L1 and the second coefficient length L2 is large, and / or the difference between the first downsampling ratio D11 and the second downsampling ratio D12 is large, it may cause the first downsampling filter module and / or the second downsampling filter module not to stop filtering when the third counting point C21 and the fourth counting point C22 coincide, that is, at the target counting point C2. Therefore, when the third counting point C21 and the fourth counting point C22 coincide, before determining the first delay, the second delay and the target counting point, it can also be determined whether the first downsampling filter module and the second downsampling filter module stop filtering at the same time when the third counting point and the fourth counting point coincide.
[0115] If the first down-sampling filter module and the second down-sampling filter module stop filtering simultaneously when the third counting point C21 and the fourth counting point C22 coincide with each other, the counting point when the third counting point C21 and the fourth counting point C22 coincide with each other may be determined as the target counting point C2.
[0116] If the first down-sampling filter module and the second down-sampling filter module do not stop filtering at the same time when the third counting point C21 and the fourth counting point C22 coincide, the subsequent start-up sequence can be drawn continuously until the third counting point C21 and the fourth counting point C22 coincide, and the first down-sampling filter module and the second down-sampling filter module stop filtering at the same time, and then the point is determined as the target counting point C2. The first coefficient length L1 and the second coefficient length L2 can also be pushed back at the target counting point C2 to obtain a new third counting point C21 and a new fourth counting point C22, and the new first delay M1 and the new second delay M2 are re-determined, and the new first delay M1 and the new second delay M2 are adjusted to determine the new third counting point C21 and the new fourth counting point C22 coincide, and the first down-sampling filter module and the second down-sampling filter module stop filtering at the target counting point C2 at the same time, and so on. The embodiments of the present disclosure do not specifically limit this.
[0117] The method of determining whether the first downsampling filter module and the second downsampling filter module stop filtering simultaneously when the third counting point and the fourth counting point coincide with each other may be:
[0118] Backward calculation is performed based on the target counting point C2 and the first coefficient length L1, and back calculation is performed based on the target counting point C2 and the second coefficient length L2 to determine whether the first downsampling filter module and the second downsampling filter module are started to filter at the same time. The method for determining whether the first downsampling filter module and the second downsampling filter module stop filtering at the same time when the third counting point C21 and the fourth counting point C22 coincide with each other in the embodiment of the present disclosure is not specifically limited.
[0119] Figure 3 FIG. 1 is a schematic diagram showing the operation of a microphone mixing system according to an exemplary embodiment. Figure 3As shown, after the microphone mixing system is started, the oversampling counter 80 repeats counting according to the target counting period T based on the output clock. When the oversampling counter 80 counts to the target counting point C2, the pulse generator 90 generates a sampling pulse signal. In response to the sampling pulse signal, the controller 60 first controls the third downsampling filter module 50 to start, and then generates a first start signal after the first delay M1 to control the first downsampling filter module 30 to perform downsampling filtering on the signal output by the analog microphone module 10 based on the AMIC sampling clock and the first downsampling ratio D11. And after the second delay M2, a second start signal is generated to control the second downsampling filter module 40 to perform downsampling filtering on the signal output by the digital microphone module 20 based on the DMIC sampling clock and the second downsampling ratio D12. The third downsampling filter module 50 performs downsampling filtering on the signals output by the first downsampling filter module 30 and the second downsampling filter module 40 according to the downsampling ratio D2, and outputs a target signal with a sampling rate of the target sampling rate. The phase difference between the signal output by the first downsampling filter module 30 and the signal output by the second downsampling filter module 40 is then controlled so that the phases of the two channels of data with the same sampling rate output by the analog microphone module 10 and the digital microphone module 20 output by the third downsampling filter module 50 are consistent.
[0120] Figure 4 FIG. 1 is a working timing diagram of a microphone mixing system according to an exemplary embodiment. Figure 4 As shown, from top to bottom are system enable, oversampling counter, sampling pulse signal, first start signal, first sampling pulse, second start signal and second sampling pulse. Figure 4 As shown, after the microphone mixing system is started, the oversampling counter repeats counting according to the target counting period T. When the oversampling counter counts to the target counting point C2, the pulse generator generates a sampling pulse signal. In response to the sampling pulse signal, the controller generates a first start signal after a first delay M1 to control the first downsampling filter module to perform downsampling filtering on the signal output by the analog microphone module according to the first sampling pulse. And after a second delay M2, a second start signal is generated to control the second downsampling filter module to perform downsampling filtering on the signal output by the digital microphone module according to the second sampling pulse.
[0121] Figure 5 FIG. 1 is a block diagram of a microphone mixing device according to an exemplary embodiment. Figure 5 As shown, the microphone mixing device 400 includes:
[0122] A first determination module 401 is used to determine an input clock frequency of the microphone mixing system and a target sampling rate of an output signal in response to a microphone mixing signal;
[0123] A second determination module 402 is used to determine a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone according to the input clock frequency and the target sampling rate;
[0124] The control module 403 controls the first down-sampling filter module to perform down-sampling filtering on the signal output by the analog microphone according to the first delay, and controls the second down-sampling filter module to perform down-sampling filtering on the signal output by the digital microphone according to the second delay.
[0125] Optionally, the second determining module 402 is used to:
[0126] Determining a target counting period according to the input clock frequency and the target sampling rate;
[0127] The first delay is determined according to the target counting period and a first coefficient length of the first down-sampling filter module, and the second delay is determined according to the target counting period and a second coefficient length of the second down-sampling filter module.
[0128] Optionally, the second determining module 402 is used to:
[0129] determining a first clock frequency of the analog microphone and a second clock frequency of the digital microphone;
[0130] Determine a first downsampling ratio of the first downsampling filter module according to the first clock frequency and the target sampling rate, and determine a second downsampling ratio of the second downsampling filter module according to the second clock frequency and the target sampling rate;
[0131] The first delay is determined according to the first coefficient length and the first downsampling ratio, and the second delay is determined according to the second coefficient length and the second downsampling ratio.
[0132] Optionally, the second determining module 402 is configured to include:
[0133] Determine, according to the first coefficient length and the first downsampling ratio, a first counting point at which the first downsampling filter module starts filtering, and, according to the second coefficient length and the second downsampling ratio, determine a second counting point at which the second downsampling filter module starts filtering;
[0134] Determine, according to the first counting point and the first coefficient length, a third counting point at which the first downsampling filtering module stops filtering, and, according to the second counting point and the second coefficient length, determine a fourth counting point at which the second downsampling filtering module stops filtering;
[0135] Determine the first delay according to the first counting point and the third counting point, and determine the second delay according to the second counting point and the fourth counting point;
[0136] The first downsampling ratio and the second downsampling ratio are both greater than the difference between the third counting point and the fourth counting point.
[0137] Optionally, the second determining module 402 is configured to include:
[0138] Determine a first initial delay according to the first counting point and the third counting point, and determine a second initial delay according to the second counting point and the fourth counting point;
[0139] adjusting the first initial delay and the second initial delay according to the third counting point and the fourth counting point;
[0140] When the third counting point and the fourth counting point coincide with each other, the first delay, the second delay and the target counting point are determined.
[0141] Optionally, the second determining module 402 is further configured to:
[0142] Before determining the first delay, the second delay and the target counting point, it is determined that the first downsampling filtering module and the second downsampling filtering module stop filtering simultaneously when the third counting point and the fourth counting point coincide with each other.
[0143] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0144] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon. When the program instructions are executed by a processor, the steps of the microphone mixing method provided by the present disclosure are implemented.
[0145] The present disclosure also provides an electronic device, comprising:
[0146] a memory having a computer program stored thereon;
[0147] The processor is used to execute the computer program in the memory to implement the steps of the microphone mixing method provided in the present disclosure.
[0148] Figure 6 FIG. 1 is a block diagram of an electronic device according to an exemplary embodiment. Figure 6As shown, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.
[0149] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned storage method. The memory 702 is used to store various types of data to support the operation of the electronic device 700. These data may include instructions for any application or method used to operate on the electronic device 700, as well as application-related data, such as contact data, messages sent and received, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 705 may include: Wi-Fi module, Bluetooth module, NFC module, etc.
[0150] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned microphone mixing method.
[0151] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the microphone mixing method described above are implemented. For example, the computer-readable storage medium may be the memory 702 including the program instructions, and the program instructions may be executed by the processor 701 of the electronic device 700 to complete the microphone mixing method described above.
[0152] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program that can be executed by a programmable device. The computer program has a code portion for executing the microphone mixing method when executed by the programmable device.
[0153] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0154] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0155] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A microphone mixing method, characterized in that: A microphone mixing system applied to a mixed use of analog microphones and digital microphones, the method comprising: In response to the microphone mixing signal, determining an input clock frequency and a target sampling rate of an output signal of the microphone mixing system; Determine, according to the input clock frequency and the target sampling rate, a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone; The first down-sampling filter module is controlled to perform down-sampling filtering on the signal output by the analog microphone according to the first delay, and the second down-sampling filter module is controlled to perform down-sampling filtering on the signal output by the digital microphone according to the second delay.
2. The method according to claim 1, characterized in that The step of determining a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone according to the input clock frequency and the target sampling rate comprises: Determining a target counting period according to the input clock frequency and the target sampling rate; The first delay is determined according to the target counting period and a first coefficient length of the first down-sampling filter module, and the second delay is determined according to the target counting period and a second coefficient length of the second down-sampling filter module.
3. The method according to claim 2, characterized in that The determining the first delay according to the target counting cycle and the first coefficient length of the first down-sampling filter module, and determining the second delay according to the target counting cycle and the second coefficient length of the second down-sampling filter module, comprises: determining a first clock frequency of the analog microphone and a second clock frequency of the digital microphone; Determine a first downsampling ratio of the first downsampling filter module according to the first clock frequency and the target sampling rate, and determine a second downsampling ratio of the second downsampling filter module according to the second clock frequency and the target sampling rate; The first delay is determined according to the first coefficient length and the first downsampling ratio, and the second delay is determined according to the second coefficient length and the second downsampling ratio.
4. The method according to claim 3, characterized in that The determining the first delay according to the first coefficient length and the first downsampling ratio, and determining the second delay according to the second coefficient length and the second downsampling ratio, comprises: Determine, according to the first coefficient length and the first downsampling ratio, a first counting point at which the first downsampling filter module starts filtering, and, according to the second coefficient length and the second downsampling ratio, determine a second counting point at which the second downsampling filter module starts filtering; Determine, according to the first counting point and the first coefficient length, a third counting point at which the first downsampling filtering module stops filtering, and, according to the second counting point and the second coefficient length, determine a fourth counting point at which the second downsampling filtering module stops filtering; Determine the first delay according to the first counting point and the third counting point, and determine the second delay according to the second counting point and the fourth counting point; The first downsampling ratio and the second downsampling ratio are both greater than the difference between the third counting point and the fourth counting point.
5. The method according to claim 4, characterized in that The determining the first delay according to the first counting point and the third counting point, and determining the second delay according to the second counting point and the fourth counting point, comprises: Determine a first initial delay according to the first counting point and the third counting point, and determine a second initial delay according to the second counting point and the fourth counting point; adjusting the first initial delay and the second initial delay according to the third counting point and the fourth counting point; When the third counting point and the fourth counting point coincide with each other, the first delay, the second delay and the target counting point are determined.
6. The method according to claim 5, characterized in that Before determining the first time delay, the second time delay and the target counting point, the method further includes: It is determined that the first down-sampling filtering module and the second down-sampling filtering module stop filtering simultaneously when the third counting point and the fourth counting point coincide with each other.
7. A microphone mixing device, characterized in that: The device comprises: A first determination module, configured to determine an input clock frequency of the microphone mixing system and a target sampling rate of an output signal in response to a microphone mixing signal; A second determination module, configured to determine a first delay of a first downsampling filter module connected to the analog microphone and a second delay of a second downsampling filter module connected to the digital microphone according to the input clock frequency and the target sampling rate; The control module controls the first down-sampling filter module to perform down-sampling filtering on the signal output by the analog microphone according to the first delay, and controls the second down-sampling filter module to perform down-sampling filtering on the signal output by the digital microphone according to the second delay.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
9. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
10. A microphone mixing system, characterized in that: The microphone mixing system comprises: An analog microphone module, a digital microphone module, a first downsampling filter module, a second downsampling filter module, a third downsampling filter module and a controller; The input end of the first downsampling filter module is connected to the output end of the analog microphone module, and is used to perform downsampling filtering on the signal output by the analog microphone module; The input end of the second downsampling filter module is connected to the output end of the digital microphone module, and is used to perform downsampling filtering on the signal output by the digital microphone module; The input end of the third down-sampling filter module is connected to the output end of the first down-sampling filter module and the output end of the second down-sampling filter module, and is used to perform down-sampling filtering on the signals output by the first down-sampling filter module and the second down-sampling filter module to obtain a target signal with a sampling rate of a target sampling rate; The controller is connected to both the first downsampling filter module and the second downsampling filter module, and the controller is used to execute the method according to any one of claims 1 to 6.
11. The microphone mixing system according to claim 10, characterized in that: The third downsampling filter module includes a first downsampling filter submodule and a second downsampling filter submodule; The input end of the first downsampling filter submodule is connected to the output end of the first downsampling filter module, and is used to perform downsampling filtering on the signal output by the first downsampling filter module to obtain a target signal with a sampling rate of a target sampling rate; The input end of the second downsampling filter submodule is connected to the output end of the second downsampling filter module, and is used to perform downsampling filtering on the signal output by the second downsampling filter module to obtain a target signal with a sampling rate of a target sampling rate.
12. The microphone mixing system according to claim 10, characterized in that: The microphone mixing system further includes a clock module, which is connected to the analog microphone module, the digital microphone module, the first downsampling filter module, the second downsampling filter module, and the third downsampling filter module, and is used to: Providing a first clock signal to the analog microphone module and the first downsampling filter module according to the clock frequency of the analog microphone module; Providing a second clock signal to the digital microphone module and the second downsampling filter module according to the clock frequency of the digital microphone module; An input clock signal is provided to the third down-sampling filter module according to the input clock frequency.
13. The microphone mixing system according to claim 12, characterized in that: The microphone mixing system further includes an oversampling counter, which is used to count according to a target counting cycle after receiving the input clock signal.
14. The microphone mixing system according to claim 13, characterized in that: The microphone mixing system also includes a pulse generator, one end of which is connected to the oversampling counter, and the other end of which is connected to the controller. The pulse generator is used to generate a sampling pulse to the controller according to the counting status of the oversampling counter.