Speaker displacement protection method and device, and computer-readable storage medium
A speaker displacement protection method, a speaker displacement protection device, and a computer-readable storage medium are provided. The speaker displacement protection method includes creating a target transfer function based on a real-time amplitude of the speaker and a fusion voltage relative to the combination device, determining target gains according to the target transfer function and a predetermined displacement threshold, and performing gain processing on an original audio signal input to the combination device based on the target gains, so as to provide displacement protection for the speaker. As such, accuracy of the speaker displacement protection is improved while audio distortion is reduced.
1 . A speaker displacement protection method, applied to a device comprising a power amplifier and a combination device comprising a speaker and a motor, comprising:
creating a target transfer function based on a real-time amplitude of the speaker and a fusion voltage relative to the combination device;
determining target gains according to the target transfer function and a predetermined displacement threshold; and
performing gain processing on an original audio signal input to the combination device based on the target gains, so as to provide displacement protection for the speaker;
wherein the determining the target gains according to the target transfer function and the predetermined displacement threshold comprises:
according to a predetermined state equation, creating a first transfer function of the fusion voltage relative to the combination device and a first real-time voltage of the speaker;
performing data fitting on the real-time amplitude of the speaker and the first real-time voltage of the speaker to create a second transfer function; and
creating the target transfer function through combining the first transfer function and the second transfer function.
2 . The speaker displacement protection method according to claim 1 ,
wherein the target transfer function is illustrated as follow:
H
^
x
(
f
,
t
)
=
C
(
f
,
t
)
H
x
(
f
)
=
U
(
f
)
Û
(
f
)
·
X
(
f
)
U
(
f
)
=
X
(
f
)
Û
(
f
)
;
where, Ĥ x (f,t) illustrates the target transfer function, C(f,t) illustrates the first transfer function, H x (f) illustrates the second transfer function, illustrates the fusion voltage relative to the combination device, illustrates a voltage of the speaker, and illustrates an amplitude of the speaker.
3 . The speaker displacement protection method according to claim 1 , wherein the determining the target gains according to the target transfer function and the predetermined displacement threshold comprises:
obtaining a first predicted displacement of the speaker based on the target transfer function and the fusion voltage relative to the combination device;
correcting the first predicted displacement of the speaker to obtain a second predicted displacement of the speaker;
comparing the second predicted displacement of the speaker with the predetermined displacement threshold to obtain displacement difference; and
adjusting a parameter of a band-pass filter according to the displacement difference to obtain the target gains, where the band-pass filter is configured to compress a voltage at a resonant frequency of the speaker.
4 . The speaker displacement protection method according to claim 3 , wherein after comparing the second predicted displacement of the speaker with the predetermined displacement threshold to obtain the displacement difference, the speaker displacement protection method further comprises:
comparing the displacement difference with a predetermined displacement difference threshold; and
when the displacement difference is greater than the predetermined displacement threshold, adjusting the parameter of the band-pass filter according to the displacement difference to obtain the target gains.
5 . The speaker displacement protection method according to claim 3 , wherein the correcting the first predicted displacement of the speaker to obtain the second predicted displacement of the speaker comprises:
obtaining a real-time current of the speaker and a second real-time voltage of the speaker; and
correcting the first predicted displacement of the speaker according to the real-time current of the speaker and the second real-time voltage of the speaker to obtain the second predicted displacement of the speaker.
6 . The speaker displacement protection method according to claim 1 , wherein the determining the target gains according to the target transfer function and the predetermined displacement threshold comprises:
performing frequency division on the original audio signal input to the combination device to obtain frequency band signals;
determining the target gains respectively corresponding to the frequency band signals according to the target transfer function and the predetermined displacement threshold; and
the performing the gain processing on the original audio signal input to the combination device based on the target gains comprises:
performing the gain processing on the frequency band signals of the original audio signal input to the combination device through using the target gains in sequence according to a predetermined sequence.