Earphone loudspeaker calibration method and device, terminal equipment and storage medium
By calculating the difference between the frequency response curve of the headphone speaker and the standard frequency response curve, the filtering parameters are determined and the filtering is calibrated, which solves the problem of low calibration success rate of headphone speakers in the existing technology and improves the calibration success rate and production line yield.
Patent Information
- Application Number
- CN202310206748.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-02-28
AI Technical Summary
Existing technologies have a low calibration success rate in the speaker calibration process of TWS earphones, which affects the yield of the production line.
By calculating the difference between the frequency response curve of the sound signal played by the speaker of the headphone under test and the standard frequency response curve, the calibration filter parameters are determined and written into the headphone for filter calibration, including correcting the frequency response curve and multiple rounds of filtering to achieve the calibration requirements.
This improved the success rate of headphone speaker calibration and increased the yield of the production line.
Smart Images

Figure CN116437279B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of headphone audio technology, and particularly relates to a headphone speaker calibration method, apparatus, terminal device, and computer-readable storage medium. Background Technology
[0002] With the rapid development of technology, wireless headphones are widely used in people's lives, and TWS headphones are constantly being updated and upgraded.
[0003] Currently, when calibrating the SPK (statistical process control, speaker) of TWS (True Wireless Stereo) noise-canceling headphones on the production line, the main method is to perform frequency response analysis on the recorded sound emitted by the product SPK, determine whether it can be calibrated by using a threshold, and then calibrate the product SPK using a calibration algorithm when the result is calibrable. The calibration parameters are then written into the register of the headphone under test. Finally, the frequency response curve of the calibrated product SPK is compared with the target frequency response curve to determine whether the calibration is qualified. This method has a low calibration success rate for headphone SPKs, thus affecting the yield of the production line. Summary of the Invention
[0004] The main objective of this invention is to provide a method, apparatus, terminal device, and computer-readable storage medium for calibrating headphone speakers. It aims to provide a scheme for calibrating headphone speakers by determining filter parameters, thereby improving the success rate of headphone speaker calibration.
[0005] To achieve the above objectives, the present invention provides a speaker calibration method for headphones, the speaker calibration method for headphones comprising:
[0006] Calculate the first frequency response curve based on the sound signal played by the speaker of the headphone under test;
[0007] The first calibration filter parameters are calculated based on the difference between the first frequency response curve and the standard frequency response curve.
[0008] The calculated first calibration filter parameters are written into the earphone under test so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters.
[0009] Optionally, after the step of calculating the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve, the method further includes:
[0010] The first frequency response curve is used as the target frequency response curve, and the first calibration filter parameter is used as the target calibration filter parameter. The target frequency response curve is corrected based on the target calibration filter parameter to obtain the corrected frequency response curve.
[0011] Determine whether the preset filter loop termination condition has been met;
[0012] If so, then end the filtering loop;
[0013] If not, then based on the difference between the corrected frequency response curve and the standard frequency response curve, calculate the second calibration filter parameter, use the corrected frequency response curve as the target frequency response curve, use the second calibration filter parameter as the target calibration filter parameter, and return to execute the step of correcting the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve;
[0014] The second calibration filter parameters calculated in each filtering cycle are written into the headphone under test so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filter parameters.
[0015] Optionally, the step of calculating the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve includes:
[0016] The first amplitude frequency response curve is determined based on the difference between the first frequency response curve and the standard frequency response curve;
[0017] Based on the first amplitude-frequency response curve, the first calibration filter parameters are calculated.
[0018] Optionally, the step of calculating the first calibration filter parameters based on the first amplitude-frequency response curve includes:
[0019] Based on a preset extreme value range, determine the absolute values of each extreme value on the first amplitude-frequency characteristic curve that is not within the preset extreme value range;
[0020] The extreme value corresponding to the largest absolute value among all absolute values is determined as the target extreme value. Based on the target extreme value, the first calibration filter parameter is calculated.
[0021] Optionally, the step of calculating the first calibration filter parameter based on the target extreme value includes:
[0022] The frequency point where the target extremum is located is taken as the center frequency of the filter;
[0023] The magnitude of the target extremum is used as the filter magnitude;
[0024] The target value is obtained by multiplying the largest absolute value by the preset percentage, and the frequency point corresponding to the absolute value that differs the least from the target value is taken as the filter bandwidth.
[0025] Calculate the filter quality factor based on the filter center frequency and the filter bandwidth;
[0026] The filter center frequency, the filter amplitude, and the filter quality factor are used as the first calibration filter parameters.
[0027] Optionally, after the step of the earphone under test filtering the sound signal to be played by the speaker based on the first calibration filtering parameters, the method further includes:
[0028] The third frequency response curve is calculated based on the filtered sound signal played by the earphone under test.
[0029] The second amplitude frequency response curve is determined based on the difference between the third frequency response curve and the standard frequency response curve;
[0030] When all extreme values of the second amplitude-frequency response curve are within the preset extreme value range, the calibration result is determined to be successful.
[0031] Optionally, the step of calculating the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test includes:
[0032] The recorded sound signal played by the speaker of the headphone under test is converted into a digital signal, and the digital signal is subjected to Fourier transform to obtain the first frequency response curve.
[0033] Furthermore, to achieve the above objectives, the present invention also provides a speaker calibration device for headphones, the speaker calibration device for headphones comprising:
[0034] The first frequency response curve module is used to calculate the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test;
[0035] The first calibration filter parameter module is used to calculate the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve.
[0036] The calibration module is used to write the calculated first calibration filter parameters into the earphone under test, so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters.
[0037] Furthermore, to achieve the above objectives, the present invention also provides a terminal device, the terminal device comprising: a memory, a processor, and a headphone speaker calibration program stored in the memory and executable on the processor, wherein when the headphone speaker calibration program of the terminal device is executed by the processor, it implements the steps of the headphone speaker calibration method as described above.
[0038] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a speaker calibration program for headphones, which, when executed by a processor, implements the steps of the speaker calibration method for headphones as described above.
[0039] This invention provides a method, apparatus, terminal device, and computer-readable storage medium for calibrating the speaker of an earphone. The method calculates a first frequency response curve based on the recorded sound signal played by the speaker of the earphone under test; calculates a first calibration filter parameter based on the difference between the first frequency response curve and a standard frequency response curve; and writes the calculated first calibration filter parameter into the earphone under test so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameter.
[0040] This invention provides a method for calibrating headphone speakers by determining filter parameters. The calibration testing system calculates a first frequency response curve based on the recorded sound signal played by the headphone under test. Then, based on the difference between the first frequency response curve and a standard frequency response curve, it calculates a first calibration filter parameter for the headphone. Finally, the calculated first calibration filter parameter is written into the headphone so that it can filter the sound signal to be played by the speaker. Thus, this invention provides a scheme for headphone speaker calibration by determining filter parameters, thereby improving the success rate of headphone speaker calibration. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the device structure of the terminal device hardware operating environment involved in the embodiments of the present invention;
[0042] Figure 2 This is a schematic flowchart of the first embodiment of the speaker calibration method for headphones according to the present invention;
[0043] Figure 3 This is a schematic diagram of the hardware structure of a calibration test system according to an embodiment of the speaker calibration method for headphones of the present invention;
[0044] Figure 4 This is a schematic diagram of the peak filter function image involved in an embodiment of the speaker calibration method for headphones of the present invention;
[0045] Figure 5This is a schematic diagram of a notch filter function image involved in an embodiment of the speaker calibration method for headphones of the present invention;
[0046] Figure 6 This is a schematic diagram of the headphone speaker calibration process according to an embodiment of the headphone speaker calibration method of the present invention.
[0047] Figure 7 This is a schematic diagram of the functional modules of an embodiment of the speaker calibration device for headphones according to the present invention.
[0048] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0049] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0050] Reference Figure 1 , Figure 1 This is a schematic diagram of the hardware operating environment of the terminal device involved in the embodiment of the present invention.
[0051] It should be noted that the terminal device integrated with the calibration and testing system in the embodiments of the present invention can be a headset, smartphone, personal computer, server, or other device, and no specific limitation is made here.
[0052] like Figure 1 As shown, the terminal device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0053] Those skilled in the art will understand that Figure 1 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0054] like Figure 1As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a headphone speaker calibration program.
[0055] exist Figure 1 In the terminal shown, network interface 1004 is mainly used to connect to the backend server and communicate data with it; user interface 1003 is mainly used to connect to the client and communicate data with it; and processor 1001 can be used to call the headphone speaker calibration program stored in memory 1005 and perform the following operations:
[0056] Calculate the first frequency response curve based on the sound signal played by the speaker of the headphone under test;
[0057] The first calibration filter parameters are calculated based on the difference between the first frequency response curve and the standard frequency response curve.
[0058] The calculated first calibration filter parameters are written into the earphone under test so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters.
[0059] Furthermore, after the step of calculating the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve, the processor 1001 can also be used to call the headphone speaker calibration program stored in the memory 1005 to perform the following operations:
[0060] The first frequency response curve is used as the target frequency response curve, and the first calibration filter parameter is used as the target calibration filter parameter. The target frequency response curve is corrected based on the target calibration filter parameter to obtain the corrected frequency response curve.
[0061] Determine whether the preset filter loop termination condition has been met;
[0062] If so, then end the filtering loop;
[0063] If not, then based on the difference between the corrected frequency response curve and the standard frequency response curve, calculate the second calibration filter parameter, use the corrected frequency response curve as the target frequency response curve, use the second calibration filter parameter as the target calibration filter parameter, and return to execute the step of correcting the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve;
[0064] The second calibration filter parameters calculated in each filtering cycle are written into the headphone under test so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filter parameters.
[0065] Furthermore, the operation of calculating the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve includes:
[0066] The first amplitude frequency response curve is determined based on the difference between the first frequency response curve and the standard frequency response curve;
[0067] Based on the first amplitude-frequency response curve, the first calibration filter parameters are calculated.
[0068] Furthermore, the operation of calculating the first calibration filter parameters based on the first amplitude-frequency response curve includes:
[0069] Based on a preset extreme value range, determine the absolute values of each extreme value on the first amplitude-frequency characteristic curve that is not within the preset extreme value range;
[0070] The extreme value corresponding to the largest absolute value among all absolute values is determined as the target extreme value. Based on the target extreme value, the first calibration filter parameter is calculated.
[0071] Furthermore, the operation of calculating the first calibration filter parameter based on the target extreme value includes:
[0072] The frequency point where the target extremum is located is taken as the center frequency of the filter;
[0073] The magnitude of the target extremum is used as the filter magnitude;
[0074] The target value is obtained by multiplying the largest absolute value by the preset percentage, and the frequency point corresponding to the absolute value that differs the least from the target value is taken as the filter bandwidth.
[0075] Calculate the filter quality factor based on the filter center frequency and the filter bandwidth;
[0076] The filter center frequency, the filter amplitude, and the filter quality factor are used as the first calibration filter parameters.
[0077] Furthermore, after the step of the earphone under test filtering the sound signal to be played by the speaker based on the first calibration filtering parameters, the processor 1001 can also call the speaker calibration program of the earphone stored in the memory 1005 to perform the following operations:
[0078] The third frequency response curve is calculated based on the filtered sound signal played by the earphone under test.
[0079] The second amplitude frequency response curve is determined based on the difference between the third frequency response curve and the standard frequency response curve;
[0080] When all extreme values of the second amplitude-frequency response curve are within the preset extreme value range, the calibration result is determined to be successful.
[0081] Furthermore, the operation of calculating the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test includes:
[0082] The recorded sound signal played by the speaker of the headphone under test is converted into a digital signal, and the digital signal is subjected to Fourier transform to obtain the first frequency response curve.
[0083] Based on the above structure, various embodiments of the headphone speaker calibration method are proposed.
[0084] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the headphone speaker calibration method of the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the headphone speaker calibration method of the present invention may execute the steps shown or described in a different order. In this embodiment, the executing entity of the headphone speaker calibration method can be a personal computer, smartphone, or other device; this is not limited in this embodiment. For ease of description, the executing entity is omitted from the description of each embodiment. In this embodiment, the headphone speaker calibration method includes:
[0085] Step S10: Calculate the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test;
[0086] Based on the sound signal played by the acquired earphone under test, the frequency response curve corresponding to the sound signal is determined (hereinafter referred to as the first frequency response curve for distinction).
[0087] In one feasible embodiment, the earphone under test is located in the test fixture part of the hardware part of the calibration test system of the present invention. During the test, the SPK of the earphone under test first emits a sound signal using the earphone equalizer. Then, the main control computer determines a frequency response curve, namely the first frequency response curve, based on the sound signal.
[0088] In one feasible implementation, before recording the sound signal played by the earphone under test for testing, an A2DP Bluetooth connection is established with the earphone under test via a Bluetooth adapter. The Bluetooth adapter then plays a 1 / 12 octave band sine sweep signal with a frequency of 20Hz-20kHz, a minimum period of 10 cycles, and a minimum period duration of 10ms through the speaker of the earphone under test. The sine sweep signal played by the earphone under test is the sound signal used for testing and calibration.
[0089] Furthermore, in one feasible embodiment, step S10 above includes:
[0090] Step S101: Convert the recorded sound signal played by the speaker of the earphone under test into a digital signal, and perform a Fourier transform on the digital signal to obtain the first frequency response curve.
[0091] The sound signal played by the speaker of the earphone under test, recorded through a standard microphone, is converted into a digital signal, and the digital signal is subjected to Fourier transform to obtain the first frequency response curve.
[0092] In one feasible embodiment, the calibration microphone is located in the test fixture part of the hardware part of the calibration test system of the present invention. The calibration microphone is used to record the test sound signal played by the earphone under test in place of the human ear. After the calibration microphone records the sound signal emitted by the earphone under test, it sends the sound signal to the test amplifier. The test amplifier converts and processes the received sound signal to obtain the digital signal corresponding to the sound signal. The test amplifier sends the digital signal obtained by processing the sound signal to the sound card of the industrial control computer. The sound card receives the digital signal so that the industrial control computer can perform Fourier analysis on the digital signal to obtain the frequency response curve FR_Curve1, that is, the first frequency response curve.
[0093] In one feasible implementation, such as Figure 3 As shown, the hardware of the calibration test system consists of an industrial control computer, a standard microphone, a test amplifier, a sound card, and a Bluetooth adapter. Specifically, the industrial control computer provides a USB interface to connect to the Bluetooth adapter, which then establishes a Bluetooth connection with the earphone under test. The Bluetooth adapter plays a sinusoidal sweep signal, which is played through the SPK of the earphone under test. The earphone under test and the standard microphone form a test fixture, with the standard microphone recording the sound signal played by the SPK of the earphone under test. The test fixture and the Bluetooth adapter are located inside an audio shielded box. The standard microphone is connected to the input of the test amplifier, which includes left and right inputs and left and right outputs. The output of the test amplifier is connected to the sound card of the industrial control computer. The test amplifier converts the sound signals recorded by the standard microphone received by the left and right inputs into digital signals, and the left and right outputs send the digital signals to the sound card of the main control computer. The main control computer performs calculations and processing based on the digital signals received by the sound card.
[0094] Step S20: Calculate the first calibration filter parameters based on the difference between the first frequency response curve and the standard frequency response curve;
[0095] Based on the difference between the first frequency response curve and the standard frequency response curve, the calibration filter parameters of a filter for the headphone under test are calculated (hereinafter referred to as the first calibration filter parameters for distinction).
[0096] It should be noted that the earphone under test contains multiple peak filters and notch filters for calibrating the earphone speakers. The number of these two types of filters is the total number of filters contained in the earphone chip. The function curve corresponding to the peak filter is shown in the figure below. Figure 4 As shown, the function curve corresponding to the notch filter is as follows: Figure 5 As shown, peak filters are often used to retain or gain specific frequency components, while notch filters are often used to remove or attenuate specific frequency components, thereby enabling adjustment and calibration of the headphone's SPK.
[0097] In one feasible implementation, the main control unit calculates the filter parameters of the current filter based on the first frequency response curve corresponding to the sound signal played by the headphone under test. Since the method of the present invention first determines the parameters of the current filter when determining the parameters of each filter, and the parameters of the current filter are needed to determine the parameters of the next filter, the aforementioned first calibration filter parameter represents the calibration filter parameter of the current filter.
[0098] Step S30: Write the calculated first calibration filter parameters into the earphone under test, so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters.
[0099] The calculated first calibration filter parameters are written into the earphone under test, so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters, thereby achieving the function of calibrating the earphone speaker.
[0100] In one feasible implementation, the calibration filtering parameters of a filter in the headphone under test are written into the register of the headphone under test, and the headphone SPK is automatically calibrated according to the filter parameters in the register.
[0101] In this embodiment, the headphone speaker calibration method of the present invention converts the sound signal played by the headphone speaker under test, which is recorded through a standard microphone, into a digital signal, and performs a Fourier transform on the digital signal to obtain a first frequency response curve; calculates a calibration filter parameter of a filter of the headphone under test based on the difference between the first frequency response curve and the standard frequency response curve; and writes the calculated first calibration filter parameter into the headphone under test so that the headphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameter, thereby achieving the function of calibrating the headphone speaker.
[0102] Thus, this embodiment of the invention calculates a first frequency response curve corresponding to the sound signal played by the earphone under test using a calibration test system. Then, based on the difference between the first frequency response curve and a standard frequency response curve, it calculates a first calibration filter parameter for the earphone under test. Finally, the calculated first calibration filter parameter is written into the earphone under test, allowing it to filter the sound signal to be played by the speaker based on the first calibration filter parameter. Therefore, this invention provides a scheme for earphone speaker calibration by determining filter parameters, thereby improving the success rate of earphone speaker calibration.
[0103] Furthermore, based on the first embodiment of the speaker calibration method for headphones of the present invention described above, a second embodiment of the speaker calibration method for headphones of the present invention is proposed.
[0104] In this embodiment, after step S20, the speaker calibration method for the headphones of the present invention further includes:
[0105] Step A10: Take the first frequency response curve as the target frequency response curve, take the first calibration filter parameter as the target calibration filter parameter, and correct the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve;
[0106] The first frequency response curve is used as the target frequency response curve, and the first calibration filter parameter is used as the target calibration filter parameter. The target frequency response curve is filtered and corrected according to the target calibration filter parameter to obtain the corrected frequency response curve.
[0107] In one feasible implementation, the first frequency response curve is theoretically corrected based on the filter parameters of the current filter, namely the first calibration filter parameters. Specifically, if the current filter is a notch filter, the specific frequency components in the first frequency response curve are attenuated according to the parameters of the notch filter to obtain the corrected frequency response curve, namely the corrected frequency response curve.
[0108] Step A20: Determine whether the preset filter loop termination condition has been met;
[0109] Determine whether the preset filter loop termination condition has been met.
[0110] It should be noted that the preset filter loop termination condition is that the parameters of all filters of the headphone under test have been calculated or the corrected frequency response curve meets the calibration requirements. The calibration requirements are that the difference between the corrected frequency response curve and the standard frequency response curve is within a preset range, which is the preset extreme value range mentioned below.
[0111] It should be noted that this invention does not limit the range of the difference between the corrected frequency response curve and the standard frequency response curve in the calibration requirements.
[0112] If step A30 is correct, then the filtering loop ends.
[0113] If the preset filter loop termination condition has been met, then the filter loop ends.
[0114] Step A40: If not, calculate the second calibration filter parameter based on the difference between the corrected frequency response curve and the standard frequency response curve, take the corrected frequency response curve as the target frequency response curve, take the second calibration filter parameter as the target calibration filter parameter, and return to execute the step of correcting the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve;
[0115] If the preset filter loop termination condition has not been met, then based on the difference between the corrected frequency response curve and the standard frequency response curve, the calibration filter parameters of another calibration filter (hereinafter referred to as the second calibration filter parameters for distinction) are calculated. Then, the corrected frequency response curve obtained by the filter correction is used as the target frequency response curve, the second calibration filter parameters are used as the target calibration filter parameters, and the process returns to the step of correcting the target frequency response curve based on the target calibration filter parameters to obtain the corrected frequency response curve.
[0116] In one feasible implementation, the filter parameters of the next filter are calculated based on the corrected frequency response curve after one correction. It can be understood that the first frequency response curve is determined based on the sound signal emitted by the headphone under test, which can be regarded as the original frequency response curve. The parameters of a filter are determined based on the original frequency response curve, and the original frequency response curve is corrected based on the parameters. Then, the parameters of the next filter, namely the second calibration filter parameters mentioned above, are determined based on the corrected frequency response curve.
[0117] Step A50 involves writing the second calibration filter parameters calculated in each filtering cycle into the headphone under test, so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filter parameters.
[0118] After the filtering cycle ends, the second calibration filtering parameters calculated in each filtering cycle are written into the register of the headphone under test, so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filtering parameters.
[0119] In this embodiment, the speaker calibration method for the headphones of the present invention uses the first frequency response curve as the target frequency response curve and the first calibration filter parameter as the target calibration filter parameter. The target frequency response curve is then filtered and corrected according to the target calibration filter parameter to obtain the corrected frequency response curve. The method then determines whether a preset filtering cycle termination condition has been met. It should be noted that the preset filtering cycle termination condition is that the parameters of all filters for the headphone under test have been calculated or the corrected frequency response curve meets the calibration requirements. The calibration requirements are that the difference between the corrected frequency response curve and the standard frequency response curve is within a preset range, which is the preset extreme value range mentioned below. If the preset filtering cycle has been reached... If the loop termination condition is met, the filtering loop ends. If the preset filtering loop termination condition is not met, the second calibration filter parameter of another calibration filter is calculated based on the difference between the corrected frequency response curve and the standard frequency response curve. Then, the corrected frequency response curve obtained from the filtering correction is used as the target frequency response curve, and the second calibration filter parameter is used as the target calibration filter parameter. The process returns to the step of correcting the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve. After the filtering loop ends, the second calibration filter parameter calculated in each filtering loop is written into the register of the headphone under test so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filter parameter.
[0120] In this way, the original frequency response curve is theoretically corrected by calculating the parameters of one filter at a time, and the parameters of the next filter to be calculated are determined by using the corrected frequency response curve. This process is repeated to determine the parameters of each filter of the headphone under test, which facilitates the subsequent calibration of the headphone's SPK based on each parameter.
[0121] Furthermore, based on the first and / or second embodiments of the speaker calibration method for headphones of the present invention described above, a third embodiment of the speaker calibration method for headphones of the present invention is proposed.
[0122] In this embodiment, step S20 includes:
[0123] Step S201: Determine the first amplitude frequency characteristic curve based on the difference between the first frequency response curve and the standard frequency response curve;
[0124] Based on the difference between the first frequency response curve and the standard frequency response curve, an amplitude-frequency characteristic curve (hereinafter referred to as the first amplitude-frequency characteristic curve for distinction) is determined.
[0125] In one feasible implementation, the first amplitude frequency characteristic curve Golden_FR1 after the theoretical filter cascade is calculated based on the first frequency response curve FR_Curve1 and the standard frequency response curve Golden. The calculation formula is: Golden_FR1=Golden-FR_Curve1.
[0126] Step S202: Calculate the first calibration filter parameters based on the first amplitude-frequency characteristic curve.
[0127] Based on the first amplitude-frequency response curve, the first calibration filter parameters of the headphone under test are calculated.
[0128] Further, in one feasible embodiment, step S202 includes:
[0129] Step B10: Based on a preset extreme value range, determine the absolute values of each extreme value on the first amplitude-frequency characteristic curve that are not within the preset extreme value range;
[0130] Based on the preset extreme value range of the amplitude-frequency response curve, determine the extreme values of the first amplitude-frequency response curve that are not within the preset extreme value range, and calculate the absolute value of each extreme value.
[0131] In one feasible implementation, the preset extreme value range of the amplitude-frequency response curve is the range of the difference between the frequency response curve and the target curve or the extreme value range of the amplitude-frequency response curve. When the range of the difference or the extreme value range of the amplitude-frequency response curve is within the preset extreme value range, it is determined that the headphone under test has been calibrated and does not need to be recalibrated. When the range of the difference or the extreme value range of the amplitude-frequency response curve exceeds the preset extreme value range, the absolute value of each extreme value of the amplitude-frequency response curve is calculated.
[0132] Step B20: Determine the extreme value corresponding to the largest absolute value among all absolute values as the target extreme value, and calculate the first calibration filter parameter based on the target extreme value.
[0133] The extreme value corresponding to the largest absolute value among all absolute values is determined as the target extreme value. Based on the coordinates of the target extreme value on the first amplitude-frequency response curve, the first calibration filter parameter is calculated.
[0134] In one feasible implementation, the main control computer calculates each extreme value in the first amplitude frequency response curve Golden_FR1, determines each extreme value within the preset extreme value range according to the preset extreme value range, sorts each extreme value within the preset extreme value range in descending order of absolute value, and selects the first extreme value as the target extreme value.
[0135] Furthermore, in a feasible embodiment, step B20, "calculating the first calibration filter parameter based on the target extreme value," includes:
[0136] Step B201: Take the frequency point where the target extreme value is located as the center frequency of the filter;
[0137] The frequency point corresponding to the coordinates of the target extremum on the first amplitude-frequency response curve is determined as the center frequency of the current calibration filter.
[0138] In one feasible implementation, the x-coordinate of the target extremum on the first amplitude-frequency characteristic curve is a frequency value, and this frequency value is used as the center frequency of the current calibration filter.
[0139] Step B202: Use the magnitude of the target extremum as the filter magnitude;
[0140] The amplitude corresponding to the target extremum is used as the filter amplitude of the current calibration filter.
[0141] Step B203: Multiply the largest absolute value by the preset percentage to obtain the target value, and take the frequency point corresponding to the absolute value that differs the least from the target value as the filter bandwidth.
[0142] Multiply the absolute value closest to the largest among the absolute values of each extreme value in the first amplitude frequency response curve by the preset proportion to obtain the target value. Determine the absolute value that is the smallest difference from the target value among the absolute values of each extreme value in the first amplitude frequency response curve, and take the frequency point of the extreme value corresponding to the target value as the bandwidth of the current calibration filter.
[0143] In one feasible implementation, the target value is obtained by multiplying the absolute value of the nearest maximum among the absolute values of each extreme value in the first amplitude frequency response curve by 70%. The coordinate point on the first amplitude frequency response curve that is closest to the extreme value corresponding to the target value is found, and the abscissa frequency corresponding to this coordinate point is determined as the bandwidth of the current calibration filter.
[0144] It should be noted that, in this invention, the frequency corresponding to the coordinate point of the target extreme value (√2) on the amplitude-frequency characteristic curve is used as the bandwidth of the filter to be calculated, so as to calculate the quality factor of the filter in the subsequent calculation.
[0145] Step B204: Calculate the filter quality factor based on the filter center frequency and the filter bandwidth;
[0146] Based on the determined filter center frequency and filter bandwidth, the filter quality factor is calculated.
[0147] Step B205: Use the filter center frequency, the filter amplitude, and the filter quality factor as the first calibration filter parameters.
[0148] The above filter center frequency, filter amplitude, and filter quality factor are used as the first calibration filter parameters for the current calibration filter.
[0149] In this embodiment, the speaker calibration method for the headphones of the present invention determines a first amplitude-frequency response curve based on the difference between a first frequency response curve and a standard frequency response curve; based on a preset extreme value range of the amplitude-frequency response curve, it determines each extreme value of the first amplitude-frequency response curve that is not within the preset extreme value range, and calculates the absolute value of each extreme value; it determines the extreme value corresponding to the largest absolute value among all absolute values as the target extreme value, and calculates the first calibration filter parameter based on the target extreme value; it determines the frequency point corresponding to the coordinates of the target extreme value on the first amplitude-frequency response curve as the center frequency of the current calibration filter, and calculates the first calibration filter parameter corresponding to the target extreme value. The amplitude is used as the filter amplitude of the current calibration filter. The target value is obtained by multiplying the absolute value of the nearest maximum value among the absolute values of each extreme value in the first amplitude-frequency response curve with a preset ratio. The absolute value of the extreme value in the first amplitude-frequency response curve that is the smallest difference from the target value is determined. The frequency point of the extreme value corresponding to the absolute value is used as the bandwidth of the current calibration filter. Based on the filter center frequency and filter bandwidth determined above, the quality factor of the filter is calculated. The filter center frequency, filter amplitude, and filter quality factor are used as the first calibration filter parameters of the current calibration filter.
[0150] Thus, by setting a range of difference between a frequency response curve and a standard frequency response curve, a target extreme value is determined on the amplitude-frequency characteristic curve, and the calibration filter parameters of the calibration filter are calculated using the coordinate information of the target extreme value, thereby realizing the theoretical correction of the frequency response curve using the calibration filter parameters.
[0151] Furthermore, based on the first and / or second and / or third embodiments of the speaker calibration method for headphones of the present invention described above, a fourth embodiment of the speaker calibration method for headphones of the present invention is proposed.
[0152] In this embodiment, after step S30, the speaker calibration method for the headphones of the present invention further includes:
[0153] Step C10: Calculate the third frequency response curve based on the filtered sound signal played by the earphone under test.
[0154] Based on the filtered sound signal (hereinafter referred to as the filtered sound signal for distinction) played by the headphone under test and recorded by a standard microphone, the frequency response curve corresponding to the filtered sound signal (hereinafter referred to as the third frequency response curve for distinction) is calculated.
[0155] In one feasible implementation, after calibrating the headphone under test based on the calibration filter parameters, a sinusoidal sweep signal is sent again through the Bluetooth adapter and played through the speaker of the headphone under test. Then, the filtered sound signal emitted by the headphone under test is recorded through the standard microphone. The standard microphone sends the recorded filtered sound signal to the test amplifier. The test amplifier converts the filtered sound signal into a corresponding digital signal and sends the digital signal to the sound card of the industrial control computer. Then, the industrial control computer performs a Fourier transform on the new digital signal to obtain the third frequency response curve.
[0156] Step C20: Determine the second amplitude frequency response curve based on the difference between the third frequency response curve and the standard frequency response curve;
[0157] Based on the difference between the third frequency response curve and the standard frequency response curve, a new amplitude-frequency characteristic curve is determined (hereinafter referred to as the second amplitude-frequency characteristic curve for distinction).
[0158] Step C30: When all extreme values of the second amplitude-frequency characteristic curve are within the preset extreme value range, the calibration result is determined to be successful.
[0159] When all extreme values of the third amplitude frequency response curve are within the preset extreme value range, the SPK calibration result of the headphone under test is determined to be a successful calibration.
[0160] In one feasible implementation, the extreme values of the third amplitude frequency response curve are calculated by an industrial control computer. If all extreme values are within the preset extreme value range, it is determined that the headphone SPK under test has been calibrated, and the calibration result is that the calibration is successful.
[0161] In one feasible implementation, such as Figure 6 As shown, the SPK calibration process for the earphone under test is as follows: First, a Bluetooth connection is established between the earphone under test and the product under test via a Bluetooth adapter. Then, a sinusoidal sweep signal is played through the Bluetooth adapter. The earphone under test plays a test signal according to the sinusoidal sweep signal. The artificial ear (standard microphone) collects the test signal. Then, the main control computer performs frequency response analysis on the test signal to obtain the frequency response curve FR_Curve1. Based on the frequency response curve and the target curve Golden, the amplitude frequency response curve Golden_FR is determined. The extreme value of the amplitude frequency response curve Golden_FR is calculated, and the filter parameters are calculated based on the extreme value. Then, the parameters are written into the product register to calibrate the SPK of the earphone under test. Then, a second test is performed on the earphone under test. The calibration result is judged based on the result of the second test, and the calibration result is displayed and saved.
[0162] In this embodiment, the speaker calibration method of the present invention calculates the third frequency response curve corresponding to the filtered sound signal played by the earphone under test by the standard microphone; determines a new second amplitude frequency response curve based on the difference between the third frequency response curve and the standard frequency response curve; and determines the SPK calibration result of the earphone under test as successful when all extreme values of the third amplitude frequency response curve are within the preset extreme value range.
[0163] In this way, by conducting a second test on the calibrated earphone, the accuracy of the calibration results of the earphone is ensured, and the SPK of the earphone can be recalibrated in a timely manner if the earphone fails to be calibrated.
[0164] Furthermore, embodiments of the present invention also provide a speaker calibration device for headphones.
[0165] Please refer to Figure 7 , Figure 7 This is a functional module diagram of an embodiment of the speaker calibration device for headphones of the present invention, as shown below. Figure 7 As shown, the speaker calibration device for the headphones of the present invention includes:
[0166] The first frequency response curve module 10 is used to calculate the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test;
[0167] The first calibration filter parameter module 20 is used to calculate the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve.
[0168] The calibration module 30 is used to write the calculated first calibration filter parameters into the earphone under test, so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters.
[0169] Furthermore, the speaker calibration device for the headphones of the present invention further includes:
[0170] The theoretical correction module is used to take the first frequency response curve as the target frequency response curve, the first calibration filter parameter as the target calibration filter parameter, and correct the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve;
[0171] The judgment module is used to determine whether the preset filtering loop termination condition has been met;
[0172] The loop termination module is used to terminate the filtering loop if the condition is met.
[0173] The filtering loop module is used to, if not, calculate a second calibration filter parameter based on the difference between the corrected frequency response curve and the standard frequency response curve, use the corrected frequency response curve as the target frequency response curve, use the second calibration filter parameter as the target calibration filter parameter, and return to execute the step of correcting the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve;
[0174] The parameter writing module is used to write the second calibration filtering parameters calculated in each round of filtering loop into the headphone under test, so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filtering parameters.
[0175] Furthermore, the first calibration filter parameter module 20 includes:
[0176] The first amplitude frequency response curve unit is used to determine the first amplitude frequency response curve based on the difference between the first frequency response curve and the standard frequency response curve;
[0177] The first calibration filter parameter unit is used to calculate the first calibration filter parameters based on the first amplitude-frequency response curve.
[0178] Furthermore, the first calibration filter parameter unit is also used to determine the absolute value of each extreme value on the first amplitude-frequency characteristic curve that is not within the preset extreme value range based on the preset extreme value range; determine the extreme value corresponding to the largest absolute value among the absolute values as the target extreme value; and calculate the first calibration filter parameter based on the target extreme value.
[0179] Furthermore, the first calibration filter parameter unit is also used to take the frequency point where the target extreme value is located as the filter center frequency; take the amplitude of the target extreme value as the filter amplitude; multiply the largest absolute value by a preset percentage to obtain the target value, and take the frequency point corresponding to the absolute value that differs the least from the target value as the filter bandwidth; calculate the filter quality factor based on the filter center frequency and the filter bandwidth; and take the filter center frequency, the filter amplitude, and the filter quality factor as the first calibration filter parameters.
[0180] Furthermore, the speaker calibration device for the headphones of the present invention further includes:
[0181] The third frequency response curve module is used to calculate the third frequency response curve based on the filtered sound signal played by the earphone under test.
[0182] The second amplitude frequency response curve module is used to determine the second amplitude frequency response curve based on the difference between the third frequency response curve and the standard frequency response curve;
[0183] The calibration success module is used to determine the calibration result as successful when all extreme values of the second amplitude frequency characteristic curve are within the preset extreme value range.
[0184] Furthermore, the first frequency response curve module 10 is also used to convert the recorded sound signal played by the speaker of the headphone under test into a digital signal, and to perform a Fourier transform on the digital signal to obtain the first frequency response curve.
[0185] The present invention also provides a computer storage medium storing a speaker calibration program for headphones, wherein when the speaker calibration program for headphones is executed by a processor, the speaker calibration program for headphones as described in any of the above embodiments implements the steps of the speaker calibration program method for headphones.
[0186] The specific embodiments of the computer storage medium of the present invention are basically the same as the embodiments of the speaker calibration procedure method of the headphones of the present invention described above, and will not be repeated here.
[0187] The present invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the speaker calibration method for the headphones of the present invention as described in any of the above embodiments, which will not be elaborated here.
[0188] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0189] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0190] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (such as TWS earphones, etc.) to execute the methods described in the various embodiments of the present invention.
[0191] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for calibrating the speaker of an earphone, characterized in that, The speaker calibration method for the headphones includes the following steps: Calculate the first frequency response curve based on the sound signal played by the speaker of the headphone under test; The first calibration filter parameters are calculated based on the difference between the first frequency response curve and the standard frequency response curve. The calculated first calibration filter parameters are written into the earphone under test so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters; The step of calculating the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve includes: The first amplitude frequency response curve is determined based on the difference between the first frequency response curve and the standard frequency response curve; Based on a preset extreme value range, the absolute values of each extreme value on the first amplitude-frequency response curve that are not within the preset extreme value range are determined; wherein, the preset extreme value range is a preset range in which the difference between the corrected frequency response curve that meets the calibration requirements and the standard frequency response curve is located, and the corrected frequency response curve is a frequency response curve obtained by correcting the target frequency response curve based on the target calibration filter parameters; The extreme value corresponding to the largest absolute value among all absolute values is determined as the target extreme value; The frequency point where the target extremum is located is taken as the center frequency of the filter; The magnitude of the target extremum is used as the filter magnitude; The target value is obtained by multiplying the largest absolute value by the preset percentage, and the frequency point corresponding to the absolute value that differs the least from the target value is taken as the filter bandwidth. Calculate the filter quality factor based on the filter center frequency and the filter bandwidth; The filter center frequency, the filter amplitude, and the filter quality factor are used as the first calibration filter parameters; After the step of filtering the sound signal to be played by the speaker based on the first calibration filtering parameters by the earphone under test, the method further includes: The third frequency response curve is calculated based on the filtered sound signal played by the earphone under test. The second amplitude frequency response curve is determined based on the difference between the third frequency response curve and the standard frequency response curve; When all extreme values of the second amplitude-frequency response curve are within the preset extreme value range, the calibration result is determined to be successful.
2. The speaker calibration method for headphones as described in claim 1, characterized in that, After the step of calculating the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve, the method further includes: The first frequency response curve is used as the target frequency response curve, and the first calibration filter parameter is used as the target calibration filter parameter. The target frequency response curve is corrected based on the target calibration filter parameter to obtain the corrected frequency response curve. Determine whether the preset filter loop termination condition has been met; If so, then end the filtering loop; If not, then based on the difference between the corrected frequency response curve and the standard frequency response curve, calculate the second calibration filter parameter, use the corrected frequency response curve as the target frequency response curve, use the second calibration filter parameter as the target calibration filter parameter, and return to execute the step of correcting the target frequency response curve based on the target calibration filter parameter to obtain the corrected frequency response curve; The second calibration filter parameters calculated in each filtering cycle are written into the headphone under test so that the headphone under test can filter the sound signal to be played by the speaker based on the second calibration filter parameters.
3. The speaker calibration method for headphones as described in any one of claims 1 to 2, characterized in that, The step of calculating the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test includes: The recorded sound signal played by the speaker of the headphone under test is converted into a digital signal, and the digital signal is subjected to Fourier transform to obtain the first frequency response curve.
4. A speaker calibration device for headphones, characterized in that, The speaker calibration device for the headphones includes: The first frequency response curve module is used to calculate the first frequency response curve based on the recorded sound signal played by the speaker of the headphone under test; The first calibration filter parameter module is used to: calculate the first calibration filter parameter based on the difference between the first frequency response curve and the standard frequency response curve; determine the first amplitude-frequency characteristic curve based on the difference between the first frequency response curve and the standard frequency response curve; determine the absolute values of each extreme value on the first amplitude-frequency characteristic curve that is not within the preset extreme value range based on a preset extreme value range; wherein, the preset extreme value range is a preset range in which the difference between the corrected frequency response curve that meets the calibration requirements and the standard frequency response curve is located, and the corrected frequency response curve is a frequency response curve obtained by correcting the target frequency response curve based on the target calibration filter parameter; determine the extreme value corresponding to the largest absolute value among all absolute values as the target extreme value; take the frequency point where the target extreme value is located as the filter center frequency; take the amplitude of the target extreme value as the filter amplitude; multiply the largest absolute value by a preset percentage to obtain the target value, and take the frequency point corresponding to the absolute value that differs the least from the target value among all absolute values as the filter bandwidth; calculate the filter quality factor based on the filter center frequency and the filter bandwidth; and take the filter center frequency, the filter amplitude, and the filter quality factor as the first calibration filter parameter. The calibration module is used to write the calculated first calibration filter parameters into the earphone under test, so that the earphone under test can filter the sound signal to be played by the speaker based on the first calibration filter parameters; The third frequency response curve module is used to calculate the third frequency response curve based on the filtered sound signal played by the earphone under test. The second amplitude frequency response curve module is used to determine the second amplitude frequency response curve based on the difference between the third frequency response curve and the standard frequency response curve; The calibration success module is used to determine the calibration result as successful when all extreme values of the second amplitude frequency characteristic curve are within the preset extreme value range.
5. A terminal device, characterized in that, The terminal device includes: a memory, a processor, and a speaker calibration program for headphones stored in the memory and executable on the processor. When the speaker calibration program for headphones is executed by the processor, it implements the steps of the speaker calibration method for headphones as described in any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a speaker calibration program for headphones, which, when executed by a processor, implements the steps of the speaker calibration method for headphones as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Calibration method, device and equipment for sound quality effect of earphone and storage medium
CN114760567A
Filter calibration method and device based on earphone loudspeaker frequency response
CN115604628A
