Loudspeaker compensation method and device, equipment and storage medium
By compressing and nonlinearly compensating the voltage of the speaker input signal, the problem of speaker displacement amplification under large amplitude is solved, ensuring that the diaphragm displacement is within a safe range, thereby improving the low-frequency playback effect and listening quality of the speaker.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-28
- Publication Date
- 2026-04-07
AI Technical Summary
Speakers in mobile devices are prone to generating noise and displacement amplification under large amplitude, leading to hearing loss and potentially causing permanent damage to the diaphragm.
By compressing and nonlinearly compensating the voltage of the input signal, the target control voltage is determined to avoid excessive displacement of the speaker diaphragm. Feedforward and feedback control are performed using displacement compression factor and voltage compression factor to ensure that the diaphragm displacement is within the allowable range.
It reduces the displacement amplification phenomenon caused by the nonlinear compensation scheme, avoids damage to the speaker diaphragm, and improves the low-frequency playback effect and listening quality.
Smart Images

Figure CN121815166A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of loudspeaker technology, and particularly relates to a loudspeaker compensation method and device, equipment and a storage medium. BACKGROUND
[0002] As a sound unit, a loudspeaker (SPK) is an essential part of a mobile device. The loudspeaker is increasingly widely used in mobile devices, such as playing music and videos, making hands-free calls, and playing a ringtone.
[0003] Due to the size of the loudspeaker in the mobile device, the low-frequency experience is usually poor. Increasing the amplitude of the loudspeaker can improve the low-frequency playback capability of the loudspeaker and bring a more shocking low-frequency experience. However, under a large amplitude, serious noise is generated, causing a loss of listening experience and affecting the playback effect of the loudspeaker. Even a serious displacement amplification phenomenon occurs, causing permanent damage to the diaphragm of the loudspeaker. SUMMARY
[0004] The present application provides a loudspeaker compensation method, device, equipment and storage medium, which are used to compress the voltage of an input signal, overcome the displacement amplification phenomenon caused by the introduction of a nonlinear compensation scheme for a loudspeaker, and avoid damage to the loudspeaker.
[0005] To achieve the above object, the present application adopts the following technical solutions:
[0006] In a first aspect, a loudspeaker compensation method is provided, applied to an electronic device. The method includes: in response to a loudspeaker function call operation triggered by a user, the electronic device acquires an input signal of an input loudspeaker. Further, the electronic device determines a voltage compression factor according to a control voltage corresponding to the input signal acquired at a historical time, compresses the input voltage of the input signal to obtain a target voltage, and the target voltage is less than or equal to the input voltage. Further, the electronic device performs nonlinear compensation processing on the target voltage to determine a target control voltage, and controls the loudspeaker to play sound based on the target control voltage.
[0007] In the loudspeaker compensation method provided by the present application, in response to the loudspeaker function call operation triggered by the user, the input signal of the input loudspeaker required to be played by the loudspeaker is acquired, the input voltage of the input signal at the current time is compressed in combination with the control voltage of the input signal at the historical time to obtain a target voltage less than the input voltage, and the target voltage is subjected to nonlinear compensation. In this way, compared with the nonlinear compensation of the input voltage in the related art, the nonlinear compensation of the compressed target voltage in the present application can weaken the displacement amplification phenomenon caused by the nonlinear compensation scheme and avoid damage to the diaphragm of the loudspeaker due to excessive displacement.
[0008] In a possible design, the electronic device performs compression processing on an input voltage of an input signal to obtain a target voltage, including: determining, by the electronic device, a displacement compression factor according to an input voltage of the input signal obtained at a historical moment. Further, the electronic device performs compression processing on the input voltage of the input signal based on the displacement compression factor and a voltage compression factor to obtain the target voltage.
[0009] In this design, the displacement compression factor that avoids the diaphragm of the loudspeaker exceeding the upper limit of displacement is determined according to the input voltage of the input signal obtained at the historical moment. In this way, the compression processing on the input voltage of the input signal is implemented from the displacement dimension and the voltage dimension by using the displacement compression factor and the voltage compression factor that avoids the control voltage exceeding the upper limit of voltage.
[0010] In a possible design, the electronic device performs nonlinear compensation on the target voltage to determine a target control voltage corresponding to the input signal, including: determining, by the electronic device, a target linear estimation displacement according to a linear parameter of the loudspeaker and the target voltage; and determining the target control voltage according to the target linear estimation displacement and a nonlinear parameter of the loudspeaker at the current moment.
[0011] In this design, the target linear estimation displacement corresponding to the target voltage is estimated by using the linear parameter of the loudspeaker and the target voltage after compression processing, and then the target control voltage is inversely deduced based on the target linear estimation displacement and the nonlinear parameter of the loudspeaker at the current moment. In this way, the diaphragm displacement of the loudspeaker after being excited by the target control voltage is also linear, the nonlinear compensation on the target voltage is implemented, and the total harmonic distortion of the loudspeaker at a large amplitude is weakened.
[0012] In a second aspect, a loudspeaker compensation method is provided, including: determining, by a loudspeaker compensation apparatus, a displacement compression factor according to an input voltage of an input signal at a historical moment; and determining a voltage compression factor according to a control voltage corresponding to the input signal at the historical moment. Further, the loudspeaker compensation apparatus determines a target voltage according to the displacement compression factor, the voltage compression factor, and an input voltage of an input signal at a current moment, the target voltage being less than or equal to the input voltage of the input signal at the current moment; performs nonlinear compensation processing on the target voltage to determine a target control voltage; and controls the loudspeaker to play sound further based on the target control voltage.
[0013] In the loudspeaker compensation method provided in the application, a displacement compression factor for implementing feedforward control is obtained based on the input voltage of the input signal at the historical moment, a voltage compression factor for implementing feedback control is obtained based on the control voltage corresponding to the input signal at the historical moment, and the input signal at the current moment is further processed based on the displacement compression factor and the voltage compression factor to obtain a target voltage less than or equal to the voltage of the input signal at the current moment. In this way, the target control voltage obtained by performing nonlinear compensation based on the target voltage smaller than the input voltage of the input signal can weaken the displacement amplification phenomenon caused by the nonlinear compensation scheme, so that the displacement of the diaphragm is within the maximum displacement range allowed by the diaphragm, and the diaphragm is prevented from being damaged due to excessive displacement.
[0014] In a possible design, the loudspeaker compensation device determines the displacement compression factor based on the input voltage of the input signal at the historical moment, including: the loudspeaker compensation device determines a nonlinear estimated displacement based on the input voltage of the input signal at the historical moment and the nonlinear parameter of the loudspeaker; and determines a linear estimated displacement based on the input voltage of the input signal at the historical moment and the linear parameter of the loudspeaker. Further, the loudspeaker compensation device determines the displacement compression factor based on the nonlinear estimated displacement and the linear estimated displacement.
[0015] In this design, the nonlinear estimated displacement and the linear estimated displacement are obtained by estimating the nonlinear displacement and the linear displacement based on the input voltage of the input signal at the historical moment, and the displacement compression factor is calculated based on the nonlinear estimated displacement and the linear estimated displacement, to compress the voltage of the input signal and reduce the displacement amplification phenomenon caused by the subsequent nonlinear compensation scheme.
[0016] In a possible design, the loudspeaker compensation device determines the displacement compression factor based on the nonlinear estimated displacement and the linear estimated displacement, including: the loudspeaker compensation device determines a nonlinear predicted displacement based on a plurality of nonlinear estimated displacements and a first displacement prediction model, the plurality of nonlinear estimated displacements being the nonlinear estimated displacement at each moment continuous with the historical moment; and determines a linear predicted displacement based on a plurality of linear estimated displacements and a second displacement prediction model, the plurality of linear estimated displacements being the linear estimated displacement at each moment continuous with the historical moment. Further, the loudspeaker compensation device determines the displacement compression factor based on the nonlinear predicted displacement and the linear predicted displacement.
[0017] In this design, the nonlinear predicted displacement at the current moment is predicted based on a plurality of nonlinear estimated displacements at historical moments, and the linear predicted displacement at the current moment is predicted based on a plurality of linear estimated displacements at historical moments, so that the nonlinear predicted displacement and the linear predicted displacement obtained by prediction can be used to predict whether the predicted displacement has a trend of increasing without introducing time delay, to perform displacement suppression in advance and more accurately control the displacement of the diaphragm of the loudspeaker.
[0018] In a possible design, the loudspeaker compensation device determines the displacement compression factor according to the nonlinear estimated displacement and the linear estimated displacement, including: the loudspeaker compensation device determines a first gain according to the nonlinear estimated displacement, the linear estimated displacement, and the maximum diaphragm displacement; and determines a second gain according to the nonlinear predicted displacement, the linear predicted displacement, and the maximum diaphragm displacement. Further, the loudspeaker compensation device determines the minimum value of the first gain and the second gain as the displacement compression factor.
[0019] In this design, the first gain calculated based on the nonlinear estimated displacement and the linear estimated displacement, and the second gain calculated based on the nonlinear predicted displacement and the linear predicted displacement are integrated, and the smaller gain is selected as the displacement compression factor to compress the voltage of the input signal, so as to ensure that the diaphragm displacement of the loudspeaker is within a reasonable range.
[0020] In a possible design, the loudspeaker compensation device determines the voltage compression factor according to the corresponding control voltage of the input signal at a historical moment, including: the loudspeaker compensation device determines the voltage compression factor according to the corresponding control voltage of the input signal at the historical moment, the input voltage, and the maximum preset voltage.
[0021] In this design, the corresponding control voltage of the input signal at the historical moment is used to realize feedback control of the input signal at the current moment, and in combination with the voltage range indicated by the loudspeaker, the control voltage is prevented from being too large, so as to avoid damage to the loudspeaker or other distortion phenomena.
[0022] In a possible design, the loudspeaker compensation device performs nonlinear compensation processing on the target voltage to determine the target control voltage, including: the loudspeaker compensation device determines a target linear estimated displacement according to the linear parameter of the loudspeaker and the target voltage; and determines the target control voltage according to the target linear estimated displacement and the nonlinear parameter of the loudspeaker at the current moment.
[0023] In this design, the target linear estimated displacement of the diaphragm of the loudspeaker is calculated according to the target voltage, and then the corresponding target control voltage is inversely deduced according to the target linear estimated displacement and the nonlinear parameter of the loudspeaker at the current moment, so that the displacement caused by exciting the diaphragm of the loudspeaker based on the target control voltage will not cause damage to the loudspeaker.
[0024] In a possible design, the loudspeaker compensation apparatus performs nonlinear compensation processing on the target voltage to determine the target control voltage, including: the loudspeaker compensation apparatus determining a target linear estimation displacement according to the linear parameter of the loudspeaker and the target voltage; and inputting the target linear estimation displacement into a preset neural network to obtain the target control voltage, the preset neural network being trained based on voltages of input signals of multiple signal types and corresponding diaphragm displacements.
[0025] In this design, a large amount of data (including voltage data and diaphragm displacement data of different signal types, voltage values, and different temperatures) is used to cover application scenarios in the training phase of the preset neural network, so as to reduce the error of loudspeaker nonlinear compensation and improve the playing effect of the loudspeaker.
[0026] In a possible design, the loudspeaker compensation apparatus determines the nonlinear estimation displacement according to the input voltage of the input signal at the historical moment and the nonlinear parameter of the loudspeaker, including: the loudspeaker compensation apparatus obtaining the diaphragm displacement and the vibration speed of the loudspeaker at the historical moment; and determining the nonlinear parameter of the loudspeaker at the historical moment according to the diaphragm displacement and the vibration speed. Further, the loudspeaker compensation apparatus determines the nonlinear estimation displacement according to the input voltage of the input signal at the historical moment and the nonlinear parameter of the loudspeaker at the historical moment.
[0027] In a third aspect, a loudspeaker compensation apparatus is provided, including a first compression unit, a second compression unit, a compression processing unit, a nonlinear compensation unit, and a control unit. The first compression unit is configured to determine a displacement compression factor according to an input voltage of an input signal at a historical moment. The second compression unit is configured to determine a voltage compression factor according to a corresponding control voltage of the input signal at the historical moment. The compression processing unit is configured to determine a target voltage according to the displacement compression factor, the voltage compression factor, and a voltage of the input signal at a current moment, the target voltage being less than or equal to the voltage of the input signal at the current moment. The nonlinear compensation unit is configured to perform nonlinear compensation processing on the target voltage to determine a target control voltage. The control unit is configured to control the loudspeaker to play sound based on the target control voltage.
[0028] In a possible design, the loudspeaker compensation apparatus further includes a nonlinear displacement estimation unit and a linear displacement estimation unit. The nonlinear displacement estimation unit is configured to determine a nonlinear estimation displacement according to an input voltage of an input signal at a historical moment and a nonlinear parameter of a loudspeaker. The linear displacement estimation unit is configured to determine a linear estimation displacement according to the input voltage of the input signal at the historical moment and a linear parameter of the loudspeaker. The first compression unit is specifically configured to determine a displacement compression factor according to the nonlinear estimation displacement and the linear estimation displacement.
[0029] In a possible design, the loudspeaker compensation apparatus further includes a nonlinear displacement prediction unit and a linear displacement prediction unit. The nonlinear displacement prediction unit is configured to determine a nonlinear predicted displacement according to a plurality of nonlinear estimated displacements and a first displacement prediction model, the plurality of nonlinear estimated displacements being nonlinear estimated displacements at each of a plurality of time points continuous with the historical time point. The linear displacement prediction unit is configured to determine a linear predicted displacement according to a plurality of linear estimated displacements and a second displacement prediction model, the plurality of linear estimated displacements being linear estimated displacements at each of the plurality of time points continuous with the historical time point. The first compression unit is specifically configured to determine the displacement compression factor according to the nonlinear predicted displacement and the linear predicted displacement.
[0030] In a possible design, the first compression unit is further configured to determine a first gain according to the nonlinear estimated displacement, the linear estimated displacement, and the diaphragm displacement maximum value, and determine a second gain according to the nonlinear predicted displacement, the linear predicted displacement, and the diaphragm displacement maximum value. The first compression unit is specifically configured to determine the displacement compression factor as a minimum value of the first gain and the second gain.
[0031] In a possible design, the second compression unit is specifically configured to determine the voltage compression factor according to the control voltage corresponding to the input signal at the historical time point, the input voltage, and a preset voltage maximum value.
[0032] In a possible design, the nonlinear compensation unit is specifically configured to determine a target linear estimated displacement according to the linear parameter of the loudspeaker and the target voltage, and determine the target control voltage according to the target linear estimated displacement and the nonlinear parameter of the loudspeaker at the current time point.
[0033] In a possible design, the nonlinear compensation unit is specifically configured to determine a target linear estimated displacement according to the linear parameter of the loudspeaker and the target voltage, and input the target linear estimated displacement into a preset neural network to obtain the target control voltage, the preset neural network being trained based on voltages of input signals of a plurality of signal types and corresponding diaphragm displacements.
[0034] In a possible design, the nonlinear displacement estimation module is specifically configured to obtain the diaphragm displacement and the vibration speed of the loudspeaker at the historical time point, determine the nonlinear parameter of the loudspeaker at the historical time point according to the diaphragm displacement and the vibration speed, and determine the nonlinear estimated displacement according to the input voltage of the input signal at the historical time point and the nonlinear parameter of the loudspeaker at the historical time point.
[0035] In a fourth aspect, an electronic device is provided, which includes a memory and a processor; the memory and the processor are coupled, the memory is configured to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the electronic device executes the loudspeaker compensation method provided in the first aspect, the second aspect or any possible design.
[0036] In a fifth aspect, a computer readable storage medium is provided, which stores instructions, when the instructions are run on an electronic device, the electronic device executes the loudspeaker compensation method provided in the first aspect, the second aspect or any possible implementation.
[0037] In a sixth aspect, a computer program product is provided, which includes a computer program, when the computer program is run, the computer executes the loudspeaker compensation method provided in the first aspect, the second aspect or any possible implementation. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 A structural diagram of a loudspeaker provided for an embodiment of the present application;
[0039] Figure 2 A sound signal frequency diagram of a loudspeaker provided for an embodiment of the present application;
[0040] Figure 3 A structural diagram of an electronic device provided for an embodiment of the present application Figure 1 ;
[0041] Figure 4 A software structural diagram of an electronic device provided for an embodiment of the present application;
[0042] Figure 5 A flow diagram of a loudspeaker compensation method provided for an embodiment of the present application;
[0043] Figure 6 A curve diagram of a force factor changing with a diaphragm displacement provided for an embodiment of the present application;
[0044] Figure 7 A curve diagram of a suspension stiffness coefficient changing with a diaphragm displacement provided for an embodiment of the present application;
[0045] Figure 8 A curve diagram of a damping coefficient changing with a vibration speed provided for an embodiment of the present application;
[0046] Figure 9 A structural diagram of a neural network provided for an embodiment of the present application;
[0047] Figure 10A schematic diagram of a data collection process and a model training process provided for an embodiment of the present application;
[0048] Figure 11 A flowchart of a speaker compensation method executed by each module in a speaker compensation device provided for an embodiment of the present application Figure 1 ;
[0049] Figure 12 A flowchart of a speaker compensation method executed by each module in a speaker compensation device provided for an embodiment of the present application Figure 2 ;
[0050] Figure 13 A structural schematic diagram of a speaker compensation device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0052] In the embodiments of the present application, the words such as "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. In fact, the use of the words such as "exemplary" or "for example" is intended to present the relevant concept in a specific manner.
[0053] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this document is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" "multiple" means two or more. "First", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different.
[0054] First, the related terms involved in the embodiments of the present application are explained.
[0055] I. Nonlinear factors
[0056] The nonlinear factor is a factor that causes nonlinear distortion of the output sound quality of the loudspeaker due to the hardware structure of the loudspeaker (for example, structural features such as the small size of the loudspeaker).
[0057] For example, a moving coil type micro loudspeaker, as shown in Figure 1 , includes a voice coil / winding, a diaphragm, a suspension, a magnet, a frame, a magnetic circuit, a magnetic field of a voice coil gap, and a vent hole.
[0058] The occurrence process of a loudspeaker is the conversion process between energy, force and sound.
[0059] In the conversion process between electricity and force: according to Ampere's law, when the alternating current of the audio signal passes through the voice coil, an alternating magnetic field will be generated around the voice coil, and the strength of the magnetic field is proportional to the size of the current. The voice coil is placed in the magnetic gap of the magnet, and when the alternating magnetic field in the voice coil interacts with the constant magnetic field of the magnet, the voice coil will be subjected to an alternating electromagnetic force. The size of the force is proportional to the product of the current of the voice coil and the strength of the magnetic field.
[0060] In the conversion process between force and sound: the voice coil driven by the electromagnetic force will drive the diaphragm to vibrate. The vibration of the diaphragm will compress and expand the surrounding air, generating corresponding sound waves.
[0061] The nonlinear factors that cause nonlinear distortion include but are not limited to the following three aspects: the nonlinear of the force factor of the voice coil, the nonlinear of the structural stiffness, and the nonlinear of the damping.
[0062] II. The nonlinear parameters of the loudspeaker can be understood as the quantification of the nonlinear factors. The nonlinear parameters of the loudspeaker include but are not limited to the force factor BL(x), the suspension stiffness coefficient Kms(x), and the damping coefficient Rms(v).
[0063] Wherein, x is the displacement of the loudspeaker, and v is the speed of the loudspeaker. In the embodiments of the present application, the displacement of the loudspeaker refers to the displacement of the diaphragm, that is, the distance between the diaphragm midpoint in the static state and the diaphragm midpoint in the current position of the diaphragm in the positive and negative directions, and the speed of the loudspeaker refers to the speed of the diaphragm of the loudspeaker, that is, the displacement amount of the diaphragm per unit time. It should be understood that the diaphragm of the loudspeaker is driven by the voice coil of the loudspeaker to move synchronously and reciprocally, therefore, x is also the displacement of the voice coil of the loudspeaker, and v is also the speed of the voice coil of the loudspeaker.
[0064] The force factor BL(x), the suspension stiffness coefficient Kms(x), and the damping coefficient Rms(v) are not constants, wherein the force factor BL(x) is the product of the magnetic induction intensity B(x) of the position of the voice coil and the effective wire length L(x) of the voice coil, the effective wire length L(x) of the voice coil refers to the wire length of the voice coil entering the magnetic field, which can be the product of the number of turns of the voice coil entering the magnetic field (related to the displacement x of the voice coil) and the wire length of a single coil; the suspension system of the loudspeaker is used to make the voice coil located in the middle position of the magnetic gap, the suspension stiffness coefficient Kms(x) is used to reflect the ability of the suspension system to resist deformation; the damping coefficient refers to the mechanical damping when the diaphragm of the loudspeaker vibrates, and changes with the vibration speed of the diaphragm, the faster the vibration speed, the greater the mechanical damping. The force factor BL(x) and the suspension stiffness coefficient Kms(x) are quantities that change nonlinearly with the displacement x of the diaphragm, and the damping coefficient Rms(v) is a quantity that changes nonlinearly with the speed v of the diaphragm, which can be represented by the following polynomials respectively:
[0065] Wherein, j=0, 1, 2, …, N. The coefficient bl0 is the linear term (0th order term) of the force factor, the coefficient bl1 is the first order coefficient of the force factor BL(x), the coefficient bl2 is the second order coefficient of the force factor BL(x), the coefficient bl3 is the third order coefficient of the force factor BL(x), and so on.
[0066] The coefficient kms0 is the linear term (0th order term) of the suspension stiffness coefficient, the coefficient kms1 is the first order coefficient of the suspension stiffness coefficient Kms(x), the coefficient kms2 is the second order coefficient of the suspension stiffness coefficient Kms(x), the coefficient kms3 is the third order coefficient of the suspension stiffness coefficient Kms(x), and so on.
[0067] The coefficient rms0 is the linear term (0th order term) of the damping coefficient, the coefficient rms1 is the first order coefficient of the damping coefficient Rms(v), the coefficient rms2 is the second order coefficient of the damping coefficient Rms(v), the coefficient rms3 is the third order coefficient of the damping coefficient Rms(v), and so on.
[0068] It should be noted that in the above formula, N generally takes a value of 4-8, and M generally takes a value of 2, which is not limited in the embodiments of the present application.
[0069] Due to the nonlinear distortion phenomenon of the loudspeaker, it is crucial to compensate for the nonlinear distortion of the loudspeaker, Figure 2The frequency of the acoustic signal when the nonlinear compensation is turned on and turned off is shown in the figure. When the nonlinear compensation is turned off, the nonlinear distortion of the low-frequency signal of the loudspeaker with large amplitude can reach more than 90%, resulting in serious noise and loss of listening experience. Therefore, it is necessary to apply a nonlinear compensation method to the loudspeaker to improve the low-frequency performance of the loudspeaker. In the design of the loudspeaker, the amplitude of the diaphragm is inversely proportional to the frequency, which means that for the same power input, the low-frequency signal (i.e., the signal with lower frequency) will generate a larger amplitude because the low-frequency signal needs a larger displacement to produce the same sound pressure level. In order to improve the low-frequency performance of the loudspeaker, a nonlinear compensation method is needed to amplify the displacement to achieve the purpose, which results in that the diaphragm of the loudspeaker may be far from the amplitude required by the amplified displacement, thereby causing permanent damage to the diaphragm of the loudspeaker.
[0070] To solve the above technical problems, the embodiment of the present application provides a loudspeaker compensation method, which determines a displacement compression factor according to the input voltage of the input signal at a historical moment, and determines a voltage compression factor according to the control voltage corresponding to the input signal at the historical moment. Further, the target voltage is obtained according to the displacement compression factor, the voltage compression factor and the input voltage of the input signal at the current moment, the target control voltage is determined by performing nonlinear compensation processing on the target voltage, and the loudspeaker is further controlled to play sound based on the target control voltage.
[0071] In the loudspeaker compensation method, the displacement compression factor for realizing feedforward control is obtained based on the input voltage of the input signal at the historical moment, the voltage compression factor for realizing feedback control is obtained based on the control voltage corresponding to the input signal at the historical moment, and the input signal at the current moment is further processed based on the displacement compression factor and the voltage compression factor to obtain the target voltage which is less than or equal to the voltage of the input signal at the current moment. In this way, the target control voltage obtained by performing nonlinear compensation based on the target voltage can make the displacement of the diaphragm within the maximum displacement range allowed by the diaphragm, avoiding damage to the loudspeaker caused by excessive displacement of the diaphragm.
[0072] The nonlinear control method of the loudspeaker provided by the embodiment of the present application can be applied to electronic devices with audio external playing function. Exemplarily, the electronic device in the embodiment of the present application can be a device with a loudspeaker, such as a headset, a sound system, a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultramobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) \ virtual reality (VR) device, etc.
[0073] For example, such as Figure 3 As shown, taking electronic device 100 as an example, electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, power management module 140, battery 141, antenna 1, wireless communication module 150, button 161, indicator 162, audio module 170, speaker 180, microphone 190, power amplifier (PA), etc.
[0074] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0075] Processor 110 may include one or more processing units, such as an application processor (AP), a modem processor, a controller, a memory, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. For example, processor 110 may be an application processor (AP). Alternatively, processor 110 may be integrated into a system-on-a-chip (SOC). Or, processor 110 may be integrated into an IC chip. Processor 110 may include an analog front-end (AFE) and a microcontroller unit (MCU) within the IC chip.
[0076] The controller can be the nerve center and command center of the electronic device 100. The controller can generate an operation circuit breaker control signal according to the instruction opcode and timing signal to complete the control of instruction fetching and execution.
[0077] The processor 110 can also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is using repeatedly. If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0078] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an integrated circuit (I2C) interface, an integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a general purpose input / output (GPIO) interface, and / or a USB interface, etc.
[0079] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or a combination of multiple interface connection methods.
[0080] The power management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger (such as a wireless charging base of the electronic device 100 or other devices that can wirelessly charge the electronic device 100) or a wired charger. For example, the power management module 140 can receive charging input from a wired charger through the USB interface 130. The power management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100.
[0081] The power management module 140 can charge the battery 141 and also supply power to the electronic device 100. The power management module 140 receives input from the battery 141 and supplies power to the processor 110, the internal memory 121, the external memory interface 120, and the wireless communication module 150, etc. The power management module 140 can also be configured to monitor related signals of the battery 141, such as voltage, current, temperature, battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 140 can also be arranged in the processor 110.
[0082] The wireless communication function of the electronic device 100 can be implemented through an antenna, a wireless communication module 150, a modem processor, a baseband processor, and the like.
[0083] The antenna 1 is used for transmitting and receiving electromagnetic wave signals. The antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antenna. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0084] The wireless communication module 150 can provide a wireless communication solution applied to the electronic device 100, including wireless local area networks (WLAN) (such as a wireless fidelity (WiFi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), and the like. In some embodiments, the antenna 1 and the wireless communication module 150 of the electronic device 100 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology.
[0085] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to extend the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, files such as music are saved in the external memory card.
[0086] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
[0087] The electronic device 100 can realize audio functions through an audio module 170, a speaker 180, a microphone 190, and an application processor, and the like. For example, music playing, recording, and the like.
[0088] The audio module 170 is configured to convert a digital audio signal into an analog audio signal for output, and to convert an analog audio signal into a digital audio signal. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110. The speaker 180, also referred to as a "loudspeaker", is configured to convert an analog audio signal into a sound signal. The PA can be configured to amplify an analog audio signal output by the audio module 170 to drive the speaker 180 to produce sound, and can also be configured to amplify an analog audio signal collected by the microphone 190.
[0089] In some embodiments, in response to a user triggering a speaker function call operation (for example, playing music, playing a video, a call, and the like triggering a speaker call operation), the electronic device 100 obtains an input signal input into the speaker 180 from the audio module 170, and compresses an input voltage of the input signal to obtain a target voltage less than or equal to the input voltage, and then performs nonlinear compensation on the target voltage to obtain a target control voltage, and controls the speaker 180 to play sound corresponding to the input signal based on the target control voltage.
[0090] In some embodiments, the compression of the input voltage of the input signal can be performed by the processor 110. The processor 110 determines a displacement compression factor based on the input voltage of the input signal obtained at a historical time, and determines a voltage compression factor based on the control voltage corresponding to the input signal obtained at the historical time, and then compresses the input voltage of the input signal based on the displacement compression factor and the voltage compression factor to obtain the target voltage.
[0091] The processor 110 can also be configured to perform nonlinear compensation on the target voltage to determine the target control voltage. In some embodiments, the processor 110 first estimates a target linear estimated displacement of a diaphragm of the speaker under excitation of the target voltage based on linear parameters of the speaker and the target voltage, and then inversely deduces the target control voltage based on the calculated target linear estimated displacement and nonlinear parameters of the speaker at the current time, so that when the speaker 180 is controlled to play based on the target control voltage, the displacement of the diaphragm of the speaker is also linear.
[0092] It should be noted that specific methods for calculating the displacement compression factor, the voltage compression factor, and the target control voltage are described in subsequent embodiments of the present application, and will not be described here.
[0093] In some embodiments, the speaker compensation method provided by the present application can be performed by the processor 110 in the electronic device 100 or the audio module 170, and the present application does not make specific limitations on this.
[0094] The keys 161 include a power-on key, a volume key, and the like. The keys 161 can be mechanical keys. Alternatively, the keys 161 can be touch keys. The electronic device can receive key input, and generate key signal input related to user settings and function control of the electronic device. The indicator 162 can be an indicator light, and can be used to indicate a charging state, a power change, and the like.
[0095] The software system of the electronic device 100 can employ a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. Embodiments of the present application take an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.
[0096] Figure 4 is a software structure block diagram of an electronic device 500 provided by an embodiment of the present application.
[0097] The layered architecture of the electronic device 100 divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and system library, and a kernel layer.
[0098] The application layer can include a series of application packages.
[0099] As shown in Figure 4 , the application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, and the like.
[0100] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.
[0101] In some embodiments, the loudspeaker compensation method provided by the present application can be deployed on the AP side, implemented in the application framework layer, or mounted in an audio digital signal processor (ADSP) for execution.
[0102] As shown in Figure 4 , the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0103] The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and capture the screen, and the like.
[0104] The content provider stores and retrieves data and makes the data accessible to the application programs. The data can include videos, images, audio, dialed and received phone calls, browsing history and bookmarks, phone book, etc.
[0105] The view system includes visual controls, such as a control that displays text, a control that displays an image, etc. The view system can be used to build an application program. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays an image.
[0106] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call state (including call connection, call hang-up, etc.).
[0107] The resource manager provides various resources for the application program, such as localized strings, icons, images, layout files, video files, etc.
[0108] The notification manager enables the application program to display notification information in the status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of the download, message reminders, etc. The notification manager can also be a notification that appears in the form of a chart or a scroll bar text in the top status bar of the system, such as a notification of an application program running in the background, and can also be a notification that appears in the form of a dialog window on the screen. For example, the text information is prompted in the status bar, a prompt sound is emitted, the electronic device is vibrated, the indicator light flashes, etc.
[0109] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0110] The core library includes two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
[0111] The application program layer and the application program framework layer run in the virtual machine. The virtual machine executes the java file of the application program layer and the application program framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, etc.
[0112] The system library can include multiple functional modules. For example: surface manager, media library, three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
[0113] The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
[0114] The media library supports playback and recording of a variety of commonly used audio, video formats, and static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0115] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing.
[0116] The 2D graphics engine is a drawing engine for 2D drawing.
[0117] The kernel layer is a layer between hardware and software. The kernel layer at least includes display drivers, camera drivers, audio drivers, and sensor drivers.
[0118] It can be understood that, Figure 4 The illustrated application framework layer, system library, and components included in the runtime kernel layer do not constitute a specific limitation on the electronic device 100. In some other embodiments of the present application, the electronic device 100 can include more or fewer components than illustrated, or combine certain components, or split certain components, or different component arrangements.
[0119] In some embodiments, the loudspeaker compensation method provided by the present application can be applied to an electronic device with a loudspeaker, wherein, as shown in the figure, Figure 5 The method includes the following steps S201-S204.
[0120] S201, the loudspeaker compensation device determines a displacement compression factor according to an input voltage of an input signal at a historical moment.
[0121] The historical moment is one moment or multiple moments continuous with the current moment.
[0122] As a possible implementation, the loudspeaker compensation device obtains an input voltage of an input signal of the loudspeaker at the current moment, and determines a nonlinear estimated displacement corresponding to the input signal based on the input voltage and nonlinear parameters of the loudspeaker, and determines a linear estimated displacement corresponding to the input signal based on the input voltage and linear parameters of the loudspeaker. Further, the loudspeaker compensation device determines the displacement compression factor based on the determined nonlinear estimated displacement and linear estimated displacement.
[0123] In some embodiments, if the historical moment is one moment continuous with the current moment, the loudspeaker compensation device calculates the corresponding nonlinear estimated displacement and linear estimated displacement based on the input voltage of the input signal at the historical moment, and then calculates the displacement compression factor based on the nonlinear estimated displacement and linear estimated displacement.
[0124] If the historical time period consists of multiple consecutive times with the current time period, the loudspeaker compensation device calculates the nonlinear estimated displacement and linear estimated displacement corresponding to each time period based on the input voltage of the input signal at each time period included in the historical time period. Then, it determines the average nonlinear estimated displacement and average linear estimated displacement at the historical time period. Finally, based on the average nonlinear estimated displacement and average linear estimated displacement, it calculates the displacement compression factor.
[0125] It should be noted that the displacement compressibility factor is a real number greater than 0 and less than or equal to 1. If the calculated number is greater than 1, the displacement compressibility factor is determined to be 1.
[0126] In some embodiments, the loudspeaker compensation device determines a nonlinear estimated displacement based on the input voltage and the nonlinear parameters of the loudspeaker, including the following steps S2011-S2013.
[0127] S2011, The loudspeaker compensation device acquires the diaphragm displacement and vibration velocity of the loudspeaker at historical moments.
[0128] Specifically, when the current moment is the initial moment, the diaphragm displacement and vibration velocity are initialized to 0; when the current moment is not the initial moment, the diaphragm displacement and vibration velocity calculated in the previous moment are obtained.
[0129] S2012. The loudspeaker compensation device determines the nonlinear parameters of the loudspeaker at historical moments based on the diaphragm displacement and vibration velocity.
[0130] It should be noted that the speaker compensation device stores a polynomial of the speaker's nonlinear parameters in advance. This polynomial of nonlinear parameters can be measured in advance using a Klippel device and stored in the speaker compensation device.
[0131] For example, such as Figures 6-8 As shown, Figure 6 This is a schematic diagram showing the change of the force factor BL of a loudspeaker with the diaphragm displacement. The force factor of the loudspeaker decreases as the diaphragm is further away from its stationary state. For example, when the diaphragm displacement is between 0.0 and 0.6, the force factor BL decreases as the diaphragm displacement increases. Figure 7 This is a schematic diagram showing the change of the suspension stiffness coefficient Kms of a loudspeaker with the diaphragm displacement. The greater the distance of the diaphragm from its stationary state, the greater the suspension stiffness coefficient of the loudspeaker. For example, when the diaphragm displacement is between 0.0 and 0.6, the suspension stiffness coefficient Kms increases with the increase of the diaphragm displacement. Figure 8Fig. 1 is a schematic diagram of a curve of a damping coefficient Rms of a loudspeaker varying with vibration velocity, as the vibration velocity of a diaphragm is greater, the damping coefficient of the loudspeaker is greater, for example, when the diaphragm velocity is between 0.0-1.5, the damping coefficient Rms increases with the increase of the diaphragm velocity. The above curve can be measured by a Klippel device, and a corresponding polynomial is obtained.
[0132] As a possible implementation, the loudspeaker compensation device substitutes the diaphragm displacement and the vibration velocity into the polynomial of the nonlinear parameter to calculate each nonlinear parameter.
[0133] For example, the nonlinear parameters include a force factor, a suspension stiffness coefficient, and a damping coefficient. The polynomial corresponding to the force factor BL is The polynomial corresponding to the suspension stiffness coefficient Kms is The polynomial corresponding to the damping coefficient is Correspondingly, the diaphragm displacement is substituted into the polynomials corresponding to the force factor and the suspension stiffness coefficient respectively to obtain the force factor BL and the suspension stiffness coefficient Kms of the loudspeaker at the historical time, and the vibration velocity is substituted into the polynomial corresponding to the damping coefficient to obtain the damping coefficient Rms of the loudspeaker at the historical time.
[0134] S2013, the loudspeaker compensation device determines a nonlinear estimated displacement according to the input voltage of the input signal at the historical time and the nonlinear parameter of the loudspeaker at the historical time.
[0135] As a possible implementation, the loudspeaker compensation device updates the intermediate variable based on the nonlinear parameter of the loudspeaker at the current time determined in the above step S2012. Further, the loudspeaker compensation device calculates the nonlinear estimated displacement at the current time based on the updated intermediate variable, the input voltage at the historical time, and the diaphragm displacement at the historical time.
[0136] In some embodiments, after calculating the nonlinear estimated displacement, the loudspeaker compensation device further calculates an estimated vibration velocity at the current time based on the updated intermediate variable, the input voltage at the historical time, and the diaphragm displacement at the historical time.
[0137] It should be noted that the update formula of the intermediate variable can be pre-set in the loudspeaker compensation device by an operation and maintenance personnel, and is exemplarily shown as follows.
[0138]
[0139] wherein σ x is the characteristic sensitivity of the loudspeaker, which is used to represent the sound intensity output by the loudspeaker under the same input power, ω zis a non-linear estimated displacement of the loudspeaker at the current time, and v[n] is an estimated vibration velocity of the loudspeaker at the current time. ζ is a derivative of a global Q value of the loudspeaker, the global Q value of the loudspeaker is a quality factor of the loudspeaker, that is, a sharp degree of a frequency response curve at a resonance frequency, and also indicates a damping state of a vibration system of the loudspeaker, R e is a voice coil impedance of the loudspeaker, BL is a force factor of the loudspeaker at the historical time, and K ms is a suspension stiffness coefficient of the loudspeaker at the historical time, R ms is a damping coefficient of the loudspeaker at the historical time, M ms is an equivalent mass of a vibrating component of the loudspeaker at the historical time.
[0140] Further, after obtaining the updated intermediate variable, the non-linear estimated displacement and the estimated vibration velocity at the current time can be calculated based on the following formula.
[0141] x[n] = σ x u[n-1] - a1x[n-1] - a2x[n-2]
[0142] v[n] = k1*fs s *(x[n] - x[n-2]) - k2*v[n-1] - k3*v[n-1]
[0143] wherein x[n] is the non-linear estimated displacement at the n time (current time), v[n] is the estimated vibration velocity at the n time (current time), x[n-1] is the diaphragm displacement at the n-1 time, x[n-2] is the diaphragm displacement at the n-2 time, k1, k2, k3 are preset constants, and v[n-1] is the vibration velocity at the n-1 time.
[0144] For example, k1, k2, and k3 can be set to 0.8038, 0.5358, and 0.0718 respectively, and the embodiments of the present application do not make specific limitations thereon.
[0145] It should be noted that after obtaining the non-linear estimated displacement and the estimated vibration velocity at the current time, they can be determined as the diaphragm displacement and the vibration velocity at the n+1 time respectively, for updating the non-linear parameters of the loudspeaker at the next time.
[0146] In some embodiments, the loudspeaker compensation device determines the linear estimated displacement according to the input voltage of the input signal at the historical time and the linear parameters of the loudspeaker, which can include the following steps S2014-S2015.
[0147] S2014, the loudspeaker compensation device obtains the linear parameters of the loudspeaker.
[0148] The linear parameters of the loudspeaker include voice coil impedance Re, 0th order term of a polynomial corresponding to force factor BL(x), 0th order term of a polynomial corresponding to suspension stiffness coefficient Kms(x), and 0th order term of a polynomial corresponding to damping coefficient Rms(v).
[0149] It should be noted that the above parameters can be calculated by current and voltage signals, or measured by Klippel equipment.
[0150] S2015, the loudspeaker compensation device determines a linear estimated displacement according to the input voltage of the input signal at the historical moment and the linear parameters of the loudspeaker.
[0151] As a possible implementation manner, the loudspeaker compensation device determines the linear estimated displacement based on the linear parameters of the loudspeaker obtained in the step S2014, the input voltage of the input signal at the historical moment, and a preset transfer function.
[0152] For example, the preset transfer function for determining the linear estimated displacement is shown in the following formula.
[0153]
[0154] wherein H(s) is the transfer function, X(s) is the linear estimated displacement, U(s) is the input voltage at the historical moment, BL is the 0th order term of the polynomial corresponding to the force factor BL(x), K0 is the 0th order term of the polynomial corresponding to the suspension stiffness coefficient Kms(x), R0 is the 0th order term of the polynomial corresponding to the damping coefficient Rms(v), M ms is the equivalent mass of the vibrating component, R e is the voice coil impedance of the loudspeaker.
[0155] Further, after obtaining the nonlinear estimated displacement and the linear estimated displacement, the loudspeaker compensation device can determine the ratio of the nonlinear estimated displacement to the linear estimated displacement as a displacement compression factor.
[0156] Optionally, the loudspeaker compensation device first determines the ratio of the minimum value between the nonlinear estimated displacement and the maximum displacement of the diaphragm of the loudspeaker to the linear estimated displacement as the displacement compression factor.
[0157] For example, the displacement compression factor can be determined by the following formula.
[0158]
[0159] wherein G1 is the displacement compression factor, x 1_1 is the nonlinear estimated displacement, x max is the maximum displacement of the diaphragm of the loudspeaker, and x 2_1 is the linear estimated displacement.
[0160] It can be understood that by adding the maximum displacement of the speaker diaphragm, the diaphragm displacement exceeding the maximum limit can be avoided to damage the speaker device.
[0161] In some embodiments, the application also provides a method for determining a displacement compression factor, as follows steps S2016-S2018.
[0162] S2016, the loudspeaker compensation device determines a nonlinear predicted displacement according to a plurality of nonlinear estimated displacements and a first displacement prediction model.
[0163] The plurality of nonlinear estimated displacements are nonlinear estimated displacements corresponding to each of a plurality of time points continuous with a historical time point.
[0164] As a possible implementation manner, the loudspeaker compensation device acquires the plurality of nonlinear estimated displacements and inputs the nonlinear estimated displacements into the first displacement prediction model to determine the nonlinear predicted displacement.
[0165] It should be noted that the predicted displacement obtained by the displacement prediction model can represent the increasing or decreasing trend of the displacement. If the predicted displacement has an increasing trend, it can be suppressed in advance, and the displacement of the loudspeaker diaphragm can be accurately controlled without introducing time delay.
[0166] The first displacement prediction model can adopt a linear regression prediction model. In the application embodiment, taking a full connection neural network model as an example, the training data is the plurality of nonlinear estimated displacements of the continuous time points. If the number of nonlinear estimated displacements used by the model is T1 and the number of predicted nonlinear estimated displacements is T2, the input data of the training model is {x(n), x(n-1), x(n-2), …, x(n-T1+1)}, and the training target is {x(n+T2), x(n+T2-1), …, x(n+1)}.
[0167] S2017, the loudspeaker compensation device determines a linear predicted displacement according to a plurality of linear estimated displacements and a second displacement prediction model.
[0168] The plurality of linear estimated displacements are linear estimated displacements corresponding to each of a plurality of time points continuous with a historical time point.
[0169] As a possible implementation manner, the loudspeaker compensation device acquires the plurality of linear estimated displacements and inputs the linear estimated displacements into the second displacement prediction model to determine the linear predicted displacement.
[0170] The second displacement prediction model can adopt a linear regression prediction model. In this embodiment, taking a fully connected neural network model as an example, the training data consists of linear estimated displacements at multiple consecutive time points. If the number of linear estimated displacements used by the model is T3, and the number of predicted linear estimated displacements is T4, then the input data for training the model is: {x(n), x(n-1), x(n-2), ..., x(n-T3+1)}, and the training objective is:
[0171] {x(n+T4),x(n+T4-1),…,x(n+1)}.
[0172] S2018. The loudspeaker compensation device determines the displacement compression factor based on the nonlinear predicted displacement and the linear predicted displacement.
[0173] As one possible implementation, after obtaining the nonlinear predicted displacement and the linear predicted displacement, the loudspeaker compensation device can determine the ratio of the nonlinear predicted displacement to the linear predicted displacement as the displacement compression factor.
[0174] Optionally, the loudspeaker compensation device first determines the ratio between the minimum of the nonlinear predicted displacement and the maximum displacement of the loudspeaker diaphragm and the linear predicted displacement, which is then defined as the displacement compression factor.
[0175] For example, the displacement compressibility factor can be determined using the following formula.
[0176]
[0177] Where G2 is the displacement compressibility factor, x 1_2 For nonlinear prediction of displacement, x max x represents the maximum displacement of the loudspeaker diaphragm. 2_2 For linear displacement prediction.
[0178] Understandably, by incorporating the maximum displacement of the speaker diaphragm, it is possible to prevent the diaphragm displacement from exceeding the maximum limit and damaging the speaker equipment.
[0179] In some embodiments, the loudspeaker compensation device determines the displacement compression factor G1, calculated based on the nonlinear estimated displacement, the linear estimated displacement, and the maximum diaphragm displacement, as the first gain; and determines the displacement compression factor G2, calculated based on the nonlinear predicted displacement, the linear predicted displacement, and the maximum diaphragm displacement, as the second gain. Further, the loudspeaker compensation device compares the first gain and the second gain, and determines the minimum value of the first gain and the second gain (i.e., min(G1, G2)) as the displacement compression factor.
[0180] It can be understood that, in the embodiments of the application, the nonlinear estimated displacement and the linear estimated displacement estimated based on the input signal at the historical moment are used to calculate the first gain, and the nonlinear predicted displacement and the linear predicted displacement are respectively predicted based on the nonlinear estimated displacement and the linear estimated displacement at the plurality of historical moments, and the second gain is calculated, and the minimum value of the first gain and the second gain is determined as the displacement compression factor, so as to ensure that the displacement of the loudspeaker diaphragm after the nonlinear compensation does not exceed a reasonable range, and damage to the loudspeaker is avoided.
[0181] In S202, the loudspeaker compensation apparatus determines the voltage compression factor according to the control voltage corresponding to the input signal at the historical moment.
[0182] As a possible implementation manner, the loudspeaker compensation apparatus obtains the control voltage obtained after the input signal at the historical moment is nonlinearly compensated, and determines the ratio of the input voltage of the input signal to the control voltage as the voltage compression factor.
[0183] In some embodiments, the loudspeaker compensation apparatus determines the ratio of the minimum value of the input voltage of the input signal at the historical moment and the preset maximum voltage to the control voltage as the voltage compression factor.
[0184] For example, the voltage compression factor can be determined by the following formula.
[0185]
[0186] Wherein, G3 is the voltage compression factor, u i is the input voltage of the input signal at the historical moment, u max is the preset maximum voltage, u c is the control voltage of the input signal at the historical moment.
[0187] It can be understood that the control voltage obtained after the nonlinear compensation is used for feedback control of the input signal, so as to prevent the control voltage obtained after the nonlinear compensation from being too large, resulting in damage to the loudspeaker or other distortion, and the design of the preset maximum voltage can prevent the input voltage of the input signal from exceeding the normal range, and ensure the normal operation of the loudspeaker.
[0188] In S203, the loudspeaker compensation apparatus determines the target voltage according to the displacement compression factor, the voltage compression factor, and the input voltage of the input signal at the current moment.
[0189] Wherein, the target voltage is less than or equal to the input voltage of the input signal at the current moment.
[0190] As a possible implementation manner, the loudspeaker compensation apparatus determines the product of the displacement compression factor, the voltage compression factor, and the input voltage of the input signal at the current moment as the target voltage.
[0191] It should be noted that the voltage compression factor is a real number greater than 0 and less than or equal to 1. If the calculated number is greater than 1, the voltage compression factor is determined as 1.
[0192] For example, if the displacement compression factor is g1, the voltage compression factor is g2, and the input voltage is u, the target voltage U = u x g1 x g2.
[0193] It should be noted that since the value range of the displacement compression factor and the voltage compression factor is (0, 1], after multiplying the displacement compression factor, the voltage compression factor, and the input voltage of the input signal at the current moment, the obtained voltage value is less than or equal to the input voltage of the input signal, which realizes compression of the input voltage, avoids the control voltage obtained by performing nonlinear compensation on the input voltage, and prevents the displacement of the diaphragm from exceeding the normal displacement range, thereby causing damage to the loudspeaker.
[0194] S204, the loudspeaker compensation apparatus performs nonlinear compensation processing on the target voltage to determine a target control voltage, and controls the loudspeaker to play sound based on the target control voltage.
[0195] As a possible implementation manner, the loudspeaker compensation apparatus determines the target linear estimation displacement according to the linear parameters of the loudspeaker and the target voltage. Further, the loudspeaker compensation apparatus calculates the target control voltage by a nonlinear compensation algorithm according to the target linear estimation displacement and the nonlinear parameters of the loudspeaker at the current moment, and controls the loudspeaker to play sound corresponding to the input signal at the current moment based on the target control voltage.
[0196] It should be noted that the loudspeaker compensation apparatus determines the target linear estimation displacement according to the linear parameters of the loudspeaker and the target voltage. For example, the implementation manner of determining the linear estimation displacement according to the linear parameters of the loudspeaker and the input voltage of the input signal at the historical moment in steps S2014-S2015 can be referred to, and only the input voltage of the input signal is replaced by the target voltage determined in step S203.
[0197] In an example, the loudspeaker compensation apparatus calculates the target control voltage based on the target linear estimation displacement, which can be referred to the following formula.
[0198]
[0199] wherein u cwhere x1 is the diaphragm displacement at a historical time, x2 is the velocity of the diaphragm at the historical time (the first derivative of the diaphragm displacement at the historical time), x3 is the acceleration of the diaphragm at the historical time (the second derivative of the diaphragm displacement at the historical time), M ms is the equivalent mass of the loudspeaker vibrating part, L e is the inductance of the coil, q is the target linear estimated displacement; the function BL X is the derivative of the function BL(), the function K msx is the function K ms is the derivative of the function K, the function R msx is the function R ms is the derivative of the function R.
[0200] In some embodiments, if the parameter required by the nonlinear compensation algorithm of the loudspeaker is the third derivative of the target linear estimated displacement, the loudspeaker compensation device calculates the third derivative of the linear displacement according to the target voltage, and then calculates the target control voltage according to the third derivative.
[0201] In some embodiments, after determining the target linear estimated displacement based on the linear parameters of the loudspeaker and the target voltage, the loudspeaker compensation device inputs the target linear estimated displacement into a preset neural network to obtain the target control voltage output by the preset neural network.
[0202] wherein the preset neural network is trained based on the voltage of the input signal of multiple signal types and the corresponding diaphragm displacement.
[0203] It should be noted that the preset neural network can be a Time-Delay Neural Network (TDNN), the structure of which is shown in Figure 9 By applying multiple time delay windows to the input signal, the TDNN can capture features at different time steps.
[0204] The training data set of the preset neural network includes the voltage of the input signal and the diaphragm displacement generated by the loudspeaker under the excitation of the voltage. The signal type of the input signal exemplarily includes single frequency, sweep frequency, white noise, pink noise, speech signal and music signal, etc., and the voltage of the input signal should cover the voltage range supported by the loudspeaker. Further, the displacement signal of the loudspeaker diaphragm is measured by a laser vibration measuring instrument device to obtain the training data set corresponding to the voltage and displacement, and the preset neural network is trained.
[0205] Exemplarily, the data set collection process and the model training process of the preset neural network are shown in Figure 10 In the data set collection process, the voltage is input to the loudspeaker, and the corresponding diaphragm displacement is measured, and in the model training process, the diaphragm displacement is taken as a feature, the voltage is taken as a label, and the preset neural network is trained.
[0206] In some embodiments, the loudspeaker compensation method provided in the present application applies a loudspeaker compensation device, which comprises a first compression module 301, a second compression module 302, a first dynamic module 303, a first nonlinear compensation module 304, a nonlinear displacement estimation module 305, a linear displacement estimation module 306, a nonlinear displacement prediction module 307, a linear displacement prediction module 308, and a compression processing module 309. Figure 11 A flowchart of the loudspeaker compensation method performed by each module in the loudspeaker compensation device is shown.
[0207] The nonlinear displacement estimation module 305 is configured to determine a nonlinear estimation displacement based on the input voltage of the input signal at a historical time. The nonlinear displacement prediction module 307 is configured to predict a nonlinear prediction displacement based on the plurality of nonlinear estimation displacements determined by the nonlinear displacement estimation module.
[0208] The first dynamic module 303 generates a corresponding signal based on the input voltage signal according to the requirement of the first nonlinear compensation module 304. For example, if the input required by the first nonlinear compensation module 304 is the third derivative of the linear displacement, the first dynamic module 303 calculates the third derivative of the linear displacement based on the input voltage signal. If the input required by the first nonlinear compensation module 304 is the linear displacement, the first dynamic module 303 calculates the corresponding linear displacement based on the input voltage signal.
[0209] In the case where the output of the first dynamic module 303 is the third derivative of the linear displacement, the linear displacement estimation module 306 performs a third-order integration based on the third derivative output by the first dynamic module 303 to obtain a linear estimation displacement. In the case where the output of the first dynamic module 303 is the linear displacement, the linear displacement estimation module 306 does not perform processing and determines the linear displacement output by the first dynamic module 303 as the linear estimation displacement.
[0210] The linear displacement prediction module 308 predicts a linear prediction displacement based on the plurality of linear estimation displacements determined by the linear displacement estimation module 306.
[0211] The first nonlinear compensation module 304 calculates a control voltage corresponding to the input signal based on the output of the first dynamic module 303, and the control voltage is used to excite the diaphragm displacement of the loudspeaker.
[0212] The first compression module 301 is configured to calculate and determine a displacement compression factor based on the outputs of the nonlinear displacement estimation module 305, the linear displacement estimation module 306, the nonlinear displacement prediction module 307, and the linear displacement prediction module 308.
[0213] The second compression module 302 is configured to calculate a voltage compression factor according to the input voltage and the control voltage output by the first nonlinear compensation module 304.
[0214] The compression processing module 309 is configured to perform compression processing on the input voltage of the input signal according to the displacement compression factor output by the first compression module 301 and the voltage compression factor output by the second compression module 302, to obtain a target voltage. Correspondingly, the first dynamic module 303 determines a target linear estimation displacement based on the target voltage, so that the control voltage calculated by the first nonlinear compensation module 304 based on the target linear estimation displacement can make the displacement of the diaphragm within the maximum displacement allowed by the diaphragm.
[0215] Based on Figure 11 The speaker compensation method proposed by the embodiments of the present application includes the following steps based on the modules of the speaker compensation device shown in the figure.
[0216] S1, the speaker compensation device acquires an input signal of a speaker in response to a speaker function call operation of a user.
[0217] S2, the speaker compensation device transmits the input signal to the second compression module 302, the first dynamic module 303, the nonlinear displacement estimation module 305, and the compression processing module 309, respectively.
[0218] S3, the compression processing module 309 performs compression processing on the voltage of the input signal according to the displacement compression factor calculated by the first compression module 301 and the voltage compression factor calculated by the second compression module 302, to obtain a target voltage, and sends the target voltage to the first dynamic module 303.
[0219] The implementation process of the first compression module 301 calculating the displacement compression factor includes the following steps S3.1-S3.7.
[0220] S3.1, the nonlinear estimation displacement module 305 determines a nonlinear estimation displacement corresponding to the input signal at a historical time according to the input voltage of the input signal at the historical time and the nonlinear parameters of the speaker, and sends the nonlinear estimation displacement to the first compression module 301 and the nonlinear displacement prediction module 307, respectively.
[0221] S3.2, the nonlinear displacement prediction module 307 determines a nonlinear prediction displacement according to the nonlinear estimation displacements at a plurality of continuous historical times and a first displacement prediction model, and sends the nonlinear prediction displacement to the first compression module 301.
[0222] S3.3, the first dynamic module 303 determines the linear estimated displacement corresponding to the input signal at the historical time according to the input voltage of the input signal at the historical time and the linear parameters of the loudspeaker, and sends to the linear displacement estimation module 306, which is sent to the first compression module 301 and the nonlinear displacement prediction module 308 respectively by the linear displacement estimation module 306.
[0223] Alternatively, the first dynamic module 303 determines the third derivative of the linear estimated displacement corresponding to the input signal at the historical time according to the input voltage of the input signal at the historical time and the linear parameters of the loudspeaker, and sends to the linear displacement estimation module 306. The linear displacement estimation module 306 performs third-order integration on the received third derivative to obtain the linear estimated displacement, and sends to the first compression module 301 and the nonlinear displacement prediction module 308 respectively.
[0224] Wherein, the process of determining the linear estimated displacement by the first dynamic module 303 is a process of nonlinear compensation for the input voltage. Since nonlinear compensation will amplify the obtained displacement, the linear estimated displacement is greater than the nonlinear estimated displacement for the same size of input voltage.
[0225] S3.4, the linear displacement prediction module 308 determines the linear predicted displacement according to the linear estimated displacement at the continuous plurality of historical times and the second displacement prediction model, and sends to the first compression module 301.
[0226] It should be noted that the order of execution of steps S3.1 and S3.3 in the embodiments of the present application is not limited specifically. S3.1 can be executed first, or S3.3 can be executed first, or they can be executed simultaneously.
[0227] S3.5, the first compression module 301 calculates the first gain according to the nonlinear estimated displacement, the linear estimated displacement, and the maximum diaphragm displacement.
[0228] Wherein, the first compression module 301 determines the ratio of the minimum value between the nonlinear estimated displacement and the maximum diaphragm displacement to the linear estimated displacement as the first gain.
[0229] It can be understood that the ratio based on the nonlinear estimated displacement and the linear estimated displacement can obtain the amplification after the nonlinear compensation for the input signal voltage in the displacement estimation dimension. By introducing the maximum diaphragm displacement, it can be ensured that even if the calculated nonlinear estimated displacement is greater than the maximum diaphragm displacement, the first gain obtained by calculating the maximum diaphragm displacement and the linear estimated displacement will not exceed the displacement range allowed by the diaphragm after the input signal voltage is compressed.
[0230] S3.6, the first compression module 301 calculates a second gain according to the nonlinear predicted displacement, the linear predicted displacement, and the maximum diaphragm displacement.
[0231] The first compression module 301 determines the ratio of the minimum value of the nonlinear predicted displacement and the maximum diaphragm displacement to the linear predicted displacement as the second gain.
[0232] It can be understood that, by comparing the nonlinear predicted displacement and the linear predicted displacement, the amplification of the input signal voltage after nonlinear compensation in the displacement prediction dimension can be obtained. By introducing the maximum diaphragm displacement, even if the calculated nonlinear predicted displacement is greater than the maximum diaphragm displacement, the second gain obtained by calculating the maximum diaphragm displacement and the linear predicted displacement can be used to compress the input signal voltage and perform nonlinear compensation without exceeding the allowable diaphragm displacement range.
[0233] S3.7, the first compression module 301 determines the minimum value of the first gain and the second gain as the displacement compression factor.
[0234] It can be understood that, by comparing the first gain obtained in the displacement estimation dimension and the second gain obtained in the displacement prediction dimension, the smaller gain is selected as the displacement compression factor, which can improve the compression effect of the input signal voltage and prevent the diaphragm displacement from exceeding the allowable displacement range.
[0235] The implementation process of the second compression module 302 to calculate the voltage compression factor includes the following steps S3.8-S3.9.
[0236] S3.8, the second compression module 302 obtains the control voltage of the input signal at the historical time output by the first nonlinear compensation module 304.
[0237] The first nonlinear compensation module 304 performs inverse derivation according to the linear estimated displacement or the third derivative of the linear estimated displacement calculated by the first dynamic module 303 and the nonlinear parameters of the loudspeaker, and calculates the control voltage used to control the loudspeaker to play the sound corresponding to the input signal at the historical time.
[0238] S3.9, the second compression module 302 determines the voltage compression factor according to the input voltage of the input signal at the historical time, the control voltage, and the preset maximum voltage.
[0239] The second compression module 302 determines the ratio of the minimum value of the input voltage and the preset maximum voltage to the control voltage as the voltage compression factor.
[0240] It can be understood that, based on the input voltage and the control voltage, the ratio can be obtained, and the change between the input voltage of the input signal and the control voltage obtained after the nonlinear compensation amplification processing can be obtained in the voltage dimension. By introducing the preset voltage maximum value, even if the input voltage is greater than the preset voltage maximum value, the voltage compression factor obtained by calculating the preset voltage maximum value and the control voltage can be used to compress the input voltage of the input signal, and the nonlinear compensation will not exceed the maximum signal voltage supported by the loudspeaker.
[0241] In this way, by combining the displacement estimation dimension, the displacement prediction dimension and the voltage dimension to obtain the displacement compression factor and the voltage compression factor, the input signal is subjected to multi-dimensional compression processing, which can avoid that the control voltage generated by the input signal exceeds the maximum signal voltage supported by the loudspeaker, and also avoid that the displacement generated when the loudspeaker is controlled based on the control voltage exceeds the maximum displacement of the diaphragm.
[0242] S4, the first dynamic module 303 determines the target linear estimated displacement according to the target voltage and the linear parameters of the loudspeaker, and sends the target linear estimated displacement to the first nonlinear compensation module 304.
[0243] Alternatively, the first dynamic module 303 determines the third derivative of the target linear estimated displacement according to the target voltage and the linear parameters of the loudspeaker, and sends the third derivative of the target linear estimated displacement to the first nonlinear compensation module 304.
[0244] S5, the first nonlinear compensation module 304 determines the target control voltage according to the target linear estimated displacement and the nonlinear parameters of the loudspeaker.
[0245] Alternatively, the first nonlinear compensation module 304 integrates the third derivative of the target linear estimated displacement to obtain the target nonlinear estimated displacement. Further, the first nonlinear compensation module 304 determines the target control voltage according to the target linear estimated displacement and the nonlinear parameters of the loudspeaker.
[0246] S6, the first nonlinear compensation module 304 outputs the control voltage for controlling the loudspeaker to play the sound corresponding to the input signal.
[0247] It should be noted that in the above steps S1-S6, the specific implementation of each module can refer to the description of the above embodiments of the present application, and will not be repeated here.
[0248] In the loudspeaker compensation device provided in the present application, a mixed feed control scheme of feedforward + feedback and a double feedback mechanism of displacement + voltage are adopted, the compression degree is adaptively controlled according to the output of the scheme, the phenomenon of over-compression and under-compression can be avoided, and the sound quality of the loudspeaker is ensured. Moreover, based on the nonlinear displacement prediction module and the linear displacement prediction module, the displacement trend in the next period of time is predicted according to the displacement data at the historical time, and the displacement can be accurately controlled without introducing time delay.
[0249] In some embodiments, Figure 12 Another flowchart for showing the execution of the loudspeaker compensation method by each module in the loudspeaker compensation device is shown. Compared with Figure 11 The loudspeaker compensation device shown in the figure is different from the above in that it comprises a second dynamic module and a second nonlinear compensation module.
[0250] The second dynamic module is configured to calculate the corresponding linear displacement according to the input voltage signal. The second nonlinear compensation module comprises a preset neural network, which is configured to output the corresponding control voltage according to the input linear displacement.
[0251] It should be noted that the preset neural network in the second nonlinear compensation module can refer to the above description of the embodiments of the present application, and will not be described here.
[0252] In Figure 11 The first nonlinear compensation module shown in the figure is obtained by inversely deducing the control voltage from the linear estimated displacement output by the first dynamic module and the nonlinear parameter of the loudspeaker at the current time. Figure 12 In the second nonlinear compensation module shown in the figure, the mapping relationship between the control voltage and the linear displacement under different scenes (temperature, signal type, etc.) is established in the preset neural network, and the control voltage is determined by the linear displacement output by the second dynamic module, which can overcome the abnormality of the control voltage caused by the error in the identification of the nonlinear parameter in some environments.
[0253] The above mainly introduces the scheme provided by the embodiments of the present application from the method aspect. In order to realize the above functions, it comprises the hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized in the form of hardware or combination of hardware and computer software. Whether a certain function is realized by hardware or computer software driven hardware depends on the specific application and design constraints of the technical scheme. Professional technicians can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0254] The embodiments of the present application can divide the function modules of the user equipment according to the above method examples. For example, each function module can be divided according to each function, or two or more functions can be integrated in one processing module. The integrated module can be realized in the form of hardware or in the form of a software function module. Optionally, the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division mode can be used.
[0255] Figure 13 A structural diagram of a loudspeaker compensation device provided by an embodiment of the present application is shown in FIG. 4. The loudspeaker compensation device is used to execute the loudspeaker compensation method described above. As shown in FIG. 4, the loudspeaker compensation device 40 includes a first compression unit 401, a second compression unit 402, a compression processing unit 403, a nonlinear compensation unit 404, and a control unit 405. Figure 13
[0256] The first compression unit 401 is configured to determine a displacement compression factor according to an input voltage of an input signal at a historical moment.
[0257] The second compression unit 402 is configured to determine a voltage compression factor according to a corresponding control voltage of the input signal at the historical moment.
[0258] The compression processing unit 403 is configured to determine a target voltage according to the displacement compression factor, the voltage compression factor, and a voltage of the input signal at a current moment, the target voltage being less than or equal to the voltage of the input signal at the current moment.
[0259] The nonlinear compensation unit 404 is configured to perform nonlinear compensation processing on the target voltage to determine a target control voltage.
[0260] The control unit 405 is configured to control the loudspeaker to play sound based on the target control voltage.
[0261] Optionally, as shown in FIG. 4, the loudspeaker compensation device 40 provided by the embodiment of the present application further includes a nonlinear displacement estimation unit 406 and a linear displacement estimation unit 407. Figure 13
[0262] The nonlinear displacement estimation unit 406 is configured to determine a nonlinear estimated displacement according to an input voltage of an input signal at a historical moment and nonlinear parameters of the loudspeaker.
[0263] The linear displacement estimation unit 407 is configured to determine a linear estimated displacement according to the input voltage of the input signal at the historical moment and linear parameters of the loudspeaker.
[0264] The first compression unit 401 is specifically configured to determine the displacement compression factor according to the nonlinear estimated displacement and the linear estimated displacement.
[0265] Optionally, as shown in Figure 13 The loudspeaker compensation device 40 provided by the embodiment of the present application further includes a nonlinear displacement prediction unit 408 and a linear displacement prediction unit 409.
[0266] The nonlinear displacement prediction unit 408 is configured to determine a nonlinear predicted displacement according to a plurality of nonlinear estimated displacements and a first displacement prediction model, wherein the plurality of nonlinear estimated displacements are corresponding to each of a plurality of time points continuous to a historical time point.
[0267] The linear displacement prediction unit 409 is configured to determine a linear predicted displacement according to a plurality of linear estimated displacements and a second displacement prediction model, wherein the plurality of linear estimated displacements are corresponding to each of a plurality of time points continuous to the historical time point.
[0268] The first compression unit 401 is specifically configured to determine a displacement compression factor according to the nonlinear predicted displacement and the linear predicted displacement.
[0269] Optionally, as shown in Figure 13 In the loudspeaker compensation device 40 provided by the embodiment of the present application, the first compression unit 401 is further configured to determine a first gain according to the nonlinear estimated displacement, the linear estimated displacement and the maximum diaphragm displacement, and determine a second gain according to the nonlinear predicted displacement, the linear predicted displacement and the maximum diaphragm displacement.
[0270] The first compression unit 401 is specifically configured to determine the minimum value of the first gain and the second gain as the displacement compression factor.
[0271] Optionally, as shown in Figure 13 In the loudspeaker compensation device 40 provided by the embodiment of the present application, the second compression unit 402 is specifically configured to determine a voltage compression factor according to the control voltage corresponding to the input signal of the historical time point, the input voltage and the maximum preset voltage.
[0272] Optionally, as shown in Figure 13 In the loudspeaker compensation device 40 provided by the embodiment of the present application, the nonlinear compensation unit 404 is specifically configured to determine a target linear estimated displacement corresponding to a target voltage, and determine a target control voltage according to the target linear estimated displacement and the nonlinear parameter of the loudspeaker at the current time point.
[0273] Optionally, as shown in Figure 13As shown, the loudspeaker compensation device 40 provided by the embodiments of the present application includes a nonlinear compensation unit 404, which is specifically configured to determine a target linear estimation displacement corresponding to a target voltage; and input the target linear estimation displacement into a preset neural network to obtain a target control voltage, which is trained based on voltages of input signals of multiple signal types and corresponding diaphragm displacements.
[0274] Optionally, as shown in the foregoing embodiments, the nonlinear displacement estimation unit 405 is specifically configured to obtain a diaphragm displacement and a vibration speed of the loudspeaker at a historical moment; determine nonlinear parameters of the loudspeaker at the historical moment according to the diaphragm displacement and the vibration speed; and determine a nonlinear estimation displacement according to an input voltage of an input signal at the historical moment and the nonlinear parameters of the loudspeaker at the historical moment. Figure 13
[0275] Through the description of the foregoing embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the foregoing functional units is taken as an example for illustration. In actual application, the foregoing functions can be completed by different functional units according to needs, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. The specific working processes of the foregoing described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here again.
[0276] The embodiments of the present application also provide a computer readable storage medium, which stores instructions, when a computer executes the instructions, the computer executes each step in the method flow shown in the foregoing method embodiments.
[0277] The embodiments of the present application provide a computer program product containing instructions, when the instructions are run on a computer, the computer executes the loudspeaker compensation method in the foregoing method embodiments.
[0278] The computer readable storage medium, for example, can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A specific exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. Of course, the storage medium can be a component of the processor. Suitable processors for the execution of a program of instructions include, by way of example, both general and special purpose microprocessors. The specific processor can also be a component of a special purpose computer or a component of a computer system, and can be a component of a special purpose computer or a component of a computer system. The aforementioned processing of instructions by the processor, and portions of the computer system, can be secured, for example, by a lock, a password, or a biometric security measure.
[0279] The device, the equipment computer readable storage medium and the computer program product in the embodiments of the present application can be applied to the above method, and the technical effects that can be obtained are also referable to the above method embodiments, which will not be described here again in the embodiments of the present application.
[0280] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited to this, any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A speaker compensation method, applied to electronic devices, characterized in that, The method includes: In response to the user's speaker function call, obtain the input signal from the speaker; Based on the control voltage corresponding to the input signal obtained at a historical moment, a voltage compression factor is determined, and the input voltage of the input signal is compressed to obtain a target voltage, wherein the target voltage is less than or equal to the input voltage. The target voltage is subjected to nonlinear compensation processing to determine the target control voltage, and the speaker is controlled to play sound based on the target control voltage.
2. The loudspeaker compensation method according to claim 1, characterized in that, The step of compressing the input voltage of the input signal to obtain the target voltage includes: The displacement compression factor is determined based on the input voltage of the input signal obtained at the historical moment. The input voltage of the input signal is compressed based on the displacement compression factor and the voltage compression factor to obtain the target voltage.
3. The loudspeaker compensation method according to claim 1, characterized in that, Determining the target control voltage includes: Based on the linear parameters of the loudspeaker and the target voltage, determine the target linear estimated displacement; The target control voltage is determined based on the target linear estimated displacement and the nonlinear parameters of the loudspeaker at the current moment.
4. A loudspeaker compensation method, characterized in that, The method includes: The displacement compression factor is determined based on the input voltage of the input signal at historical moments. The voltage compression factor is determined based on the control voltage corresponding to the input signal at the historical moment. The target voltage is determined based on the displacement compression factor, the voltage compression factor, and the input voltage of the input signal at the current moment, wherein the target voltage is less than or equal to the input voltage of the input signal at the current moment; The target voltage is subjected to nonlinear compensation processing to determine the target control voltage, and the speaker is controlled to play sound based on the target control voltage.
5. The loudspeaker compensation method according to claim 4, characterized in that, Determining the displacement compression factor based on the input voltage of the input signal at a historical time includes: The nonlinear estimated displacement is determined based on the input voltage of the input signal at the historical moment and the nonlinear parameters of the loudspeaker; Based on the input voltage of the input signal at the historical moment and the linear parameters of the loudspeaker, the linear estimated displacement is determined; The displacement compression factor is determined based on the nonlinear estimated displacement and the linear estimated displacement.
6. The loudspeaker compensation method according to claim 5, characterized in that, Determining the displacement compression factor based on the nonlinear estimated displacement and the linear estimated displacement includes: Based on multiple nonlinear estimated displacements and a first displacement prediction model, a nonlinear predicted displacement is determined, wherein the multiple nonlinear estimated displacements are the nonlinear estimated displacements at each of multiple times that are continuous with the historical time. Based on multiple linear estimated displacements and a second displacement prediction model, a linear predicted displacement is determined, wherein the multiple linear estimated displacements are the linear estimated displacements of each of multiple moments consecutive with the historical moment. The displacement compression factor is determined based on the nonlinear predicted displacement and the linear predicted displacement.
7. The loudspeaker compensation method according to claim 6, characterized in that, Determining the displacement compression factor based on the nonlinear estimated displacement and the linear estimated displacement includes: The first gain is determined based on the nonlinear estimated displacement, the linear estimated displacement, and the maximum value of the diaphragm displacement; The second gain is determined based on the nonlinear predicted displacement, the linear predicted displacement, and the maximum value of the diaphragm displacement; The minimum value of the first gain and the second gain is determined as the displacement compression factor.
8. The loudspeaker compensation method according to claim 4, characterized in that, Determining the voltage compression factor based on the control voltage corresponding to the input signal at the historical moment includes: The voltage compression factor is determined based on the control voltage, input voltage, and preset maximum voltage value corresponding to the input signal at the historical moment.
9. The loudspeaker compensation method according to any one of claims 4-8, characterized in that, The step of performing nonlinear compensation processing on the target voltage to determine the target control voltage includes: Based on the linear parameters of the loudspeaker and the target voltage, determine the target linear estimated displacement; The target control voltage is determined based on the target linear estimated displacement and the nonlinear parameters of the loudspeaker at the current moment.
10. The loudspeaker compensation method according to any one of claims 4-8, characterized in that, The step of performing nonlinear compensation processing on the target voltage to determine the target control voltage includes: Based on the linear parameters of the loudspeaker and the target voltage, determine the target linear estimated displacement; The target linear estimated displacement is input into a preset neural network to obtain the target control voltage. The preset neural network is trained based on the voltage of input signals of multiple signal types and the corresponding diaphragm displacement.
11. The loudspeaker compensation method according to any one of claims 5-7, characterized in that, The step of determining the nonlinear estimated displacement based on the input voltage of the input signal at a historical time and the nonlinear parameters of the loudspeaker includes: The diaphragm displacement and vibration velocity of the loudspeaker at the historical moment are obtained; The nonlinear parameters of the loudspeaker at the historical moment are determined based on the diaphragm displacement and the vibration velocity. The nonlinear estimated displacement is determined based on the input voltage of the input signal at the historical moment and the nonlinear parameters of the loudspeaker at the historical moment.
12. A loudspeaker compensation device, characterized in that, It includes a first compression unit, a second compression unit, a compression processing unit, a nonlinear compensation unit, and a control unit; The first compression unit is used to determine the displacement compression factor based on the input voltage of the input signal at a historical moment; The second compression unit is used to determine the voltage compression factor based on the control voltage corresponding to the input signal at the historical moment; The compression processing unit is used to determine a target voltage based on the displacement compression factor, the voltage compression factor, and the voltage of the input signal at the current moment, wherein the target voltage is less than or equal to the voltage of the input signal at the current moment. The nonlinear compensation unit is used to perform nonlinear compensation processing on the target voltage to determine the target control voltage; The control unit is used to control the speaker to play sound based on the target control voltage.
13. An electronic device, characterized in that, Including memory and processor; The memory and the processor are coupled; The memory is used to store computer program code, which includes computer instructions; When the processor executes the computer instructions, the electronic device performs the speaker compensation method as described in any one of claims 1-11.
14. A computer-readable storage medium storing instructions, characterized in that, When the instructions are executed on the electronic device, the electronic device performs the speaker compensation method as described in any one of claims 1-11.
15. A computer program product, characterized in that, Includes a computer program that, when run, causes the computer to perform the speaker compensation method as described in any one of claims 111.