The application be propose on December 15th, 2014 it is entitled " a kind of motor control method in mobile terminal and
The divisional application of the Chinese invention patent application 201410778009.5 of device ".
Embodiment
The embodiment of the present invention is described in detail with reference to Figure of description.
As shown in figure 1, the motor control method flow chart in a kind of mobile terminal provided in an embodiment of the present invention, this method
Including:
Step 101:Detect the signal characteristic of the audio signal of input;
Step 102:According to the mapping relations of signal characteristic and drive signal, determine special with the signal of the audio signal
Drive signal corresponding to sign;
Step 103:Worked according to the drive signal drive motor.
The audio signal detected in the embodiment of the present invention can be data signal, or analog signal, below only with
For audio signal to be described exemplified by data signal, processing mode when audio signal is analog signal is numeral with audio signal
Processing mode during signal is identical, will not be repeated here.
Motor can work under different driving voltages, and the vibration frequency of motor and vibratory output be not under different driving voltage
Together.Driving voltage can be on a timeline continuous or discrete in drive signal.Therefore can be by detecting sound
The signal characteristic of frequency signal generate one with the signal characteristic corresponding to drive signal control motor different in different time generation
Vibration frequency and vibratory output, to reach the purpose that motor vibrations change and changed with signal characteristic in audio signal.Such as Fig. 2 institutes
Show, illustrate motor vibrations amount and vibration frequency and the relation of motor driving voltage.From figure 2 it can be seen that motor is being marked
Claim under driving voltage, vibratory output reaches maximum.The driving voltage of motor is higher or lower than this nominal driving voltage, motor
Vibratory output can all decline.The vibration frequency of motor can also change with driving voltage simultaneously.Driving voltage gets over high vibration
Frequency is higher, conversely, vibration frequency is lower.Namely when driving voltage is less than the vibratory output of motor " during nominal driving voltage "
It is weak, and vibration frequency is low.When reaching nominal driving voltage, vibration frequency reaches nominal vibration frequency, while vibratory output reaches
To maximum.When driving voltage is higher than nominal driving voltage, vibratory output reduces, but vibration frequency continues to improve.
The drive signal of motor has a variety of generating modes, prior art mainly by PWM (pulse width modulation,
Pulse-Width Modulation) signal is filtered to form direct current signal, form motor drive signal.Pwm signal is one
Kind pulse square wave signal, the frequency of pulse square wave signal is identical, but signal dutyfactor, i.e., each pulse square wave signal week
The duration of high level is adjustable in phase.Pwm signal is high-frequency signal, can typically reach MHz ranks, in motor
On the inductive coil in portion and the input pin of motor in the presence of filter capacitor, the pwm signal of high frequency can be filtered into directly
The drive signal of stream.The drive signal that direct current is formed after the pulse square wave signal filtering of different dutycycles is different, difference
Drive signal be carried on motor and can produce different vibrating effects.
In step 101, the signal characteristic of audio signal can refer to the signal energy of audio signal, or refer to that audio is believed
Number signal frequency.
In step 102, when the signal characteristic of audio signal refers to the signal energy of audio signal, signal characteristic is believed with driving
Number mapping relations be signal energy and the mapping relations of drive signal.
The signal energy of an audio signal can be calculated according to Parseval's theorem.For example, for audio signal x (k),
Its signal energy isDetermine input audio signal signal energy after, according to signal energy with
The mapping relations of drive signal, drive signal corresponding with signal energy is determined, and driven according to the drive signal determined
Motor operations.Signal energy and the mapping relations of drive signal are determined according to actual conditions, can close their mapping
System is represented with the form of function.Preferably, the mapping of signal energy and drive signal can be represented with unitary linear function, i.e.,
U=kx+b, wherein U are drive signal, and k is default slope, and x is signal energy, and b is preset initial value.Difference can be set
K and b value, obtain different signal energies and the mapping relations of drive signal.Reaching digital sound when needing signal energy
During maximum (i.e. the 0dB) of frequency signal, the drive signal of motor causes motor to be in the state of maximum vibration amount, can now incite somebody to action
B is arranged to 1.8V (the nominal driving voltage of 700 turns of motor) or 3V (the nominal driving voltage of 1000 turns of motor).
Because audio signal is extremely difficult to the maximum rating of signal energy, the signal energy of general digital audio and video signals maintains
In -6dB or so, it can now set when signal energy reaches more than -6dB, drive signal caused by audio signal is driven
The vibratory output of motor reaches maximum.Can also be when the signal energy of audio signal reach more than -6dB, setting signal energy reaches
When more than to -6dB, caused drive signal make it that the vibratory output of motor is smaller, can be the half vibratory output of maximum vibration amount,
So that user has more preferable Consumer's Experience.For example, when signal energy is reached more than -6dB, produce one and nominally driven less than motor
The driving voltage of voltage, make the motor operations that nominal driving voltage is 1.8V under 1.5V driving voltage.
Or when the signal energy of audio signal reaches certain threshold value (such as -12dB), just produce drive signal driving
Motor vibrations.So mapping relations of can setting signal energy and drive signal so that signal energy reaches the threshold of setting
During value, such as when signal energy is reached more than -12dB, the vibration of drive signal drive motor is just produced, signal energy is less than setting
Threshold value when, do not produce drive signal drive motor work.
Signal energy and the mapping relations of drive signal can also have other forms, but no matter which kind of form, is obtaining sound
After the signal energy of frequency signal, a corresponding drive signal can be obtained according to signal energy.
Audio signal is formed by the Signal averaging of different frequency, out of phase and various amplitude, in order to
The motor voltage of a variety of drive motors is enough determined by the signal energy of an audio signal, audio signal can at least be drawn
It is divided into the audio sub-signals of a frequency range, and detects the signal energy of the audio sub-signals of each frequency range.While each frequency range
The corresponding motor of audio sub-signals, for the audio sub-signals of a frequency range, determine the signal energy of the audio sub-signals
Drive signal corresponding to amount, and the motor operations according to corresponding to the drive signal drives the audio sub-signals.
The audio signal received can be divided into the audio sub-signals of different frequency ranges by different wave filters.Often
Individual wave filter is exported after the audio signal filtering of input as the audio sub-signals of only one frequency range.The frequency of audio signal
Scope is generally 20Hz-20000Hz.The audio signal of input can be divided into following frequency range in the embodiment of the present invention:It is extremely low
Frequently, from 20Hz-40Hz, this band frequency is referred to as very low frequencies;Low frequency, from 40Hz-80Hz, this band frequency is referred to as low frequency;Middle low frequency, from
Low frequency during this band frequency of 80Hz-160Hz is referred to as;Intermediate frequency, from 160Hz-1280Hz, this band frequency is referred to as intermediate frequency;Medium-high frequency, from
This band frequency of 1280Hz-2560Hz is referred to as medium-high frequency;High frequency, from 2560Hz-5120Hz, this band frequency is referred to as high frequency;Extremely high frequency,
From 5120Hz-20000Hz, this band frequency is referred to as extremely high frequency.It is of course also possible to there are other dividing modes, do not limit herein.
After determining drive signal corresponding with the signal energy of the audio sub-signals of each frequency range respectively, according to each
Motor corresponding to drive signal driving corresponding to the signal energy of the audio sub-signals of frequency range.
Preferably, the audio sub-signals signal energy of different frequency range is different from the mapping relations of drive signal.Believe in audio
Number it is divided into after the audio sub-signals of multiple frequency ranges, can is that the audio sub-signals of different frequency range set different signal energy
Amount and the mapping relations of drive signal so that the audio sub-signals of different frequency range corresponding drive signal in identical signal energy
It is different.For example, under identical signal energy, drive signal corresponding to the signal energy of the audio sub-signals of low-frequency range can be set
That puts is higher, and by corresponding to the signal energy of the audio sub-signals of high band drive signal set it is lower, so in phase
With under signal energy, the vibratory output of the motor of the audio sub-signals driving of low-frequency range can be higher than shaking for the audio sub-signals of high band
Momentum.For another example the signal energy pair of the audio sub-signals of A frequencies or the audio sub-signals higher than B frequencies can be will be less than
The drive signal answered is set to 0, so after the audio sub-signals less than A frequencies and more than B frequencies are obtained, does not produce driving letter
Number, motor would not produce vibration.
For another example audio signal is divided into three frequency ranges, respectively the first frequency range, the second frequency range and the 3rd frequency range, its
In the first frequency range the signal energy of audio sub-signals and the mapping relations of drive signal be U1=k1x+b1, wherein U1For driving
Signal, k1For default slope, x is signal energy, b1For preset initial value;The signal energy of the audio sub-signals of second frequency range
Mapping relations with drive signal are U2=k2x+b2, wherein U2For drive signal, k2For default slope, x is signal energy, b2
For preset initial value;The signal energy of the audio sub-signals of 3rd frequency range and the mapping relations of drive signal are U3=k3x+b3, its
Middle U3For drive signal, k3For default slope, x is signal energy, b3For preset initial value.Now audio of each frequency range
The signal energy of signal is different from the mapping relations of drive signal, if now the first frequency range, the second frequency range and the 3rd frequency range
Under identical circumstances, drive signal corresponding to signal energy is also just different, is so achieved that according to different frequencies for signal energy
The audio sub-signals of section produce different drive signals.
In step 102, it can also be detected the audio signal of input is divided into after the audio sub-signals of multiple frequency ranges
The signal energy of frequency highest audio signal in the audio sub-signals of each frequency range, and only the audio sub-signals of each frequency range
Drive signal corresponding to the signal energy of middle frequency highest audio signal is exported to motor.Now multiple frequencies are mixed with one
In the audio signal of section, each frequency range only has a maximum vibration, realizes using human ear to the quick of high-energy audio signal
Perception, when the audio signal of highest energy occurs, drive motor is vibrated.Specifically, for the audio sub-signals of a frequency range,
Signal energy corresponding to the audio signal of each frequency in the audio sub-signals is determined, and is believed according to the audio of each frequency
Signal energy corresponding to number determines a peak signal energy;Determine drive signal corresponding to the peak signal energy.
In step 102, when the signal characteristic of audio signal refers to signal frequency, the mapping of signal characteristic and drive signal is closed
System is signal frequency and the mapping relations of drive signal.Audio signal is at least divided into the audio sub-signals of a frequency range, and
It is determined that in the audio sub-signals of each frequency range the maximum audio signal of signal energy signal frequency, determined according to the signal frequency
Go out corresponding drive signal.By by the audio sub-signals frequency range corresponding with the audio sub-signals of each frequency in each frequency range
Associate, realize the relation for making user more intuitively experience frequency change and vibratory output change in audio signal.Specifically, pin
To the audio sub-signals of a frequency range, signal energy corresponding to the audio signal of each frequency in the audio sub-signals is determined
Amount, and the signal energy according to corresponding to the audio signal of each frequency determines signal frequency corresponding to peak signal energy;
The drive signal U of signal frequency according to corresponding to below equation determines the peak signal energyf:
Wherein, f is signal frequency, U corresponding to the peak signal energymaxFor motor corresponding to the audio sub-signals
Operating voltage maximum, UminFor the minimum value of the operating voltage of motor corresponding to the audio sub-signals, m is the sound
The minimum frequency of frequency subsignal, M are the peak frequency of the audio sub-signals.
For example, the frequency range of an audio sub-signals is 200Hz-500Hz, the sound in the audio sub-signals at 350Hz
The signal energy highest of frequency signal.And the operating voltage range of motor is 1.5V-3V corresponding to the audio sub-signals of this frequency range.Can
To calculate frequency as drive signal U corresponding to 350Hz audio signalf:
Uf={ (350-200)/(500-200) } * (3-1.5)+1.5=2.25 (V)
In step 103, the drive signal drive motor determined according to step 102 works finally.Preferably, will be defeated
When the audio signal entered is divided into the audio sub-signals of multiple frequency ranges, the drive signal determined according to each audio sub-signals drives
Move motor operations corresponding to each audio sub-signals.
As shown in figure 3, the embodiment of the present invention provides the motor drive signal generation method flow chart in a kind of mobile terminal,
Including:
Step 301, the drive signal according to corresponding to source audio signal generation, and establish the source audio signal and the drive
The mapping relations of dynamic signal.
In step 301, after source audio signal is received, the motor control in a kind of mobile terminal provided according to Fig. 1
Method generates drive signal corresponding with the source audio signal, establishes the mapping relations of source audio signal and drive signal.
For example, vibration mould of the corresponding drive signal of " the train sound is blown a whistle " generation received when drive motor works
Formula is arranged to lasting dither, can now store train sound and blow a whistle and the mapping relations of lasting dither.
After target audio signal is received, the target audio signal and source audio signal are subjected to audio signal
Match somebody with somebody, if the match is successful, generate drive signal corresponding with the source audio signal that the target audio signal matches, and drive
Motor operations.
Or when reception system instruction, determine the source audio signal indicated in the system command;Generation and the system
Drive signal drive motor corresponding to the source audio signal indicated in instruction works.
The mapping relations of source audio signal and drive signal can certainly be manually set, i.e., believed for different source audios
Number, preset different vibration modes.For example, by vibration mould of the drive signal when drive motor works corresponding to " shot "
Formula is arranged to become weak after once shaking by force to shake and terminate rapidly;By drive signal corresponding to " sport car motor roar " in driving horse
It is set as lasting low-frequency vibration etc. up to vibration mode during work.
For above method flow, the embodiment of the present invention also provides the controller for motor in a kind of mobile terminal, the dress
The particular content put is referred to above method implementation, will not be repeated here.
As shown in figure 4, the embodiment of the present invention provides the controller for motor in a kind of mobile terminal, including
Detection unit 401, the signal characteristic of the audio signal for detecting input;
Drive signal determining unit 402, for the mapping relations according to signal characteristic and drive signal, determine with it is described
Drive signal corresponding to the signal characteristic of audio signal;
Driver element 403, for being worked according to the drive signal drive motor.
Preferably, the detection unit 401 is used for:
The audio signal is at least divided into the audio sub-signals of a frequency range, and detects the audio son letter of each frequency range
Number signal characteristic.
Preferably, the signal characteristic is the signal energy of the audio signal;
The drive signal determining unit 402 is used for:
For the audio sub-signals of a frequency range, driving letter corresponding to the signal energy of the audio sub-signals is determined
Number.
Preferably, the signal characteristic is the signal energy of the audio signal;
The drive signal determining unit 402 is used for:
For the audio sub-signals of a frequency range, determine that the audio signal of each frequency in the audio sub-signals is corresponding
Signal energy, and the signal energy according to corresponding to the audio signal of each frequency determines a peak signal energy;
Determine drive signal corresponding to the peak signal energy.
Preferably, the signal characteristic is the signal frequency of the audio signal;
The drive signal determining unit 402 is used for:
For the audio sub-signals of a frequency range, determine that the audio signal of each frequency in the audio sub-signals is corresponding
Signal energy, and the signal energy according to corresponding to the audio signal of each frequency determines signal corresponding to peak signal energy
Frequency;
The drive signal U of signal frequency according to corresponding to below equation determines the peak signal energyf:
Wherein, f is signal frequency, U corresponding to the peak signal energymaxFor motor corresponding to the audio sub-signals
Operating voltage maximum, UminFor the minimum value of the operating voltage of motor corresponding to the audio sub-signals, m is the sound
The minimum frequency of frequency subsignal, M are the peak frequency of the audio sub-signals.
For above method flow, the embodiment of the present invention also provides a kind of drive signal generating means, the device it is specific
Content is referred to above method implementation, will not be repeated here.
As shown in figure 5, the embodiment of the present invention provides the motor drive signal generating means in a kind of mobile terminal, including:
Map unit 501, for the drive signal according to corresponding to source audio signal generation, and establish the source audio signal
With the mapping relations of the drive signal.
Preferably, shown map unit 501 is additionally operable to:
After receiving target audio signal, the target audio signal and source audio signal are subjected to audio signals match,
If the match is successful, drive signal corresponding with the source audio signal that the target audio signal matches is generated, and drive horse
Up to work.
Preferably, shown map unit 501 is additionally operable to:
Reception system instructs, and determines the source audio signal indicated in the system command;
Generation drive signal drive motor work corresponding with the source audio signal indicated in the system command.
In summary, the method provided according to embodiments of the present invention, the signal characteristic of the audio signal by detecting input,
According to the mapping relations of signal characteristic and drive signal, drive signal corresponding with the signal characteristic of audio signal is determined, it is real
Show and the signal characteristic of audio signal is converted into drive signal, worked according to drive signal drive motor, realizing to drive
Signal is converted into motor vibrations, embodies the signal characteristic of audio signal in the form of motor vibrations so as to finally realize.By
It is continually changing in the signal characteristic of audio signal, therefore different drive signal drive motor work can be produced, can be with
The auditory tone cues of different event, different volumes, different frequency is converted to vibration prompt, or even allows the vibration of motor with sound
Change real-time change, so as to abundant Consumer's Experience.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The shape for the computer program product that usable storage medium is implemented on (including but is not limited to magnetic disk storage and optical memory etc.)
Formula.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.