A closed-loop adaptive compensation method for loudspeaker production line calibration
By using a closed-loop adaptive compensation method, the problems of low-reliability frequency misdrive, local overtuning, and multi-channel discrepancies in loudspeaker production line calibration were solved, resulting in improved frequency response flatness and faster convergence speed, and enhanced stability of compensation parameters.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU ACOUSTIC IND TECH RES INST CO LTD
- Filing Date
- 2026-04-14
- Publication Date
- 2026-07-03
Smart Images

Figure CN122054064B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of testing equipment technology, and in particular to a closed-loop adaptive compensation method for loudspeaker production line calibration. Background Technology
[0002] In the mass production of miniature loudspeakers, frequency response calibration is typically performed on the production line. The common process on existing production lines is as follows: first, a standard test signal is played on a host computer; then, the microphone captures the loudspeaker output; next, external software is used to analyze the frequency response curve offline; engineers manually calculate equalization parameters or re-export FIR filter coefficients; and finally, the parameters are loaded back onto the DSP for retesting. This process is usable for single-channel, small-batch operations, but in multi-channel parallel calibration and mass production scenarios, it exposes problems such as discrete analysis steps, slow parameter write-back, disconnect between testing and parameter tuning, frequent popping noises during switching, and strong reliance on manual experience.
[0003] Furthermore, in actual sampling, several frequency points often appear that do not accurately reflect the speaker's inherent deviation. These include frequencies below the noise floor, abnormal frequencies caused by clipping distortion, frequencies amplified by local resonance in the coupling cavity, and frequencies with poor input-output linearity. If these frequencies are still treated with equal weight to other frequencies and the compensation curve is updated directly using the error vector, problems such as local overcompensation, sawtooth frequency response, convergence oscillation, and inconsistent results across channels can easily occur.
[0004] In addition, multi-channel production lines also require each channel to converge within a similar time frame and maintain the consistency of the compensation curve. Each test channel in a multi-channel production line typically corresponds to a miniature speaker under test. If the error is frozen based solely on a single root mean square error threshold, a false convergence phenomenon may occur where the error reaches the target in a short time but the compensation coefficient has not yet stabilized.
[0005] Therefore, low-reliability frequency misdrive, local overtuning, multi-channel discrepancies, and false convergence have become urgent technical problems to be solved in mass production calibration scenarios. Summary of the Invention
[0006] This invention provides a closed-loop adaptive compensation method for loudspeaker production line calibration, which solves the technical problems of low-confidence frequency misdrive, local overtuning, multi-channel discrepancy and false convergence in mass production calibration scenarios.
[0007] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0008] A closed-loop adaptive compensation method for loudspeaker production line calibration includes the following steps:
[0009] Step S1: Obtain the closed-loop calibration task, which includes the channel task table and target frequency response template corresponding to the current batch of samples of the loudspeaker under test. The parameters include the effective frequency band range, weighting parameters, threshold parameters, calibration parameters, and initialization buffer. The weighting parameters include the frequency band weighting coefficient w(i), the threshold parameters include the root mean square error threshold Eth, the error improvement slope threshold δE, and the coefficient drift threshold δh, and the calibration parameters include the FIR coefficients. Envelope compensation component Residual compensation component and compensation curve The initialization of the cache includes buffer A and buffer B;
[0010] Step S2: Obtain the re-sampled audio frames [n] contains the temporal state information, which includes the sampling rate fs, the number of points per frame N, the noise floor estimate, and the clipping state flag.
[0011] Step S3: Calculate and obtain the signal-to-noise ratio and coherence coefficient Generate a valid mask Calculate the frequency point confidence coefficient ;
[0012] Step S4: Calculate the actual frequency response vector and weighted error ;
[0013] Step S5: Obtain the envelope error Obtain residual error Update step size based on envelope components Obtain the updated envelope compensation component Update step size based on residual components Obtain the updated residual compensation components ;
[0014] Step S6: Apply second-order differential smoothing constraints and channel consistency constraints to adjacent frequency points to obtain the constrained compensation curve. Obtain the backup FIR coefficient set ;
[0015] Step S7: Based on the backup FIR coefficient set Obtain the FIR coefficient set that will take effect in the next round. ;
[0016] Step S8: Calculate the root mean square error of the current round. FIR coefficient drift between adjacent rounds If the root mean square error of the current round is satisfied simultaneously Less than the root mean square error threshold Eth, | - |<Error Improvement Slope Threshold δE, Two-Round FIR Coefficient Drift If the coefficient drift threshold δh is less than the threshold and the current channel has been continuously maintained for P rounds, then the current channel is considered to have reached stable convergence. The current FIR coefficients are then frozen to obtain the final compensation parameters.
[0017] A further technical solution is as follows: In step S1, when the industrial control computer obtains the product model and target frequency response template of the current batch of samples of the loudspeaker under test... Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations After setting the root mean square error threshold Eth, the error improvement slope threshold δE, the coefficient drift threshold δh, and the number of consecutive stability judgment rounds P, the industrial control computer loads the corresponding target frequency response template according to the product model. The system generates a task configuration package based on the effective frequency band range and calibration parameters, and sends it to the DSP main processing module. The task configuration package includes the product model and the target frequency response template. Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations The parameters include: root mean square error threshold Eth, error improvement slope threshold δE, coefficient drift threshold δh, number of consecutive stabilization rounds P, effective frequency band range, and calibration parameters, including FIR coefficients. After receiving the task configuration packet, the DSP main processing module processes the envelope compensation component. Residual compensation component Compensation curve The dual buffers A and B are initialized to form a closed-loop calibration task.
[0018] A further technical solution is that, in step S2, when the initial round m=0, the DSP main processing module will process the FIR coefficients. Set to pass-through or preset initial coefficients; the DSP main processing module processes the test audio frames. [n] The filtered signal is sent to the DAC module, which then amplifies it to drive the speaker under test. The microphone acquisition module collects the sound output from the speaker under test, which is then converted into a sampled audio frame by the ADC module. [n] and return to the DSP main processing module, which then obtains the re-sampled audio frame. [n], based on the sampling rate fs and the number of points per frame N, for each sampled audio frame. [n] performs real-time analysis, obtains the noise floor estimate through the minimum recursive averaging algorithm, obtains the clipping state flag through full-amplitude ratio detection and harmonic analysis, and finally outputs complete time-series state information.
[0019] A further technical solution is that, in step S3, the DSP main processing module processes the test audio frames respectively. [n] and the captured audio frame [n] Performs frame segmentation, windowing, and frequency domain transformation to calculate and obtain the test audio frame. Input power spectrum of [n] and re-acquiring audio frames Output power spectrum of [n] and mutual spectrum Based on output power spectrum The signal-to-noise ratio is obtained by calculating the noise floor estimate. The coherence coefficient is calculated based on equation (2). Based on signal-to-noise ratio Coherence coefficient Generate an effective mask from the effective frequency band range. The frequency confidence coefficient is calculated based on equation (3). .
[0020] A further technical solution is that, in step S4, the DSP main processing module calculates the actual frequency response vector based on equation (1). The weighted error is calculated based on equation (4). .
[0021] A further technical solution is that, in step S5, the DSP main processing module processes the weighted error. Cross-frequency smoothing is performed to obtain the envelope error characterizing the gradually varying trend. Using weighted error Subtract envelope error Obtaining residual error Based on envelope compensation components Envelope component update step size Envelope error The updated envelope compensation component is obtained by calculating equation (7). Based on residual compensation components Residual component update step size residual error Residual single-wheel amplitude limiting The updated residual compensation components are calculated using equation (8). .
[0022] A further technical solution is that, in step S6, the DSP main processing module, based on the updated envelope compensation components... Updated residual compensation components Current compensation curve Multi-channel average compensation curve Equation (9) is used to apply second-order differential smoothing constraints and channel consistency constraints to adjacent frequency points to obtain the constrained compensation curve. When using the real-coefficient linear-phase FIR implementation, a conjugate symmetric spectrum is constructed according to the target compensation curve, and the backup FIR coefficient set is obtained through inverse transformation and window function processing. .
[0023] A further technical solution is that, in step S7, the DSP main processing module will set up the backup FIR coefficient set. The data is written to the backup buffer without directly overwriting the currently active coefficients. Near audio frame boundaries or predetermined zero-crossing points, the double-buffering management logic switches the backup buffer to the current buffer, thus making the new compensation coefficients effective and obtaining the next set of effective FIR coefficients. .
[0024] A further technical solution is that, in step S8, the DSP main processing module bases the weighted error... Number of effective frequency points The root mean square error of the current round is calculated using equation (10). The drift of the FIR coefficients between two adjacent rounds is calculated based on the FIR coefficients of the two adjacent rounds and Equation (11). If the root mean square error of the current round is satisfied simultaneously Less than the root mean square error threshold Eth, | - |<Error Improvement Slope Threshold δE, Two-Round FIR Coefficient Drift If the coefficient drift threshold δh is less than the threshold value and remains constant for P iterations, then the current channel is considered to have reached stable convergence. The current FIR coefficients are then frozen, and the final compensation parameters, error statistics, version number, and frequency response comparison results are obtained. Otherwise, if the iteration number m is less than the maximum number of iterations... When the maximum number of iterations is exceeded, proceed to the next update round; If the conditions are still not met, the channel is marked as an abnormal part or a re-inspection part; the DSP main processing module uploads the final compensation parameters, error statistics, version number and frequency response comparison results to the industrial control computer.
[0025] The beneficial effects of adopting the above technical solution are as follows:
[0026] A closed-loop adaptive compensation method for loudspeaker production line calibration includes steps S1 to S8. Through effective frequency point screening, confidence-weighted error construction, envelope and residual dual-component compensation update, and compensation reconstruction, it achieves good technical results in low-confidence frequency point suppression, frequency response flatness improvement, convergence speed enhancement, and freeze stability enhancement. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of the implementation platform of the present invention;
[0028] Figure 2This is a flowchart of the closed-loop adaptive compensation method of the present invention;
[0029] Figure 3 This is a data flow diagram of the present invention;
[0030] Figure 4 This is a distribution diagram of the algorithm improvement points of this invention;
[0031] Figure 5 Comparison chart showing improvements in prototype flatness;
[0032] Figure 6 This is a comparison curve of prototype error convergence. Detailed Implementation
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit this application or its application or use. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0034] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.
[0035] like Figure 1 and Figure 2 As shown, the present invention discloses a closed-loop adaptive compensation method for loudspeaker production line calibration, which implements steps S1 to S8 based on a platform, as detailed below.
[0036] like Figure 1As shown, the platform includes an industrial control computer 101, a USB audio interface module 102, a DSP main processing module 103, a DAC module 104, a power amplifier module 105, a speaker under test 106, a microphone module 107, and an ADC module 108. The power amplifier module 105 is the power amplifier, and the speaker under test 106 is the miniature speaker under test. The industrial control computer 101 is electrically connected to the USB audio interface module 102 and communicates bidirectionally. The USB audio interface module 102 is electrically connected to the DSP main processing module 103 and communicates bidirectionally. The DSP main processing module 103 is connected to the DAC module 104 and the ADC module 105. AC module 104 is electrically connected and communicates unidirectionally. DAC module 104 is electrically connected and communicates unidirectionally with power amplifier module 105. Power amplifier module 105 is electrically connected and communicates unidirectionally with the speaker under test 106. Acquisition microphone module 107 is electrically connected and communicates unidirectionally with ADC module 108. ADC module 108 is electrically connected and communicates unidirectionally with DSP main processing module 103. DSP main processing module 103, DAC module 104, power amplifier module 105, speaker under test 106, acquisition microphone module 107, and ADC module 108 form the main device.
[0037] The USB audio interface module 102 is model XMOSXUF216-512-TQ128, the DSP main processing module 103 is model ADSP-21593, the DAC module 104 is model CS4302P, the power amplifier module 105 is model TPA3221, and the ADC module 108 is model CS5368. For the component composition, please refer to Table 1.
[0038] Table 1: Components and Connection Relationships of the Implementation Platform
[0039]
[0040] Location and Coordination Description: The industrial control computer 101 is the host computer and is located outside the main equipment. The USB audio interface module 102, DSP main processing module 103, DAC module 104, power amplifier module 105, and ADC module 108 are arranged inside the main equipment. The speaker under test 106 is installed in the test fixture or semi-anechoic coupling cavity. The acquisition microphone module 107 is arranged opposite to the speaker under test 106 and is used to collect sound output. The DSP main processing module 103 is located in the data and control logic center of the entire platform and is responsible for completing the core calculation steps of this application. The main signal link of the platform is industrial control computer 101 → USB audio interface module 102 → DSP main processing module 103 → DAC module 104 → power amplifier module 105 → speaker under test 106. The closed-loop acquisition link is speaker under test 106 → acquisition microphone module 107 → ADC module 108 → DSP main processing module 103.
[0041] like Figure 2As shown, the closed-loop adaptive compensation method for loudspeaker production line calibration includes steps S1 to S8. Before explaining steps S1 to S8, the technical parameters used will be explained to facilitate understanding of subsequent steps. The data format and parameter definitions are explained below.
[0042] Table 2: Data Format Definition Table
[0043]
[0044] Table 3: Parameter Definitions and Typical Values
[0045]
[0046] Table 4: Correspondence Table of Inputs, Processing, and Outputs for Key Steps
[0047]
[0048] like Figure 3 Tables 2, 3, and 4 illustrate the forms of input data, intermediate processing data, and output data in this application, and provide the mapping relationships for key steps. Through these definitions, subsequent algorithm steps can be directly mapped to computable data objects and executable processing logic.
[0049] like Figure 2 As shown, the complete calculation and processing steps include: step S1 task initialization and template loading, step S2 continuous excitation playback and synchronous retrieval, step S3 effective frequency point screening and confidence coefficient generation, step S4 actual frequency response calculation and confidence weighted error construction, step S5 envelope and residual dual-component compensation update, step S6 compensation reconstruction of smoothing constraints and channel consistency constraints, step S7 double-buffer hot switching, and step S8 multi-factor freeze determination and result output, which are detailed below.
[0050] Step S1: Task initialization and template loading.
[0051] When the industrial control computer 101 obtains the product model and target frequency response template of the current batch of samples of the speaker under test... Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations After setting the root mean square error threshold Eth, the error improvement slope threshold δE, the coefficient drift threshold δh, and the number of consecutive stability judgment rounds P, the industrial control computer 101 loads the corresponding target frequency response template according to the product model. The system generates a task configuration package based on the effective frequency band range and calibration parameters, and sends it to the DSP main processing module 103. The task configuration package includes the product model and the target frequency response template. Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations The parameters include: root mean square error threshold Eth, error improvement slope threshold δE, coefficient drift threshold δh, number of consecutive stabilization rounds P, effective frequency band range, and calibration parameters, including FIR coefficients. After receiving the task configuration packet, the DSP main processing module 103 processes the envelope compensation component. Abbreviation Genv, residual compensation component Abbreviation Gres, compensation curve The system initializes dual buffers A and B to form a closed-loop calibration task. The closed-loop calibration task includes the channel task table corresponding to the current batch of prototypes of the loudspeaker under test and the target frequency response template. The parameters include the effective frequency band range, weighting parameters, threshold parameters, calibration parameters, and initialization buffer. The weighting parameters include the frequency band weighting coefficient w(i), the threshold parameters include the root mean square error threshold Eth, the error improvement slope threshold δE, and the coefficient drift threshold δh, and the calibration parameters include the FIR coefficients. Envelope compensation component Abbreviation Genv, residual compensation component Abbreviation Gres and compensation curve The initialization of the cache includes buffer A and buffer B, as detailed below.
[0052] Input: Product model, target frequency response template Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations The parameters are: root mean square error threshold Eth, error improvement slope threshold δE, coefficient drift threshold δh, and continuous stability evaluation round P. The product model is the model of the current batch of sample of the loudspeaker under test.
[0053] Processing: Industrial PC 101 loads the corresponding target frequency response template based on the product model. The effective frequency band range and calibration parameters are used to generate a task configuration package. This package is then sent via USB to the USB audio interface module 102, which in turn writes it to the DSP main processing module 103 using TDM and control words. The DSP main processing module 103 processes the envelope compensation component Genv, the residual compensation component Gres, and the compensation curve. The dual buffers A and B are initialized to form an executable closed-loop calibration task.
[0054] Output: The closed-loop calibration task includes the channel task table corresponding to the current batch of prototypes of the loudspeaker under test and the target frequency response template. The parameters include weight parameters, threshold parameters, and initialization buffer. The weight parameters include the frequency band weight coefficient w(i), and the threshold parameters include the root mean square error threshold Eth, the error improvement slope threshold δE, and the coefficient drift threshold δh.
[0055] Step S2: Continuous excitation playback and synchronous re-acquisition.
[0056] In the initial round m=0, the DSP main processing module 103 will set the FIR coefficients. Set to pass-through or preset initial coefficients; DSP main processing module 103 processes test audio frames. The [n] signal is filtered and sent to the DAC module 104, then amplified by the power amplifier module 105 to drive the speaker under test 106 to produce sound. The microphone acquisition module 107 acquires the sound output of the speaker under test 106, which is then converted into a back-collected audio frame by the ADC module 108. [n] and return to the DSP main processing module 103, where the DSP main processing module 103 obtains the re-acquired audio frame. [n], based on the sampling rate fs and the number of points per frame N, for each sampled audio frame. [n] performs real-time analysis, obtains the noise floor estimate through the minimum recursive averaging algorithm, obtains the clipping status flag through full-amplitude ratio detection and harmonic analysis, and finally outputs complete time-series status information, including sampling rate fs, number of points per frame N, noise floor estimate and clipping status flag, as detailed below.
[0057] Input: Test audio frame [n], Current effective FIR coefficient And the channel task table.
[0058] Processing: In the initial round m=0, the DSP main processing module 103 will process the FIR coefficients. Set to pass-through or preset initial coefficients; DSP main processing module 103 processes test audio frames. [n] The filter is executed and output to the DAC module 104, which then drives the speaker under test 106 to produce sound via the power amplifier module 105; the sound output is collected by the microphone acquisition module 107 and converted into audio frames by the ADC module 108. [n] and return to the DSP main processing module 103. In a preferred embodiment, multiple consecutive frames can be averaged within the same round to suppress random noise and improve the stability of subsequent confidence estimation.
[0059] Output: Multi-channel test audio frames for the current round [n], audio frame re-sampling [n] and the corresponding timing state information.
[0060] Step S3: Valid frequency point screening and confidence coefficient generation.
[0061] The DSP main processing module 103 processes the test audio frames respectively. [n] and the captured audio frame [n] Performs frame segmentation, windowing, and frequency domain transformation to calculate and obtain the test audio frame. Input power spectrum of [n] and re-acquiring audio frames Output power spectrum of [n] and mutual spectrum Input power spectrum Abbreviation Sxx, output power spectrum Abbreviation Syy, Mutual Spectrum Abbreviated as Sxy, based on the output power spectrum The signal-to-noise ratio is obtained by calculating the noise floor estimate. The coherence coefficient is calculated based on equation (2). Based on signal-to-noise ratio Coherence coefficient Generate an effective mask from the effective frequency band range. The frequency confidence coefficient is calculated based on equation (3). The details are as follows.
[0062] Input: Test audio frame [n], audio frame re-sampling [n], sampling rate fs, number of points per frame N, noise floor estimate, clipping status flag.
[0063] Processing: The DSP main processing module 103 performs frame segmentation, windowing, and frequency domain transformation on the input and re-sampled data, and calculates the power spectrum Sxx, Syy, and cross spectrum Sxy; then, based on whether the re-sampled amplitude is higher than the noise floor, whether clipping exists, whether the frequency point is in the effective frequency band, and the degree of input-output coherence, it generates an effective mask. Coherence coefficient and signal-to-noise ratio And based on this, calculate the frequency confidence coefficient. When the frequency meets the conditions =1, when the frequency point does not meet the validity condition. =0, therefore this frequency point does not drive subsequent error updates, signal-to-noise ratio The test spectrum is obtained to characterize the reliability of the effective retrieval signal at the i-th frequency point relative to the noise floor. (i) and the mining spectrum (i).
[0064] Output: Valid mask Coherence coefficient Signal-to-noise ratio and frequency confidence coefficient .
[0065] Step S4: Calculate the actual frequency response and construct the confidence weighted error.
[0066] The DSP main processing module 103 calculates the actual frequency response vector based on equation (1). The weighted error is calculated based on equation (4). The details are as follows.
[0067] Input: Target frequency response template Test spectrum (i) Acquisition Spectrum (i) Confidence coefficient Frequency band weighting coefficient w(i).
[0068] Processing: The DSP main processing module 103 first calculates the actual frequency response vector according to equation (1). Then, the target frequency response template is compared with the actual frequency response vector frequency by frequency, and the frequency confidence coefficients are combined. The frequency band weighting coefficient w(i) is used to construct the weighted error vector according to equation (4). For key frequency bands in voice processing or product-critical frequency bands, a larger w(i) can be used to increase the correction priority; for low-confidence frequency points, This would suppress or reset its update function.
[0069] Output: The actual frequency response vector for the current round. and weighted error .
[0070] Step S5: Update the envelope and residual dual-component compensation.
[0071] DSP main processing module 103 weighted error Cross-frequency smoothing is performed to obtain the envelope error characterizing the gradually varying trend. That is, the envelope error is calculated based on equation (5). Using weighted error Subtract envelope error Obtaining residual error That is, the residual error of local peaks and valleys is calculated based on equation (6). Based on envelope compensation components Envelope component update step size Envelope error The updated envelope compensation component is obtained by calculating equation (7). Based on residual compensation components Residual component update step size residual error Residual single-wheel amplitude limiting The updated residual compensation components are calculated using equation (8). The details are as follows.
[0072] Input: Weighted error Current envelope compensation component Current residual compensation components Envelope component update step size Residual component update step size Residual single-wheel amplitude limiting .
[0073] Processing: The DSP main processing module 103 first processes the weighted error. Cross-frequency smoothing is performed to obtain the envelope error characterizing the gradually varying trend. Then calculate the local peak-valley residual error according to formula (6). Subsequently, according to formula (7) with a larger step size Update envelope compensation components and according to formula (8) with a smaller step size Update residual compensation components Simultaneously, the residual increment is limited to prevent sharp abrupt changes in the compensation curve caused by local abnormal frequency points. Through this component separation update method, the overall frequency response profile can be corrected first, and then local peaks and valleys can be corrected.
[0074] Output: Envelope Error residual error Updated envelope compensation components and residual compensation components .
[0075] Step S6: Compensation and reconstruction of smoothing constraints and channel consistency constraints.
[0076] DSP main processing module 103 based on the updated envelope compensation component Updated residual compensation components Current compensation curve Multi-channel average compensation curve Equation (9) is used to apply second-order differential smoothing constraints and channel consistency constraints to adjacent frequency points to obtain the constrained compensation curve. When using the real-coefficient linear-phase FIR implementation, a conjugate symmetric spectrum is constructed according to the target compensation curve, and the backup FIR coefficient set is obtained through inverse transformation and window function processing. The details are as follows.
[0077] Input: Updated envelope compensation component Updated residual compensation components Current compensation curve Average compensation curve of multiple channels in the same round Constraint coefficient and .
[0078] Processing: The DSP main processing module 103 synthesizes Genv and Gres into candidate compensation curves, and introduces second-order differential smoothing constraints for adjacent frequency points according to equation (9). Channel consistency constraints The compensation curve after constraint is obtained Subsequently, when implementing the real-coefficient linear-phase FIR, a conjugate symmetric spectrum is constructed according to the target compensation curve, and the backup FIR coefficient set is obtained through inverse transformation and window function processing. In this embodiment, a Hamming window or a smooth window that matches the target product is preferably used to reduce the sidelobe effect.
[0079] Output: Constrained compensation curve and the backup FIR coefficient set .
[0080] Step S7: Double-buffered hot switching.
[0081] The DSP main processing module 103 will set up the backup FIR coefficient set. The data is written to the backup buffer without directly overwriting the currently active coefficients. Near audio frame boundaries or predetermined zero-crossing points, the double-buffering management logic switches the backup buffer to the current buffer, thus making the new compensation coefficients effective and obtaining the next set of effective FIR coefficients. The details are as follows.
[0082] Input: Current set of effective coefficients Reserve coefficient set And frame boundary timing signals.
[0083] Processing: DSP main processing module 103 will Write to the backup buffer without directly overwriting the currently effective coefficient; near the audio frame boundary or a predetermined zero crossover, the double buffer management logic switches the backup buffer to the current buffer, thereby making the new compensation coefficient effective.
[0084] Output: The set of FIR coefficients to be effective in the next round .
[0085] Step S8: Multi-factor freeze determination and result output.
[0086] DSP main processing module 103 based on weighted error Number of effective frequency points The root mean square error of the current round is calculated using equation (10). The drift of the FIR coefficients between two adjacent rounds is calculated based on the FIR coefficients of the two adjacent rounds and Equation (11). If the root mean square error of the current round is satisfied simultaneously... Less than the root mean square error threshold Eth, | - | < Error improvement slope threshold δE, two-round FIR coefficient drift < coefficient drift threshold δh and continuously maintain for P rounds, then it is determined that the current channel has converged stably, freeze the current FIR coefficient, and obtain the final compensation parameter, error statistic value, version number, and frequency response comparison result; otherwise, in iteration round m < maximum iteration number enter the next round of update. When the maximum iteration number is exceeded and the condition is still not met, mark this channel as an abnormal part or a re-inspection part. The DSP main processing module 103 uploads the final compensation parameter, error statistic value, version number, and frequency response comparison result to the industrial control computer 101, as detailed below.
[0087] Input: Error vector 、Current FIR coefficient 、FIR coefficient effective in the next round 、Root mean square error threshold Eth, error improvement slope threshold δE, coefficient drift threshold δh, continuous stability judgment rounds P, maximum iteration number .
[0088] Processing: The DSP main processing module 103 calculates the root mean square error of the current round according to Equation (10) , and calculates the drift of the FIR coefficients between adjacent two rounds according to Equation (11) . If both is less than Eth, | - | is less than δE, is less than δh and continuously maintain for P rounds, then it is determined that the current channel has converged stably, freeze the current FIR coefficient; otherwise, enter the next round of update when m < Mmax. When Mmax is exceeded and the condition is still not met, this channel can be marked as an abnormal part or a re-inspection part. Finally, the DSP main processing module 103 uploads the final compensation parameter, error statistic value, version number, and frequency response comparison result to the industrial control computer 101.
[0089] Output: Frozen compensation coefficient, freeze flag, error statistic value, frequency response comparison result, and calibration report.
[0090] The formulas include Equation (1), Equation (2), Equation (3), Equation (4), Equation (5), Equation (6), Equation (7), Equation (8), Equation (9), Equation (10), Equation (11), Equation (12), and Equation (13), as detailed below.
[0091] Equation (1)
[0092] In Equation (1), is the actual frequency response vector, with the unit of dB; To test the amplitude of the audio at the i-th frequency point, Let be the amplitude of the signal sampled in the m-th cycle at the i-th frequency point; It is a numerically stable term, a very small positive number, whose purpose is to prevent the denominator from being 0 or too small, which would lead to numerical instability.
[0093] Equation (2)
[0094] In equation (2), The coherence coefficient is a dimensionless coefficient, preferably ranging from 0 to 1. Input power spectrum; Output power spectrum; For mutual spectrum; It is a numerically stable term.
[0095] Equation (3)
[0096] In equation (3), is the frequency confidence coefficient, a dimensionless coefficient, preferably ranging from 0 to 1; The effective mask has a value of 0 or 1. For reference signal-to-noise ratio, the unit is dB; Let be the linear signal-to-noise ratio of the k-th test channel at the i-th frequency point during the m-th iteration, and be a dimensionless quantity.
[0097] Equation (4)
[0098] In equation (4), This is the weighted error, expressed in dB. Frequency confidence coefficient; This refers to the frequency band weighting coefficient; The target frequency response template is in dB. This is the actual frequency response vector, in dB.
[0099] Equation (5)
[0100] In equation (5), The envelope error of the k-th test channel at the i-th frequency point during the m-th iteration is expressed in dB. is the smooth half-window width, a non-negative integer, used to represent the number of frequency points covered by the cross-frequency smoothing window on both sides of the center frequency point; q is the frequency point offset index, with a value range from -Q to Q; The smoothing kernel weight coefficients are the values corresponding to the offset position q. This represents the weighted error of the k-th test channel at the (i+q)-th frequency point during the m-th iteration, expressed in dB.
[0101] Equation (5) represents the weighted error of each frequency point in its neighborhood, centered on the i-th frequency point, according to the weighting coefficients. Smoothing is performed to obtain the envelope error that characterizes the gradually changing trend. .
[0102] Equation (6)
[0103] In equation (6), This refers to the residual error, expressed in dB. This is the weighted error, expressed in dB. This represents the envelope error, expressed in dB.
[0104] Equation (7)
[0105] In equation (7), For the updated envelope compensation component; This is the envelope compensation component, expressed in dB. The dimensionless adjustment coefficient is used to update the step size of the envelope component. This represents the envelope error, expressed in dB.
[0106] Equation (8)
[0107] In equation (8), This refers to the updated residual compensation components; This is the residual compensation component, in dB. The dimensionless adjustment coefficient is used to update the step size of the residual components. This refers to the residual error, expressed in dB. This is the residual single-wheel limit, in dB.
[0108] Equation (9)
[0109] In equation (9), The compensation curve after constraint; For the updated envelope compensation component; This refers to the updated residual compensation components; This is the current compensation curve, in dB. This is a multi-channel average compensation curve, in dB. The constraint coefficient is a dimensionless adjustment coefficient. It is a second-order difference operator along the frequency index direction, used to measure the degree of local curvature of the compensation curve at adjacent frequency points. The larger the value, the more obvious the fluctuation of the compensation curve near that frequency point. Second-order difference smoothing constraint for adjacent frequency points; This is the channel consistency constraint coefficient, a dimensionless adjustment coefficient. For channel consistency constraints.
[0110] Equation (10)
[0111] In equation (10), This represents the root mean square error for the current round, in dB. This is the weighted error, expressed in dB. The number of effective frequency points is expressed in units of 1.
[0112] Equation (11)
[0113] In equation (11), is the drift of coefficients between two adjacent rounds, a dimensionless quantity; n is the sampling number; L is the total number of taps in the FIR compensation filter, i.e., the length of the filter coefficient vector; For FIR coefficients; The set of FIR coefficients to be effective in the next round; It is a numerically stable term.
[0114] Equation (12)
[0115] In equation (12), The signal-to-noise ratio (SNR) of the k-th test channel at the i-th frequency point during the m-th iteration is expressed in decibels (dB). The power spectrum of the sampled signal at the i-th frequency point during the m-th iteration of the k-th test channel; This is the estimated noise power value at the i-th frequency point; It is a numerically stable term.
[0116] Equation (13)
[0117] In equation (13), Let be the linear signal-to-noise ratio of the k-th test channel at the i-th frequency point during the m-th iteration, which is a dimensionless quantity; The signal-to-noise ratio is expressed in decibels (dB) for the corresponding frequency point.
[0118] Equation (3) embodies the core idea of this application: first screening credible frequency points, then constructing confidence coefficients; Equations (5) to (8) embody the dual-component update mechanism of this application for separately processing the gradually varying envelope error and the local residual error; Equation (9) embodies the combined use of adjacent frequency point smoothing constraints and channel consistency constraints; when freezing, the error amplitude corresponding to Equation (10) and the slope of error improvement between two adjacent rounds are considered simultaneously. - | and the coefficient drift corresponding to equation (11) The system only enters a frozen state when all three conditions continuously meet the threshold P rounds.
[0119] Typical frequency point calculations are explained below.
[0120] The following section selects a test channel of a certain model of miniature loudspeaker prototype during closed-loop calibration, listing the recorded values of five typical frequency points at the m=4th iteration to illustrate the formation process of intermediate data in steps S3 to S6. The listed data is organized in the order of target template frequency response - sampled measured frequency response - validity determination - confidence weighted error construction - dual-component update - constraint reconstruction, which can reflect the data flow and computation link in a single iteration of this application.
[0121] Table 5: Test data and calculation results for typical frequency points in steps S3 to S4
[0122]
[0123] As shown in Table 5, this application does not perform error updates uniformly for all frequency points, but rather first combines the effective mask. Coherence coefficient and signal-to-noise ratio Frequency point reliability is screened. When a frequency point has low coherence, low signal-to-noise ratio, or an invalid mask, it will not directly drive the compensation update even if it deviates from the target template; for frequency points with high reliability, their errors are retained as the main basis for subsequent compensation calculations. This step can reduce the risk of mis-driving the compensation curve by noise-low frequency points, clipping distortion frequency points, and local abnormal frequency points.
[0124] Table 6: Frequency table of update results for typical frequency points in steps S5 to S6
[0125]
[0126] As can be seen from Table 6, this application does not incorporate weighted errors. Instead of directly iterating over the entire shape, we first extract the envelope error used to correct the overall contour. Then, the residual error used to correct local peaks and valleys is extracted. The curves are updated with different time lengths, and then a new compensation curve is obtained through the smoothing constraint and channel consistency constraint in step S6. This update method can suppress local overtuning and frequency response aliasing while maintaining the convergence speed.
[0127] The multi-factor freeze determination is explained below.
[0128] The following table shows the statistical records of the same test channel in subsequent iterations to illustrate the freeze determination logic in step S8. The freeze determination uses the root mean square error. Change in error between adjacent rounds |Δ |=| - |and coefficient drift The joint criterion is set as follows: the number of consecutive stability rounds is set to P=3, and the root mean square error threshold is preset according to the calibration target of the corresponding product model.
[0129] Table 7: Results of Multi-Factor Freeze Judgment Test
[0130]
[0131] As shown in Table 7, this application does not immediately freeze the iteration when the error first enters the threshold range. Instead, it requires the error magnitude, improvement slope, and coefficient drift to meet the conditions simultaneously for multiple consecutive rounds. This determination method can reduce the probability of false convergence and avoid prematurely ending the iteration before the parameters have stabilized.
[0132] The working process and problem-solving mechanism are explained below.
[0133] The working process of this application can be summarized as follows: the industrial control computer 101 is responsible for configuring tasks, templates, and thresholds; the USB audio interface module 102 is responsible for bridging audio and control information; the DSP main processing module 103, as the core of algorithm execution, after receiving the test audio and the back-collected data, first completes the effective frequency point screening and confidence coefficient generation, then calculates the actual frequency response, constructs the confidence weighted error, performs envelope and residual dual-component compensation update, and reconstructs the backup FIR coefficients under the constraints of smoothing and channel consistency; the DAC module 104 and the power amplifier module 105 are responsible for converting the compensated digital audio into driving signals; the speaker under test 106 emits sound in the test fixture; the back-collection microphone module 107 and the ADC module 108 convert the sound output into new digital back-collected data and send it back to the DSP main processing module 103, forming a closed loop.
[0134] With the cooperation of the aforementioned devices, the process of solving the technical problem in this application has a clear logic: First, unified and synchronous test and data acquisition data are formed through steps S1 and S2; then, low-confidence frequency points are identified through step S3 to avoid low noise, clipping distortion, and low coherence frequency points causing errors in subsequent updates; then, the confidence error is further decomposed into envelope components suitable for overall correction and residual components suitable for local correction through steps S4 and S5, thereby suppressing over-modulation and oscillation caused by direct updates; next, smoothing constraints and channel consistency constraints are introduced through step S6 to reduce sharp fluctuations in the compensation curve and improve the consistency of multi-channel results; finally, uninterrupted updates and stable freezing are achieved through steps S7 and S8, thereby transforming the scattered process of manual measurement + offline analysis + manual import into a closed-loop production line calibration process of automatic measurement + automatic calculation + automatic update + automatic freezing.
[0135] Therefore, compared with conventional schemes that rely solely on a single error for direct updates, this application does not simply change the step size parameter. Instead, it establishes an algorithmic link with sequential logical constraints to address four types of engineering problems in production line calibration: insufficient frequency point reliability, local overadjustment, multi-channel discrepancies, and false convergence. This link demonstrates substantial technical differences and improved engineering performance compared to conventional schemes.
[0136] The following sections will explain the verification conditions and testing methods for logarithmic sweep frequency, as well as the technical effects and comparative data.
[0137] To verify the technical effectiveness of this application, a logarithmic sweep frequency signal consistent with the target calibration frequency band is preferably used as the main test excitation. Under the same tooling conditions, environmental conditions, target template, and statistical caliber, comparative tests are conducted on the uncompensated scheme, the conventional direct error update scheme, and the scheme of this application. The frequency response curves before and after calibration, and the root mean square error of each round are recorded. The study evaluates the improvement effects of this application on frequency response flatness, convergence speed, update continuity, and multi-channel consistency by considering the freezing rounds and channel dispersion.
[0138] The verification conditions and test methods for logarithmic sweep frequency are explained below.
[0139] This embodiment uses 32 prototypes of the same model as the statistical object. Calibration and statistics are completed in two batches using a 16-channel parallel test platform. The main test excitation signal preferably uses a logarithmic sweep signal covering the target calibration frequency band. This sweep signal is sent from the industrial control computer 101, bridged to the DSP main processing module 103 via the USB audio interface module 102, filtered by the DSP main processing module 103 according to the current round compensation coefficient, and output to the DAC module 104. The DAC module then drives the tested miniature speaker 106 to emit sound via the power amplifier module 105. After the sound output is collected by the sampling microphone module 107, it is converted into a digital sampling signal by the ADC module 108 and returned to the DSP main processing module 103 for frequency domain analysis and error calculation. See Table 8 for the verification condition table.
[0140] To ensure the comparability and repeatability of test results, it is preferable to use a frequency sweep range consistent with the target template, and to average the results of multiple consecutive frames to reduce the impact of random noise on frequency response estimation and freeze determination. The test drive level should be controlled within a range that does not trigger clipping distortion to avoid abnormal frequency points misleading the generation of confidence coefficients and error updates.
[0141] Table 8: Verification Conditions Table
[0142]
[0143] The technical effects and comparative data are explained below.
[0144] To demonstrate the improvement of this application compared to conventional direct error update schemes, comparative tests should be conducted under the same test conditions, the same logarithmic frequency sweep signal, the same target template, the same tooling, and the same statistical caliber. Preferably, comparisons should be made from three levels: uncompensated state, conventional direct error update state, and the state of this application's scheme, to reflect the technical effects of this application in low-confidence frequency suppression, improved frequency response flatness, increased convergence speed, and enhanced freeze-thaw stability. See Table 9 for a comparison table of technical scheme differences.
[0145] Table 9: Comparison of Technical Solutions
[0146]
[0147] To facilitate quantitative evaluation of the technical effects of this application, the following indicators are preferred: maximum positive deviation within the frequency band, maximum negative deviation within the frequency band, maximum peak-to-valley difference, and freezing point. (m) and the number of rounds required to reach the target error range. All of the above indicators should be obtained based on the statistical results of actual logarithmic sweep frequency tests.
[0148] Table 10: Frequency Response Improvement Effect of Batch Prototypes
[0149]
[0150] Note: The compliance rate is defined as the maximum positive deviation within the frequency band not exceeding +1.0dB and the maximum negative deviation within the frequency band not less than -1.0dB, and at the time of freezing. The percentage of test channels with a noise level not exceeding 0.60dB.
[0151] As shown in Table 10, under the statistical conditions of batch prototypes, the proposed solution outperforms the conventional direct error update solution in terms of maximum positive deviation, maximum negative deviation, maximum peak-to-valley difference, and root mean square error at freeze time within the frequency band, and the compliance rate increases from 71.9% to 93.8%. This result indicates that the proposed solution is not only effective for individual test channels, but also maintains good frequency response flatness improvement and stability within the range of batch prototypes.
[0152] like Figure 5 As shown, the maximum peak-to-valley difference of the uncompensated scheme is 13.2 dB, and the amplitude deviation is 6.7 dB; the maximum peak-to-valley difference of the conventional direct error update scheme is 3.1 dB, and the amplitude deviation is 1.4 dB; the maximum peak-to-valley difference of the scheme in this application is 1.3 dB, and the amplitude deviation is 0.6 dB.
[0153] Table 11: Statistics on Batch Convergence and Freeze
[0154] Note: The first time entering the Eth threshold round refers to... (m) Rounds where the first value is less than 0.60 dB; the final freeze round refers to the rounds that simultaneously meet the following conditions. (m) <Eth、| (m)- (m-1)|<δE、 <δh and continuously satisfy P=3 rounds to output the freeze result round.
[0155] As shown in Table 11, the algorithm of this application can enter the error threshold range with fewer average rounds and complete the final freeze with fewer rounds under batch prototype conditions; at the same time, its freeze round distribution is more concentrated, and the proportion of anomalies and re-inspections is lower. This result shows that this application not only improves the convergence speed, but also improves the stability of freeze determination and the adaptability to production line cycle time.
[0156] Table 12: Statistics on Multi-channel Consistency Improvement
[0157]
[0158] Note: The average dispersion of channels within the calibrated frequency band can be defined as the average value of the absolute deviation of the calibrated frequency response curve of each test channel relative to the average curve of the same batch of channels within the target frequency band; the maximum dispersion of channels after calibration can be defined as the maximum value of the above deviation within the target frequency band.
[0159] As shown in Table 12, the algorithm of this application outperforms the conventional direct error update scheme in terms of average channel dispersion, maximum dispersion, and dispersion of frozen rounds. This indicates that the channel consistency constraint in this application can reduce the risk of channel dispersion in batch calibration results, thus making it more suitable for multi-channel parallel production line scenarios.
[0160] Table 13: Representative Test Channel Error Convergence Process Table
[0161]
[0162] like Figure 6 As shown in Table 13, under the condition that the root mean square error threshold Eth = 0.60 dB, the algorithm of this application performs as follows in the 8th round: (m) has dropped to 0.52dB, entering the preset error threshold range; while the conventional direct error update scheme, under the same rounds... (m) remains at 0.93dB, not yet reaching the threshold. Furthermore, after entering the threshold range, the algorithm in this application... The change in (m) is small and there is no obvious rebound, indicating that it is better than the conventional direct error update scheme in terms of error convergence speed and freeze stability.
[0163] In summary, as shown in Tables 10 to 13, under the same logarithmic frequency sweep test conditions, the same target template, and the same statistical caliber, this application, compared with the conventional direct error update scheme, can not only further reduce the maximum positive deviation, maximum negative deviation, maximum peak-to-valley difference, and root mean square error during freezing of batch prototypes in the target frequency band, but also improve the compliance rate, shorten the first entry into the error threshold range and the number of rounds required for final freezing, and reduce the dispersion of multi-channel calibration results in frequency response dispersion and freezing rounds.
[0164] Specifically, Table 10 shows that this application can achieve better frequency response flatness and higher compliance rate within the batch prototype range; Table 11 shows that this application has faster convergence speed and more stable freeze determination capability under batch testing conditions; Table 12 shows that this application can effectively reduce the result dispersion during multi-channel parallel calibration through channel consistency constraints; Table 13 further shows that on representative test channels, this application can enter the preset error threshold range in fewer rounds and maintain small error fluctuations in subsequent iterations, demonstrating good convergence stability.
[0165] Therefore, the technical effect of this application does not stem from a simple adjustment of a single update step size, but rather from the synergistic effect of a combined algorithmic chain: reliable frequency point selection, confidence-weighted error construction, envelope and residual dual-component update, smoothing constraints, channel consistency constraints, double-buffered hot switching, and multi-factor freeze determination. This combined algorithmic chain can more stably generate compensation coefficients suitable for mass production configurations in the micro-speaker production line calibration scenario, thus demonstrating a comprehensive improvement in technical performance compared to conventional solutions in terms of frequency response flatness, convergence speed, update continuity, freeze stability, and multi-channel consistency.
[0166] Applicable technical scenarios: The technical solution of this application is applicable to the confidence-weighted dual-component closed-loop adaptive compensation method and implementation platform for the calibration of miniature loudspeaker production lines. This method is used to automatically generate compensation parameters based on the sampling results of the miniature loudspeaker under test in a unified testing platform, and output filter coefficients that can be directly used for subsequent mass production configuration.
[0167] Key Technical Points Summary: This application addresses the problems of low-confidence frequency misdrive, local overfitting, multi-channel discrepancies, and spurious convergence in mass production calibration scenarios. It proposes an improved confidence-weighted dual-component closed-loop adaptive compensation method. This method consists of steps S1 to S8 forming a complete closed loop, with steps S3 to S8 being the main improvements. The hardware components in the platform are used to execute this method. This application does not aim to design a USB sound card, but rather to identify reliable frequency points during mass production calibration, perform hierarchical updates of the reliable error, and stably generate compensation coefficients directly usable for mass production under smoothing constraints, channel consistency constraints, and multi-factor freezing criteria.
[0168] like Figure 4 As shown, the algorithm improvements are explained below. Improvement 1: Frequency point filtering, corresponding to step S3: Based on effective mask. Coherence coefficient With signal-to-noise ratio Generate frequency point confidence coefficient This allows low-confidence frequencies to be suppressed or eliminated during updates. Improvement 2, confidence error construction, corresponds to step S4: using confidence coefficients. With frequency band weight Constructing weighted error This ensures that the error vector reflects both the target deviation and the reliability and service priority of each frequency point. Improvement point 3 involves updating the envelope component and the residual component, corresponding to step S5: decomposing the weighted error into envelope error. With residual error The envelope compensation component Genv and the residual compensation component Gres are updated with different time lengths to first correct the overall trend and then correct local peaks and valleys. Improvement 4, Constrained Compensation Reconstruction, corresponding to step S6: Adjacent frequency point smoothing constraints and channel consistency constraints are introduced when synthesizing the compensation curve to reduce the risk of curve jaggedness and improve the consistency of multi-channel production line calibration results. Improvement 5, corresponding to step S7: The updated compensation curve is reconstructed into a spare FIR coefficient set, and double-buffered hot switching is performed at the frame boundary to avoid audio dropouts or pops during the update process. Improvement 6, Freeze Decision, corresponding to step S8: The root mean square error, error improvement slope, and coefficient drift are jointly used as the freeze condition to avoid false convergence triggered by a single threshold.
[0169] The aforementioned technology forms a closed-loop algorithm chain following the sequence of screening reliable frequency points, constructing confidence errors, dual-component updates, constraint reconstruction, hot switching, and multi-factor freezing. The output of each stage serves as the input for the next stage; the absence of any key step will lead to a decrease in update stability, channel consistency, or freezing reliability.
[0170] Referring to Table 14, the technical problems solved, the technical functions, and the technical effects of the technical solution in this application are explained as follows: Beneficial Technical Effect 1: By downweighting or eliminating low-confidence frequency points, the error-driven effect of noise floor, clipping distortion, and low-coherence frequency points on compensation updates can be reduced. Beneficial Technical Effect 2: Through dual-component updates of envelope and residual, the probability of local overtuning and frequency response oscillations can be reduced while maintaining convergence speed. Beneficial Technical Effect 3: Through smoothing constraints and channel consistency constraints, the consistency of results after mass production calibration of multi-channel prototypes can be improved. Beneficial Technical Effect 4: Through double-buffered hot switching, compensation coefficients can be updated without interrupting the test link, reducing abnormal sounds and transient jumps. Beneficial Technical Effect 5: Through multi-factor freeze judgment, true convergence and short-term fluctuations can be more reliably distinguished, thereby shortening re-inspection time and reducing the probability of rework.
[0171] Table 14: Correspondence Table of Key Technical Issues, Technical Means, and Direct Technical Effects
[0172]
Claims
1. A closed-loop adaptive compensation method for loudspeaker production line calibration, characterized in that: Includes the following steps, Step S1: Obtain the closed-loop calibration task, which includes the channel task table and target frequency response template corresponding to the current batch of samples of the loudspeaker under test. The parameters include the effective frequency band range, weighting parameters, threshold parameters, calibration parameters, and initialization buffer. The weighting parameters include the frequency band weighting coefficient w(i), the threshold parameters include the root mean square error threshold Eth, the error improvement slope threshold δE, and the coefficient drift threshold δh, and the calibration parameters include the FIR coefficients. Envelope compensation component Residual compensation component and compensation curve The initialization of the cache includes buffer A and buffer B; Step S2: Obtain the re-sampled audio frames [n] contains the temporal state information, which includes the sampling rate fs, the number of points per frame N, the noise floor estimate, and the clipping state flag. Step S3: Calculate and obtain the signal-to-noise ratio and coherence coefficient Generate a valid mask Calculate the frequency point confidence coefficient ; Step S4: Calculate the actual frequency response vector and weighted error ; Step S5: Obtain the envelope error Obtain residual error Update step size based on envelope components Obtain the updated envelope compensation component Update step size based on residual components Obtain the updated residual compensation components ; Step S6: Apply second-order differential smoothing constraints and channel consistency constraints to adjacent frequency points to obtain the constrained compensation curve. Obtain the backup FIR coefficient set ; Step S7: Based on the backup FIR coefficient set Obtain the FIR coefficient set that will take effect in the next round. ; Step S8: Calculate the root mean square error of the current round. FIR coefficient drift between adjacent rounds If the root mean square error of the current round is satisfied simultaneously Less than the root mean square error threshold Eth, | - |<Error Improvement Slope Threshold δE, Two-Round FIR Coefficient Drift If the coefficient drift threshold δh is less than the threshold and the current channel has been continuously maintained for P rounds, then the current channel is considered to have reached stable convergence. The current FIR coefficients are then frozen to obtain the final compensation parameters.
2. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S1, when the industrial control computer obtains the product model and target frequency response template of the current batch of samples of the loudspeaker under test... Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations After setting the root mean square error threshold Eth, the error improvement slope threshold δE, the coefficient drift threshold δh, and the number of consecutive stability judgment rounds P, the industrial control computer loads the corresponding target frequency response template according to the product model. The system generates a task configuration package based on the effective frequency band range and calibration parameters, and sends it to the DSP main processing module. The task configuration package includes the product model and the target frequency response template. Test audio frames [n], frequency band weighting coefficient w(i), maximum number of iterations The parameters include: root mean square error threshold Eth, error improvement slope threshold δE, coefficient drift threshold δh, number of consecutive stabilization rounds P, effective frequency band range, and calibration parameters, including FIR coefficients. After receiving the task configuration packet, the DSP main processing module processes the envelope compensation component. Residual compensation component Compensation curve The dual buffers A and B are initialized to form a closed-loop calibration task.
3. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S2, when the initial round m=0, the DSP main processing module will process the FIR coefficients. Set to pass-through or preset initial coefficients; the DSP main processing module processes the test audio frames. [n] is filtered and sent to the DAC module, which then amplifies the power to drive the speaker under test to produce sound. The microphone module acquires the sound output of the speaker under test, which is then converted into audio frames by the ADC module. [n] and return to the DSP main processing module, which then obtains the re-sampled audio frame. [n], based on the sampling rate fs and the number of points per frame N, for each sampled audio frame. [n] performs real-time analysis, obtains the noise floor estimate through the minimum recursive averaging algorithm, obtains the clipping state flag through full-amplitude ratio detection and harmonic analysis, and finally outputs complete time-series state information.
4. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S3, the DSP main processing module processes the test audio frames respectively. [n] and the captured audio frame [n] Performs frame segmentation, windowing, and frequency domain transformation to calculate and obtain the test audio frame. Input power spectrum of [n] and re-acquiring audio frames Output power spectrum of [n] and mutual spectrum Based on the output power spectrum The signal-to-noise ratio is obtained by calculating the noise floor estimate. The coherence coefficient was calculated. Based on signal-to-noise ratio Coherence coefficient Generate an effective mask from the effective frequency band range. Calculate the frequency point confidence coefficient .
5. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S4, the DSP main processing module calculates and obtains the actual frequency response vector. The weighted error is calculated. .
6. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S5, the DSP main processing module processes the weighted error. Cross-frequency smoothing is performed to obtain the envelope error characterizing the gradually varying trend. Using weighted error Subtract envelope error Obtaining residual error Based on envelope compensation components Envelope component update step size and envelope error Calculate and obtain the updated envelope compensation components Based on residual compensation components Residual component update step size residual error and residual single-wheel amplitude limiting Calculate and obtain the updated residual compensation components .
7. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S6, the DSP main processing module is based on the updated envelope compensation components. Updated residual compensation components Current compensation curve and multi-channel average compensation curve By applying second-order differential smoothing constraints and channel consistency constraints to adjacent frequency points, the constrained compensation curves are obtained. ; When using the real-coefficient linear-phase FIR implementation, a conjugate symmetric spectrum is constructed according to the target compensation curve, and the backup FIR coefficient set is obtained through inverse transformation and window function processing. .
8. The closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S7, the DSP main processing module will set the backup FIR coefficients. Write to the backup buffer without directly overwriting the currently active coefficients; near audio frame boundaries or predetermined zero-crossing, the double-buffering management logic switches the backup buffer to the current buffer, thus making the new compensation coefficients effective and obtaining the set of FIR coefficients for the next round. .
9. A closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S8, the DSP main processing module is based on weighted error. and number of effective frequency points Calculate the root mean square error of the current round The drift of the FIR coefficients between adjacent rounds is calculated based on the FIR coefficients between adjacent rounds. If the root mean square error of the current round is satisfied simultaneously Less than the root mean square error threshold Eth, | - |<Error Improvement Slope Threshold δE, Two-Round FIR Coefficient Drift If the coefficient drift threshold δh is less than the threshold value and remains constant for P iterations, then the current channel is considered to have reached stable convergence. The current FIR coefficients are then frozen, and the final compensation parameters, error statistics, version number, and frequency response comparison results are obtained. Otherwise, if the iteration number m is less than the maximum number of iterations... When the maximum number of iterations is exceeded, proceed to the next update round; If the conditions are still not met, mark the channel as an abnormal item or a re-inspection item; The DSP main processing module uploads the final compensation parameters, error statistics, version number, and frequency response comparison results to the industrial control computer.
10. A closed-loop adaptive compensation method for loudspeaker production line calibration according to claim 1, characterized in that: In step S1, the closed-loop calibration task includes the channel task table corresponding to the current batch of prototypes of the loudspeaker under test and the target frequency response template. The parameters include the effective frequency band range, weighting parameters, threshold parameters, calibration parameters, and initialization buffer. The weighting parameters include the frequency band weighting coefficient w(i), the threshold parameters include the root mean square error threshold Eth, the error improvement slope threshold δE, and the coefficient drift threshold δh, and the calibration parameters include the FIR coefficients. Envelope compensation component Residual compensation component and compensation curve The initialization buffer includes buffer A and buffer B; in step S2, the timing status information includes sampling rate fs, number of points per frame N, noise floor estimate and clipping status flag.