Driving signal adjustment method and apparatus, and electronic device
Patent Information
- Application Number
- CN202510577404.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]理想谐振频率通常是根据马达的设计标准来制定的,然而,在实际生产和应用中,由于马达制造工艺的差异以及不同工作环境的影响,导致所制造出的单体马达的实际谐振频率并非精确地等同于理想谐振频率,而是在理想谐振频率的附近波动,导致马达振动节奏点与音乐节拍无法对齐,影响了用户的使用体验
[0010]本公开各实施例提供的驱动信号调整方法,基于马达的实际谐振频率和理想谐振频率,自适应调整马达驱动信号的信号频率,使得马达振动节奏点与音乐节拍保持对齐,提高马达振动效果。
Smart Images

Figure CN123011008A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of motor control technology, and in particular to a method, apparatus, electronic device, and storage medium for adjusting drive signals. Background Technology
[0002] In the field of tactile feedback in electronic products, especially in scenarios involving vibration feedback, precise adjustment of the drive signal plays a crucial role in improving the user experience. With the continuous development of electronic devices, users have increasingly higher requirements for the quality of tactile feedback, making the optimization of drive signal adjustment technology an important research direction in this field.
[0003] In existing electronic products, such as mobile phones and tablets, haptic feedback is often achieved through linear resonant motors (LRAs). These electronic devices generally use I2S (Inter-Integrated Circuit Sound) data transmission, which includes both audio data and vibration waveform data. The user's haptic feedback experience is optimal when the motor's vibration beat is aligned with the music beat.
[0004] The ideal resonant frequency is usually determined according to the design standards of the motor. However, in actual production and application, due to differences in motor manufacturing processes and the influence of different working environments, the actual resonant frequency of the manufactured single motor is not exactly the same as the ideal resonant frequency, but fluctuates around the ideal resonant frequency. This causes the motor's vibration rhythm point to be out of sync with the music beat, affecting the user experience. Summary of the Invention
[0005] In view of this, the present disclosure provides a drive signal adjustment scheme that can adaptively adjust the motor drive signal so that the motor vibration rhythm point is aligned with the music beat, thereby improving the motor vibration effect.
[0006] According to a first aspect of this disclosure, a method for adjusting a drive signal is provided, comprising: acquiring a plurality of original data frames of an original drive signal; resampling the plurality of original data frames based on the actual resonant frequency of a motor and the ideal resonant frequency of the motor to obtain a plurality of resampled data frames; and performing padding or discarding processing on at least one of the plurality of resampled data frames according to the result of comparing the actual resonant frequency of the motor with the ideal resonant frequency of the motor to obtain a target drive signal of the original drive signal; wherein, if the actual resonant frequency of the motor is greater than the ideal resonant frequency of the motor, data padding processing is performed on at least one of the plurality of resampled data frames, or if the actual resonant frequency of the motor is less than the ideal resonant frequency of the motor, data discarding processing is performed on at least one of the plurality of resampled data frames.
[0007] According to a second aspect of this disclosure, a drive signal adjustment device is provided, comprising: an acquisition module for acquiring a plurality of original data frames of an original drive signal; a resampling module for resampling the plurality of original data frames based on the actual resonant frequency of a motor and the ideal resonant frequency of the motor to obtain a plurality of resampled data frames; and an adjustment module for performing padding or discarding processing on at least one of the plurality of resampled data frames according to the result of comparing the actual resonant frequency of the motor with the ideal resonant frequency of the motor, to obtain a target drive signal of the original drive signal, wherein if the actual resonant frequency of the motor is greater than the ideal resonant frequency of the motor, data padding processing is performed on at least one of the plurality of resampled data frames; or, if the actual resonant frequency of the motor is less than the ideal resonant frequency of the motor, data discarding processing is performed on at least one of the plurality of resampled data frames.
[0008] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor, a communication interface, a memory, and a bus, wherein the processor, the communication interface, and the memory communicate with each other via the bus; the memory is used to store at least one executable instruction, the executable instruction causing the processor to perform an operation corresponding to the method described in the first aspect.
[0009] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions that, when executed by a processor, cause the processor to perform the method as described in the first aspect.
[0010] The drive signal adjustment method provided in the embodiments of this disclosure adaptively adjusts the signal frequency of the motor drive signal based on the actual resonant frequency and the ideal resonant frequency of the motor, so that the vibration rhythm point of the motor is aligned with the music beat, thereby improving the vibration effect of the motor. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings.
[0012] Figure 1 This is a comparison chart of audio data and vibration waveform data of a standard motor.
[0013] Figure 2 This is a flowchart illustrating a drive signal adjustment method as an exemplary embodiment of the present disclosure.
[0014] Figures 3A to 3B This is a schematic diagram illustrating data filling and data discarding processes as exemplary embodiments of this disclosure.
[0015] Figure 4 This is a flowchart illustrating a drive signal adjustment method according to another exemplary embodiment of the present disclosure.
[0016] Figure 5 This is a flowchart illustrating a drive signal adjustment method according to another exemplary embodiment of the present disclosure.
[0017] Figures 6A to 6D The diagram illustrates the effects of data filling and data discarding processes, which are part of another exemplary embodiment of this disclosure.
[0018] Figure 7 This is a flowchart illustrating a drive signal adjustment method according to another exemplary embodiment of the present disclosure.
[0019] Figure 8 This is a flowchart illustrating a drive signal adjustment method according to another exemplary embodiment of the present disclosure.
[0020] Figures 9A to 9B This is an illustration showing the effect of data filling and discarding processing as another exemplary embodiment of this disclosure.
[0021] Figure 10 This is a frame diagram of a drive signal adjustment device that is an exemplary embodiment of the present disclosure.
[0022] Figure 11 A frame diagram of an electronic device that is an exemplary embodiment of this disclosure. Detailed Implementation
[0023] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and thoroughly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art should fall within the protection scope of the present invention.
[0024] Reference is made to the accompanying drawings, which form part of the detailed description and illustrate exemplary embodiments. Furthermore, it should be understood that other embodiments may be utilized, and structural and / or logical changes may be made without departing from the scope of the claimed subject matter. It should also be noted that orientations and references (e.g., up, down, top, bottom, etc.) may be used merely to facilitate the description of features in the drawings. Therefore, the following detailed description is not to be construed in a limiting sense, and the scope of the claimed subject matter is defined only by the appended claims and their equivalents.
[0025] Numerous details are set forth in the following description. However, it will be apparent to those skilled in the art that the embodiments described herein can be practiced without these specific details. In some instances, well-known methods and apparatus are shown in block diagram form rather than in detail to avoid obscuring the embodiments described herein. Throughout this specification, references to “embodiment,” “one embodiment,” or “some embodiments” mean that a particular feature, structure, function, or characteristic described in connection with that embodiment is included in at least one embodiment herein. Therefore, the phrases “in an embodiment,” “in one embodiment,” or “some embodiments” appearing throughout this specification do not necessarily refer to the same embodiment. Furthermore, in one or more embodiments, particular features, structures, functions, or characteristics can be combined in any suitable manner. For example, a first embodiment can be combined with a second embodiment in any way that does not mutually exclude particular features, structures, functions, or characteristics associated with two embodiments.
[0026] As used in the description and appended claims, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0027] The terms “coupling” and “connection”, along with their derivatives, are used herein to describe functional or structural relationships between components. It should be understood that these terms are not intended to be synonyms for each other. Rather, in certain embodiments, “connection” can be used to indicate that two or more elements are in direct physical, optical, or electrical contact with each other. “Coupling” can be used to indicate that two or more elements are in direct or indirect physical or electrical contact with each other (with other intermediary elements between them), and / or that two or more elements cooperate or interact with each other (e.g., as in a causal relationship).
[0028] As used herein, the terms “above,” “below,” “between,” and “on” refer to the relative position of a component or material with respect to other components or materials, where such physical relationships are noteworthy. For example, in the context of materials, a material positioned above or below another material may be in direct contact with it, or may have one or more intermediate materials. Furthermore, a material positioned between two materials may be in direct contact with both layers, or may have one or more intermediate layers. In contrast, a first material or material “on” a second material or material is in direct contact with that second material / material. Similar distinctions are made in the context of component assembly.
[0029] As described throughout this document and in the claims, a list of items connected by the terms “at least one of” or “one or more of” may mean any combination of the listed items. For example, the phrase “at least one of A, B, or C” may mean A; B; C; A and B; A and C; B and C; or A, B, and C.
[0030] The terms "circuit" or "module" can refer to one or more passive and / or active components arranged to cooperate with each other to provide a desired function. The term "signal" can refer to at least one current signal, voltage signal, or magnetic signal. The terms "substantially," "close to," "approximately," "near," and "about" generally refer to a value + / - of the target value. Within 10%.
[0031] In modern electronic devices, precise adjustment of drive signals is crucial for ensuring device performance and user experience. This is especially true in applications involving audio and haptic feedback, where the frequency and waveform of the drive signal directly affect the device's output. For example, in devices such as linear resonant actuators (LRAs), adjusting the frequency of the drive signal can significantly influence the intensity and response speed of the vibration feedback (see reference). Figure 1 The image shows a comparison of audio data and vibration waveform data of a motor (or standard motor) with an ideal resonant frequency.
[0032] Specifically, the ideal resonant frequency of a motor is determined according to the motor's design standards. For example, if the ideal resonant frequency f0_Std of a motor is set to 170Hz, due to differences in motor manufacturing processes and the influence of different working environments, the actual resonant frequency f0 of a single motor usually fluctuates around the ideal resonant frequency f0_Std, typically around 170±10Hz.
[0033] Because the motor has a relatively high Q value, to ensure the motor vibration effect, the signal frequency of the motor drive signal needs to be adjusted to match the actual resonant frequency (f0) of the motor. However, adjusting the signal frequency will cause changes in the amount of data in the drive signal, resulting in changes in the playback duration. This will affect the rhythm of the motor vibration and the touch feedback effect of the electronic device.
[0034] Current drive signal adjustment methods on the market typically employ global frequency adjustment, which involves uniformly changing the frequency of the entire signal. However, this approach cannot meet the need for independent adjustment of each frame, especially in cases requiring frame-by-frame calibration. Global adjustment methods can lead to signal distortion or frequency mismatch. Furthermore, existing frequency adjustment methods often fail to effectively handle frequency differences between frames when processing I2S data, resulting in signal discontinuity and performance degradation.
[0035] Therefore, there is an urgent need for a drive signal adjustment method that can perform frame-by-frame calibration of I2S data in order to achieve precise frequency control of each frame of signal and improve the accuracy and stability of the drive signal.
[0036] The specific implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.
[0037] Drive signal adjustment method
[0038] Figure 2 The processing flow of the drive signal adjustment method, which is an exemplary embodiment of this disclosure, mainly includes the following steps:
[0039] Step 202: Obtain multiple raw data frames of the raw drive signal.
[0040] In some embodiments, the motor includes a modulated linear resonant motor (LRA) for providing tactile feedback to electronic devices (such as mobile phones, tablets, etc.), wherein the original drive signal of the motor includes a vibration drive signal.
[0041] In some embodiments, each raw data frame of the raw drive signal can be received frame by frame in a real-time acquisition manner, and each raw data frame has the same target frame length.
[0042] In other embodiments, all data in the original drive signal can be acquired at once, and the original drive signal can be segmented according to the target frame length to obtain each original data frame of the original drive signal.
[0043] refer to Figure 3A and Figure 3B As shown in the example, the original drive signal of the motor can be sampled and processed by a low-pass filter according to the given sampling frequency and target frame length to obtain the original data frame #1, original data frame #2, ..., original data frame #12 in sequence.
[0044] In this embodiment, the target frame length is used to identify the number of sampling points contained in the original data frame. In principle, the number of sampling points in each original drive signal is consistent. In the following description, a target frame length of 960 sampling points will be used as an example. Those skilled in the art can adjust the target frame length in each data frame arbitrarily according to actual needs, and this disclosure does not impose any limitations on this.
[0045] In some embodiments, denoising processing can be performed on each acquired raw data frame to improve the effect of drive signal adjustment.
[0046] Step 204: Based on the actual resonant frequency and the ideal resonant frequency of the motor, resample multiple original data frames to obtain each resampled data frame corresponding to each original drive signal.
[0047] In some embodiments, depending on factors such as actual signal adjustment requirements and / or hardware configuration conditions, each original data frame or each resampled data frame may be marked as a zero data frame or a non-zero data frame before or after the resampling step (i.e. before or after step 204) to improve the efficiency of drive signal adjustment processing.
[0048] Specifically, any one data frame to be processed in each original data frame or each resampled data frame can be determined. Based on a given zero data range, each data in the data frame to be processed is identified. If all the data in the data frame to be processed is identified to fall within the zero data range, the data frame to be processed is marked as a zero data frame. If at least one data in the data frame to be processed is identified not to fall within the zero data range, the data frame to be processed is marked as a non-zero data frame.
[0049] In some embodiments, when any original data frame is determined as the data frame to be processed, each non-zero data in the data frame to be processed that does not fall within the zero data range can be identified, and resampling processing can be performed on all non-zero data in the data frame to be processed to obtain a resampled data frame of the data frame to be processed. Therefore, this embodiment improves the resampling processing efficiency of the original data frame by identifying each non-zero data in the data frame to be processed before performing resampling processing, and only performing resampling on the portion of non-zero data in the data frame to be processed, ignoring the portion of zero data in the data frame to be processed.
[0050] In some embodiments, the zero data range can be set to ±50 millivolts.
[0051] In this embodiment, if all data in the data frame to be processed falls within the zero data range, the data frame to be processed can be marked as a zero data frame (see reference). Figure 3A and Figure 3B In the example, the original data frames #7, #8, and #9 are marked as "0"; if all data in the data frame to be processed does not fall within the zero data range, this data frame to be processed can be marked as a non-zero data frame (see reference). Figure 3A and Figure 3B In the example, the original data frames #1 to #6 and #10 to #12 are marked as "1". If the data frame to be processed contains both data that falls within the zero data range and data that does not fall within the zero data range, then this data frame to be processed is marked as a mixed data frame.
[0052] In practical applications, if the data frame to be processed is marked as a zero data frame, then no resampling processing is performed on the data frame to be processed; if the data frame to be processed is marked as a non-zero data frame, then resampling processing is performed on all data in the data frame to be processed; if the data frame to be processed is marked as a mixed data frame, the non-zero data portion in the data frame to be processed can be identified first, and resampling processing can be performed only on the non-zero data portion in the data frame to be processed, thereby improving the efficiency of resampling processing.
[0053] In some embodiments, waveform reshaping (or waveform reprocessing) of each original data frame may be performed before resampling of each original data frame to obtain each reshaped data frame (see reference). Figure 3A and Figure 3B The data frames s1, s2, ..., s12 are reshaped to improve the effect of driving signal adjustment.
[0054] In some embodiments, the ideal resonant frequency is determined according to the motor design standards. Those skilled in the art can set the ideal resonant frequency according to the motor manufacturing specifications and actual usage requirements, and this disclosure does not impose any restrictions on this.
[0055] In cases where the actual resonant frequency of the motor differs from the ideal resonant frequency, the vibration waveform needs to be adapted to the actual resonant frequency f0 of the motor. However, this process can cause changes in the waveform length of the drive signal. Therefore, the signal data needs to be processed to prevent the vibration rhythm point of the motor from shifting.
[0056] In one embodiment, when the actual resonant frequency f0 of a single motor is greater than the ideal resonant frequency f0_Std, the data length (frame length) of each resampled data frame will be shorter because the frequency of the resampled waveform becomes higher. For example, in Figure 3A In the example, the resampled data frame ss1 is shorter than the original data frame #1 (or reshaped data frame s1); the resampled data frame ss2 is also shorter than the original data frame #2 (or reshaped data frame s2).
[0057] In another embodiment, when the actual resonant frequency f0 of the individual motor is less than the ideal resonant frequency f0_Std, the data length (frame length) of each resampled data frame increases because the frequency of the resampled waveform becomes lower. For example, in Figure 3B In the example, the resampled data frame ss1 is longer than the original data frame #1 (or reshaped data frame s1); the resampled data frame ss2 is also longer than the original data frame #2 (or reshaped data frame s2).
[0058] It should be noted that the length of the resampled data frame will not change if the original data frame is a zero data frame. (Reference) Figure 3A and Figure 3B The resampled data frames SS7, SS8, and SS9.
[0059] Step 206: Based on the comparison between the actual resonant frequency of the motor and the ideal resonant frequency of the motor, perform padding or discarding processing on at least one of the multiple resampled data frames to obtain the adjusted drive signal of the original drive signal.
[0060] In this embodiment, if the actual resonant frequency of the motor is greater than the ideal resonant frequency of the motor, data padding is performed on at least one data frame among the multiple resampled data frames; if the actual resonant frequency of the motor is less than the ideal resonant frequency of the motor, data discarding is performed on at least one data frame among the multiple resampled data frames.
[0061] Specifically, when the actual resonant frequency f0 of the motor is greater than the ideal resonant frequency f0_Std, because the frame length of the resampled data frame is shorter, at least one of the resampled data frames needs to be padded to avoid issues such as emptying or zero waves. Conversely, when the actual resonant frequency f0 of the motor is less than the ideal resonant frequency f0_Std, because the frame length of the resampled data frame is longer, at least one of the resampled data frames needs to be discarded to avoid issues such as replay or segment termination.
[0062] Furthermore, when the actual resonant frequency f0 of the motor equals the ideal resonant frequency f0_Std, since the frame length of the resampled data frame does not change, there is no need to perform adjustment processing on each resampled data frame, and the original drive signal can be directly output.
[0063] In some embodiments, resampled data frames can be sequentially input into the buffer, and adjusted data frames with the target frame length can be sequentially output from the buffer. The buffer length of all buffered data in the buffer is monitored in real time. If the actual resonant frequency of the motor is greater than the ideal resonant frequency, and the buffer length is less than the first buffer threshold of the buffer, data filling processing can be performed in the buffer based on the data of the currently input resampled data frame (see reference). Figure 3A (Example shown); If the actual resonant frequency of the motor is less than the ideal resonant frequency, and the buffer length is greater than the second buffer threshold of the buffer area, data discarding can be performed in the buffer area based on the data of a resampled data frame currently input to the buffer area (see example). Figure 3B (Example shown).
[0064] In this embodiment, the second cache threshold of the cache area is greater than the first cache threshold.
[0065] For example, the first cache threshold of the buffer can be equal to the target frame length, the second cache threshold of the buffer can be twice the first cache threshold, that is, the second cache threshold is set to twice the target frame length, and the maximum cache capacity of the buffer can be set to three times the target frame length. It should be noted that those skilled in the art can adjust the various cache parameters of the buffer according to actual operational needs, and this disclosure does not impose any restrictions on this.
[0066] Specifically, when the actual resonant frequency of the motor is greater than the ideal resonant frequency, resampled data frames with different frame lengths are sequentially input into a buffer for concatenation, and adjusted data frames with the target frame length are sequentially retrieved from the buffer. The data input thread that inputs the resampled data frames into the buffer and the data output thread that outputs the adjusted data frames from the buffer can execute in parallel. Therefore, when it is determined that the buffer length of the buffered data is less than the target frame length, data padding is performed based on the data of the currently processed resampled data frame in the buffer. This mechanism ensures that the data output thread can successfully retrieve an adjusted data frame with the target frame length from the buffer each time, even when the data length is increased, thus avoiding execution anomalies in the data output thread (see below for specific implementation details). Figure 4 (The embodiment described).
[0067] Similarly, when the actual resonant frequency of the motor is less than the ideal resonant frequency, resampled data frames with different frame lengths can be sequentially input into the buffer for concatenation, and adjusted data frames with the target frame length can be sequentially retrieved from the buffer. The data input thread that inputs each resampled data frame into the buffer and the data output thread that outputs each adjusted data frame from the buffer can execute in parallel. Therefore, when the buffer length of the cached data in the buffer exceeds the second buffer threshold, continuing to input resampled data into the buffer would cause the buffer's storage capacity to overflow. Therefore, the next resampled data frame to be input into the buffer can be discarded, thereby reducing the data length while ensuring the normal execution of the data input thread (see below for specific implementation details). Figure 5 (The embodiment described).
[0068] In some embodiments, for any current data frame in each resampled data frame, the adjusted frame length of the current data frame can be determined based on the target frame length and the actual frame length of the preceding data frames. If the actual resonant frequency of the motor is greater than the ideal resonant frequency, and the resampled frame length of the current data frame is less than the adjusted frame length, data padding processing can be performed on the current data frame; if the actual resonant frequency of the motor is less than the ideal resonant frequency, and the resampled frame length of the current data frame is greater than the adjusted frame length, data discarding processing can be performed on the current data frame. This mechanism, by adjusting the frame length of each resampled data frame frame by frame, can improve the accuracy and stability of the drive signal adjustment results (see below for specific implementation schemes). Figure 7 and Figure 8 (The embodiment described).
[0069] In some embodiments, after obtaining the adjusted drive signal from the original drive signal, the adjusted drive signal will continue to be sent to the drive motor frame by frame for playback.
[0070] In summary, this embodiment compares the actual resonant frequency of a single motor with the ideal resonant frequency, and then performs adaptive adjustments to the motor drive signal accordingly, so that the vibration rhythm of the motor can be aligned with the music beat, thereby improving the motor vibration effect.
[0071] Figure 4 This is a processing flow of a drive signal adjustment method as another exemplary embodiment of the present disclosure. This embodiment illustrates one implementation of the data filling process in step 206 above, which will be discussed below in conjunction with... Figure 3A The specific implementation of this embodiment will be described in detail.
[0072] like Figure 4 As shown, this embodiment mainly includes the following steps:
[0073] Step 402: Based on the acquisition timestamps corresponding to each resampled data frame, determine one resampled data frame as the current data frame in sequence.
[0074] For example, they can be sequentially... Figure 3A The resampled data frames ss1, ss2, and ss3 in the data frame are identified as the current data frame.
[0075] Step 404: Input the current data frame into the buffer and append the current data frame to the end of the buffered data in the buffer.
[0076] Specifically, the header of the current data frame can be concatenated with the tail of the previous data frame. For example, if the current data frame is a resampled data frame ss2 and the previous data frame is a resampled data frame ss1, then the header of the current data frame ss2 can be concatenated to the tail of the previous data frame ss1.
[0077] In some embodiments, when the first resampled data frame ss1 is input into the buffer, the header of the first resampled data frame ss1 can be appended to the tail of the pre-stored buffered data segment Zeros in the buffer.
[0078] In some embodiments, the data length of the pre-stored cached data segment Zeros in the buffer is the same as the target frame length (that is, the data length of the cached data segment Zeros is the same as the data length of an original data frame).
[0079] Step 406: Determine whether the cache length of the cached data in the cache area is less than the first cache threshold. If not, proceed to step 408; if yes, proceed to step 410.
[0080] In this embodiment, the first buffer threshold is equal to the target frame length.
[0081] For example, if the current data frame is a resampled data frame ss2, and after appending the current data frame ss2 to the end of the cached data, the cache length of all cached data in the cache area (including the data of the current data frame ss2) is not less than the first cache threshold, then step 410 is executed; as another example, if the current data frame is a resampled data frame ss5, and after appending the current data frame ss5 to the end of the cached data, the cache length of all cached data in the cache area (including the data of the current data frame ss5) is less than the first cache threshold, then step 408 is executed.
[0082] Step 408: Determine whether the cache length of the cached data in the cache area is less than the second cache threshold and whether the current data frame is a zero data frame. If yes, proceed to step 410; otherwise, proceed to step 412.
[0083] In some embodiments, if the buffer length in the buffer area falls within the range of the first buffer threshold and the second buffer threshold, and the current data frame is a zero data frame, step 410 is executed. This design consideration is that when zero data is used to perform data padding, it has almost no impact on the original signal waveform. Therefore, it is preferable to use zero data to perform data padding.
[0084] In this embodiment, the second cache threshold of the cache area should be greater than the first cache threshold.
[0085] It should be noted that this step is only a preferred execution step and not a necessary execution step. In practical applications, when this step is omitted, if the judgment result of step 406 is negative, that is, if the cache length of the cached data in the cache area is greater than or equal to the first cache threshold, the data filling process of the current data frame is not performed, and step 412 is performed directly.
[0086] Step 410: Perform data filling processing in the buffer based on the data of the current data frame.
[0087] In some embodiments, all data in the current data frame can be copied to obtain a copied data frame, and the copied data frame can be appended to the end of the current data frame in the buffer.
[0088] For example, if the current data frame is ss5, the data of the current data frame ss5 can be copied to obtain a copy data frame ss5-1, and the copy data frame ss5-1 can be appended to the end of the current data frame ss5 to increase the data length.
[0089] It should be noted that when the current data frame is a zero data frame, the frame length of the copied data frame obtained based on the current data frame does not need to be exactly the same as the frame length of the current data frame. It is sufficient that after data filling is performed, the cache length of the cached data in the buffer does not exceed the maximum cache capacity of the buffer.
[0090] In this embodiment, the maximum buffer capacity is three times the target frame length.
[0091] In some embodiments, a data segment to be filled corresponding to a given truncation period can be extracted from the current data frame. The position of the end of the data segment to be filled in the current data frame is determined as the insertion position of the current data frame. The data segment to be filled is inserted into the insertion position of the current data frame, and this step is repeated until the buffer length is greater than or equal to the first buffer threshold of the buffer area.
[0092] In this embodiment, the given truncation period includes either the complete waveform period or the incomplete waveform period.
[0093] Among them, incomplete waveform periods include, but are not limited to: 1 / 2 waveform period, 1 / 4 waveform period, 1 / 8 waveform period, etc.
[0094] Step 412: Starting from the header of the cached data in the buffer, extract an adjusted data frame with the target frame length.
[0095] refer to Figure 3A It can extract the adjusted data frame #b1 with the target frame length from the header of the cached data in the buffer area. That is, the frame length of the adjusted data frame is the same as the frame length of the original data frame.
[0096] Step 414: Determine whether all resampled data frames have been input into the buffer. If yes, proceed to step 416; otherwise, return to step 402.
[0097] Specifically, if it is determined that all resampled data frames have been input into the buffer, which means that the data input thread of the buffer has been completed, then proceed to step 416, and return to step 402 to obtain the next resampled data frame.
[0098] Step 416: Determine whether all cached data in the buffer has been output. If yes, exit this process; otherwise, return to step 412.
[0099] Specifically, since the execution start time of the data input thread in the buffer should be earlier than the execution start time of the data output thread, after determining that all resampled data frames have been input into the buffer, it continues to determine whether all buffered data in the buffer has been output. If not, it returns to step 412; otherwise, it means that the data output thread in the buffer has also been completed, and the process exits.
[0100] Figure 5 This is a processing flow of a drive signal adjustment method as another exemplary embodiment of the present disclosure. This embodiment illustrates one implementation of the data discarding process in step 206 above, which will be discussed below in conjunction with... Figure 3B The specific implementation of this embodiment will be described in detail.
[0101] Step 502: Based on the acquisition timestamps corresponding to each resampled data frame, determine one resampled data frame as the current data frame in sequence.
[0102] For example, they can be sequentially... Figure 3B The resampled data frames ss1, ss2, and ss3 in the data frame are identified as the current data frame.
[0103] Step 504: Determine whether the cache length of the cached data in the cache area is greater than the second cache threshold. If yes, proceed to step 508; otherwise, proceed to step 506.
[0104] For example, if the current data frame is a resampled data frame SS2, and the buffer length of the buffered data (excluding the data of the current data frame SS2) is not greater than the second buffer threshold before the current data frame SS2 is input into the buffer, then step 506 is executed. Similarly, if the current data frame is a resampled data frame SS5, and the buffer length of all buffered data (excluding the data of the current data frame SS5) in the buffer is greater than the second buffer threshold before the current data frame SS5 is input into the buffer, then step 508 is executed.
[0105] In this embodiment, the second cache threshold is greater than the first cache threshold.
[0106] Step 506: Determine whether the cache length of the cached data in the cache area falls within the range of the first cache threshold and the second cache threshold, and whether the current data frame is a zero data frame. If yes, proceed to step 508; otherwise, proceed to step 510.
[0107] In some embodiments, if the buffer length in the buffer area falls within the range of the first buffer threshold and the second buffer threshold, and the current data frame is a zero data frame, step 508 is executed. This design consideration is that when zero data is used to perform data discarding, it has almost no impact on the original signal waveform. Therefore, it is preferable to use zero data to perform data discarding.
[0108] It should be noted that this step is only a preferred execution step and not a necessary execution step. In practical applications, when choosing to omit this step, step 510 can be executed directly if the judgment result of step 504 is negative.
[0109] Step 508: Based on the data in the current data frame, perform data discarding processing, and continue to step 512.
[0110] Specifically, since the cache length of all cached data in the buffer exceeds the second cache threshold, continuing to input the current data frame into the buffer will exceed the maximum cache capacity, causing an execution error in the data input thread of the buffer. Therefore, data discarding processing needs to be performed based on the data of the current data frame. In this embodiment, the maximum cache capacity of the buffer is three times the length of the target frame.
[0111] In some embodiments, all data in the current data frame may be discarded.
[0112] In other embodiments, a data segment to be discarded corresponding to a given truncation period is extracted from the current data frame, and the beginning and end positions of the data segment to be discarded in the current data frame are determined. The data segment to be discarded is deleted from the current data frame, and the beginning and end positions are concatenated. This step is repeated until the cache length is less than or equal to the second cache threshold of the cache area.
[0113] In this embodiment, a given truncation period may include either a complete waveform period or a non-complete waveform period.
[0114] Among them, incomplete waveform periods include, but are not limited to: 1 / 2 waveform period, 1 / 4 waveform period, 1 / 8 waveform period, etc.
[0115] Step 510: Input the current data frame into the buffer, append the current data frame to the end of the buffered data in the buffer, and continue to execute step 512.
[0116] Specifically, the header of the current data frame can be concatenated with the tail of the previous data frame. For example, if the current data frame is a resampled data frame ss2 and the previous data frame is a resampled data frame ss1, then the header of the current data frame ss2 can be concatenated to the tail of the previous data frame ss1.
[0117] In some embodiments, when the first resampled data frame ss1 is input into the buffer, the header of the first resampled data frame ss1 can be appended to the tail of the pre-stored buffered data segment Zeros in the buffer.
[0118] In some embodiments, the data length of the pre-stored cached data segment Zeros in the buffer is the same as the target frame length.
[0119] Step 512: Starting from the header of the cached data in the buffer, extract an adjusted data frame with the target frame length.
[0120] refer to Figure 3BIt can extract the adjusted data frame #b1 with the target frame length from the header of the cached data in the buffer area. That is, the frame length of the adjusted data frame is the same as the frame length of the original data frame.
[0121] Step 514: Determine whether all resampled data frames have been input into the buffer. If yes, proceed to step 516; otherwise, return to step 502.
[0122] Specifically, if it is determined that all resampled data frames have been input into the buffer, it means that the data input thread of the buffer has been completed. Then proceed to step 516 and return to step 502 to obtain the next resampled data frame.
[0123] Step 516: Determine whether all cached data in the buffer has been output. If yes, exit this process; otherwise, return to step 512.
[0124] Specifically, since the execution start time of the data input thread in the buffer should be earlier than the execution start time of the data output thread, after determining that all resampled data frames have been input into the buffer, it continues to determine whether all buffered data in the buffer has been output. If not, it returns to step 512; otherwise, it means that the data output thread in the buffer has also been executed, and the process exits.
[0125] In summary, this disclosure Figure 4 and Figure 5 The signal adjustment scheme provided in the embodiment inputs each resampled data frame to the buffer frame by frame, and outputs each adjusted data frame with the target frame length from the buffer frame by frame. It also detects in real time whether the data buffer length in the buffer is less than a threshold, and performs data filling or data discarding processing on at least a part of each resampled data frame. This utilizes the bucket principle to achieve adaptive adjustment of the motor drive signal frequency, so that the vibration rhythm point of the motor can be aligned with the music beat, thereby improving the vibration effect of the motor and improving the execution efficiency of signal adjustment.
[0126] In addition, by prioritizing the data filling or data discarding of zero data, data adjustment can be avoided for short vibration signals in the drive signal, which would affect the smoothness of the waveform in the drive signal and thus improve the adjustment effect of the motor drive signal.
[0127] Figure 7 This illustration shows a processing flow of a drive signal adjustment method according to another exemplary embodiment of the present disclosure. This embodiment shows another implementation of the data filling process in step 206 described above, which will be discussed below in conjunction with... Figure 6A The specific implementation of this embodiment will be described in detail.
[0128] like Figure 7 As shown, this embodiment mainly includes:
[0129] Step 702: Based on the preceding data frame in each resampled data frame, determine the resampled data frame following the preceding data frame in each resampled data frame as the current data frame.
[0130] For example, refer to Figure 3A If the preceding data frame is a resampled data frame ss2, the current data frame is ss3; if the preceding data frame is a resampled data frame ss7, the current data frame is ss8, and so on.
[0131] Step 704: Based on the target frame length and the adjustment frame difference of the preceding data frames, obtain the frame length to be adjusted for the current data frame.
[0132] For example, if the target frame length is 960 sampling points, and the adjustment frame difference of the preceding data frame is 20 sampling points, then the extra 20 sampling points need to be made up in the current data frame. Therefore, the adjustment frame length of the current data frame can be set to 940.
[0133] Step 706: Determine whether the resampled frame of the current data frame is shorter than the length of the frame to be adjusted. If yes, proceed to step 708; otherwise, proceed to step 710.
[0134] For example, if the length of the current data frame to be adjusted is 940, and the length of the resampled frame after resampling is 950, which is less than the target frame length of 960 but greater than the length of the frame to be adjusted of 940, then there is no need to perform data padding for the current data frame, and step 710 can be performed directly.
[0135] Step 708: Perform data filling processing on the current data frame.
[0136] In some embodiments, a data segment corresponding to a given truncation period can be extracted from the current data frame. The position of the end of the data segment to be filled within the current data frame is determined as the insertion position of the current data frame. The data segment to be filled is inserted into the insertion position of the current data frame to increase the frame length. The data segment to be filled corresponding to the given truncation period can be repeatedly extracted from the current data frame to perform data filling processing on the current data frame, ensuring that the adjusted actual frame length of the current data frame falls within the allowable error range of the adjusted frame length.
[0137] It should be noted that, in this embodiment, the actual frame length of the current data frame after adjustment should be greater than or equal to the frame length to be adjusted. That is, the actual frame length of the current data frame after data filling should be close to the target frame length but slightly longer than the frame length to be adjusted. For example, if the frame difference between the actual frame length of the current data frame after adjustment and the frame length to be adjusted does not exceed 20 frames, the data filling process of the current data frame can be stopped. It should be understood that the allowable error range of the frame length to be adjusted is not limited to 20 frames, and those skilled in the art can set it arbitrarily based on actual operational needs. This disclosure does not impose any restrictions on this.
[0138] In some embodiments, a given truncation period includes one of a complete waveform period and a non-complete waveform period (e.g., 1 / 2 period, 1 / 4 period, 1 / 8 period, etc.).
[0139] For example, refer to Figure 6A Given a truncation period equal to the complete waveform period, the current data frame (see...) can be used to... Figure 6A Starting from point B at the end of the resampled data frame, a data segment AB to be filled for one cycle is extracted forward. Point B at the end of the data segment to be filled is used as the insertion position of the current data frame. One or more data segments AB to be filled are inserted at point B until the actual frame length of the adjusted data frame falls within the allowable error range of the frame length to be adjusted.
[0140] In some embodiments, the waveform direction of the subsequent data segment (referencing the subsequent data segment BC of the resampled data frame) located after the insertion position in the current data frame can be identified, and waveform reversal processing can be selectively performed on the data segment AB to be filled and / or the subsequent data segment BC inserted into the current data frame to achieve a smooth transition between the subsequent data segment BC and the data segment AB to be filled. The above processing scheme is particularly suitable for use when the given truncation period is not a complete waveform period.
[0141] In some embodiments, zero data points falling within a zero data range (e.g., ±50 millivolts) in the current data frame can be detected to identify zero data segments in the current data frame. If a zero data segment exists in the current data frame, at least one zero data point is preferentially padded to the zero data segment in the current data frame so that the adjusted actual frame length of the current data frame falls within the allowable error range of the frame length to be adjusted (see reference). Figure 6C (See the comparison chart showing the effect of zero data filling).
[0142] Step 710: Based on the difference between the actual frame length of the current data frame and the frame length to be adjusted, obtain the adjustment frame difference of the current data frame, update the adjustment frame difference of the current data frame to the adjustment frame difference of the previous data frame, and return to step 702.
[0143] For example, if the actual frame length of the current data frame after data padding is 960 and the frame length to be adjusted of the current data frame is 950, the adjusted frame difference of the current data frame can be obtained as 10.
[0144] In this embodiment, the adjustment frame difference of the current data frame can be updated to the adjustment frame difference of the previous data frame, and the process can return to step 702 to continue the data filling process of the next resampled data frame until all resampled data frames in the original drive signal have been adjusted.
[0145] Figure 8 The processing flow of a drive signal adjustment method according to another exemplary embodiment of this disclosure is shown. This embodiment illustrates another implementation of the data discarding process in step 206 above, which will be discussed below in conjunction with... Figure 6B The specific implementation of this embodiment will be described in detail.
[0146] like Figure 8 As shown, this embodiment mainly includes:
[0147] Step 802: Based on the preceding data frame in each resampled data frame, determine the resampled data frame following the preceding data frame in each resampled data frame as the current data frame.
[0148] For example, refer to Figure 3B If the preceding data frame is a resampled data frame ss2, the current data frame is ss3; if the preceding data frame is a resampled data frame ss7, the current data frame is ss8, and so on.
[0149] Step 804: Based on the target frame length and the adjustment frame difference of the preceding data frames, obtain the frame length to be adjusted for the current data frame.
[0150] For example, if the target frame length is 960 sampling points, and the adjustment frame difference of the preceding data frame is 20 sampling points, then the extra 20 sampling points need to be made up in the current data frame. Therefore, the adjustment frame length of the current data frame can be set to 940.
[0151] Step 806: Determine whether the resampled frame of the current data frame is longer than the frame length to be adjusted. If yes, proceed to step 808; otherwise, proceed to step 810.
[0152] For example, if the target frame length of the current data frame is 940, and the resampled frame length of the current data frame after resampling is 935, which is less than the frame length to be adjusted (960), then there is no need to perform data discarding processing on the current data frame, and step 810 can be performed directly.
[0153] Step 808: Perform data discarding processing on the current data frame.
[0154] In some embodiments, according to a given truncation period, a data segment to be discarded corresponding to the given truncation period is extracted from the current data frame. The start and end positions of the data segment to be discarded in the current data frame are determined, the data segment to be discarded is deleted from the current data frame, and the start and end positions are concatenated to reduce the frame length of the current data frame. The data segment to be discarded corresponding to the given truncation period can be repeatedly extracted from the current data frame to perform data discarding processing on the current data frame, ensuring that the adjusted actual frame length of the current data frame falls within the allowable error range of the adjusted frame length.
[0155] In this embodiment, the actual frame length of the current data frame after adjustment should be greater than or equal to the frame length to be adjusted. That is, the actual frame length of the current data frame after discarding all data should be close to the frame length to be adjusted but slightly longer than the frame length to be adjusted.
[0156] For example, if the frame difference between the adjusted actual frame length of the current data frame and the frame length to be adjusted does not exceed 20 frames, the data discarding process for the current data frame can be stopped. It should be understood that the allowable error range for the frame length to be adjusted is not limited to 20 frames and can be arbitrarily set based on actual operational needs; this disclosure does not impose any restrictions on this.
[0157] In some embodiments, a given truncation period includes at least one of a complete waveform period and a non-complete waveform period (e.g., 1 / 2 period, 1 / 4 period, 1 / 8 period, etc.).
[0158] For example, refer to Figure 6B Given a truncation period equal to the complete waveform period, the current data frame (see...) can be used to... Figure 6B Starting from point B at the end of the resampled data frame, a data segment AB to be filled for one cycle is extracted forward. The data segment AB to be filled is placed at the beginning position A and the position B of the current data frame. One or more data segments AB to be filled are deleted from the current data frame, so that the actual frame length of the adjusted data frame falls within the allowable error range of the frame length to be adjusted.
[0159] In some embodiments, the waveform trends of the preceding data segment (reference resampled data segment DB) at the beginning of an adjacent segment in the current data frame and the subsequent data segment (reference resampled data segment BC) at the end of an adjacent segment can be identified, and waveform reversal processing can be selectively performed on the subsequent data segment to achieve a smooth transition between the preceding data segment DB and the subsequent data segment BC. The above processing scheme is particularly suitable for use when the given truncation period is not a complete waveform period.
[0160] In some embodiments, zero data points falling within the zero data range (e.g., ±50 mV) in the current data frame can be detected to identify zero data segments in the current data frame. If a zero data segment exists in the current data frame, at least one zero data point in the current data frame is preferentially discarded, so that the adjusted actual frame length of the current data frame falls within the allowable error range of the frame length to be adjusted (see reference). Figure 6D (See the comparison chart showing the effect of zero data discarding).
[0161] Step 810: Based on the difference between the actual frame length of the current data frame and the frame length to be adjusted, obtain the adjustment frame difference of the current data frame, update the adjustment frame difference of the current data frame to the adjustment frame difference of the previous data frame, and return to step 802.
[0162] For example, if the actual frame length of the current data frame after data padding is 960 and the frame length to be adjusted of the current data frame is 950, the adjusted frame difference of the current data frame can be obtained as 10.
[0163] In this embodiment, the adjustment frame difference of the current data frame can be updated to the adjustment frame difference of the previous data frame, and the process can be returned to step 802 to continue the data filling process of the next resampled data frame until all resampled data frames have been adjusted.
[0164] In summary, this disclosure Figure 7 and Figure 8 The signal adjustment scheme provided in the embodiment adjusts the frame length of each resampled data frame frame by frame so that the vibration rhythm point of the motor can be aligned with the music beat. This not only improves the motor vibration effect, but also improves the accuracy and stability of the drive signal adjustment result.
[0165] refer to Figure 9A and Figure 9B As shown in the example, this disclosure can dynamically adjust the length of the current data frame to be adjusted based on the comparison between the adjusted actual frame length of the previous data frame and the target frame length, thereby selectively padding or discarding data in the current data frame. Since the adjusted actual frame length of each resampled data frame should be slightly longer than the length to be adjusted, this dynamic update mechanism of the length to be adjusted automatically adds the data exceeding the target frame length from the previous data frame to the next data frame, thus automatically increasing the actual frame length of the next data frame without performing data adjustment processing. Therefore, the frame-by-frame adjustment scheme of this disclosure does not require data adjustment processing for each resampled data frame, reducing the execution frequency of data adjustment processing and improving the efficiency of signal adjustment.
[0166] Drive signal adjustment device
[0167] Figure 10A simplified structural diagram of a drive signal adjustment device according to an exemplary embodiment of the present disclosure is shown. The drive signal adjustment device 1000 of this embodiment mainly includes an acquisition module 1002, a resampling module 1004, and an adjustment module 1006.
[0168] The acquisition module 1002 is used to acquire multiple raw data frames of the raw drive signal;
[0169] The resampling module 1004 is used to resample the multiple original data frames based on the actual resonant frequency of the motor and the ideal resonant frequency of the motor to obtain multiple resampled data frames of the multiple original drive signals.
[0170] The adjustment module 1006 is used to perform padding or discarding processing on at least one data frame among the plurality of resampled data frames based on the result of comparing the actual resonant frequency of the motor with the ideal resonant frequency of the motor, so as to obtain the target driving signal of the original driving signal; wherein, if the actual resonant frequency of the motor is greater than the ideal resonant frequency of the motor, data padding processing is performed on at least one data frame among the plurality of resampled data frames, or if the actual resonant frequency of the motor is less than the ideal resonant frequency of the motor, data discarding processing is performed on at least one data frame among the plurality of resampled data frames.
[0171] In some embodiments, the resampling module 1004 is configured to: determine any one of the plurality of original data frames or the plurality of resampled data frames as a data frame to be processed; identify each data in the data frame to be processed based on a given zero data range; if all data in the data frame to be processed is identified to fall within the zero data range, mark the data frame to be processed as a zero data frame; if at least one data in the data frame to be processed is identified not to fall within the zero data range, mark the data frame to be processed as a non-zero data frame.
[0172] In some embodiments, the resampling module 1004 is configured to: identify each non-zero data in the data to be processed that does not fall within the zero data range when any one of the plurality of original data frames is determined as the data frame to be processed; and perform resampling processing on all non-zero data in the data frame to be processed to obtain a resampled data frame of the data frame to be processed.
[0173] In some embodiments, the adjustment module 1006 is configured to: sequentially input the resampled data frames into the buffer, and sequentially output adjustment data frames with target frame lengths from the buffer; detect the buffer length of all buffered data in the buffer in real time; if the actual resonant frequency of the motor is greater than the ideal resonant frequency and the buffer length is less than the first buffer threshold of the buffer, perform data filling processing in the buffer based on the data of a resampled data frame currently input into the buffer; if the actual resonant frequency of the motor is less than the ideal resonant frequency and the buffer length is greater than the second buffer threshold of the buffer, perform data discarding processing in the buffer based on the data of a resampled data frame currently input into the buffer; wherein the second buffer threshold of the buffer is greater than the first buffer threshold.
[0174] In some embodiments, the adjustment module 1006 is configured to: perform a current data frame determination step, determining a resampled data frame as the current data frame sequentially according to the acquisition timestamps corresponding to each resampled data frame; input the current data frame into the buffer, and concatenate the current data frame to the end of the cached data in the buffer; detect the cache length of all cached data in the buffer, and if the cache length is less than the first cache threshold of the buffer, perform data filling processing in the buffer according to the data of the current data frame; extract an adjustment data frame with the target frame length starting from the beginning of the cached data in the buffer; return to perform the current data frame determination step until all resampled data frames have been input into the buffer and all cached data in the buffer have been output.
[0175] In some embodiments, the current data frame is marked as one of a zero data frame and a non-zero data frame, wherein each data in the zero data frame falls within the zero data range, and at least one data in the non-zero data frame does not fall within the zero data range;
[0176] In some embodiments, the adjustment module 1006 is configured to: if the cache length falls within the range of the first cache threshold and the second cache threshold of the cache area, and the current data frame is marked as the zero data frame, perform data filling processing in the cache area according to the data of the current data frame.
[0177] In some embodiments, the adjustment module 1006 is configured to: copy all data in the current data frame to obtain a copied data frame of the current data frame, and append the copied data frame to the end of the current data frame in the buffer; or extract a data segment to be filled corresponding to a given extraction period from the current data frame, determine the position of the end of the data segment to be filled in the current data frame as the insertion position of the current data frame, insert the data segment to be filled into the insertion position of the current data frame, and repeat this step until the buffer length is greater than or equal to the first buffer threshold of the buffer; wherein, the given extraction period includes one of a complete waveform period and a non-complete waveform period.
[0178] In some embodiments, the adjustment module 1006 is configured to: perform a current data frame determination step, determining a resampled data frame as the current data frame sequentially according to the acquisition timestamps corresponding to each resampled data frame; detect the buffer length of all buffered data in the buffer area, and if the buffer length is less than or equal to the second buffer threshold of the buffer area, input the current data frame into the buffer area and append the current data frame to the end of the buffered data in the buffer area; or, if the buffer length is greater than the second buffer threshold of the buffer area, perform data discarding processing in the buffer area according to the data of the current data frame; starting from the beginning of the buffered data in the buffer area, extract an adjustment data frame with the target frame length, and return to perform the current data frame determination step until all resampled data frames have been input into the buffer area and all buffered data in the buffer area have been output.
[0179] In some embodiments, the adjustment module 1006 is configured to: if the cache length falls within the range of the first cache threshold and the second cache threshold of the cache area, and the current data frame is marked as a zero data frame, perform data discarding processing in the cache area according to the data of the current data frame.
[0180] In some embodiments, the adjustment module 1006 is configured to: discard all data in the current data frame; or extract a data segment to be discarded from the current data frame corresponding to a given extraction period, determine the beginning and end positions of the data segment to be discarded in the current data frame, delete the data segment to be discarded from the current data frame, and concatenate the beginning and end positions, and repeat this step until the buffer length is less than or equal to the second buffer threshold of the buffer area; wherein, the given extraction period includes one of a complete waveform period and a non-complete waveform period.
[0181] In some embodiments, the adjustment module 1006 is configured to: for any current data frame in each resampled data frame, determine the frame length to be adjusted of the current data frame according to the target frame length; if the actual resonant frequency of the motor is greater than the ideal resonant frequency, and the resampled frame length of the current data frame is less than the frame length to be adjusted, perform data filling processing of the current data frame; if the actual resonant frequency of the motor is less than the ideal resonant frequency, and the resampled frame length of the current data frame is greater than the frame length to be adjusted, perform data discarding processing of the current data frame.
[0182] In some embodiments, the adjustment module 1006 is configured to: perform a current data frame determination step, determining a resampled data frame following the preceding data frame in each resampled data frame as the current data frame based on the preceding data frame in each resampled data frame; obtain the frame length to be adjusted of the current data frame based on the target frame length and the adjustment frame difference of the preceding data frame; compare the resampled frame length of the current data frame with the frame length to be adjusted, and if the resampled frame length is less than the frame length to be adjusted, perform data padding processing on the current data frame; obtain the adjustment frame difference of the current data frame based on the difference between the actual frame length of the current data frame and the frame length to be adjusted, update the adjustment frame difference of the current data frame to the adjustment frame difference of the preceding data frame, and return to perform the current data frame determination step.
[0183] In some embodiments, the adjustment module 1006 is configured to: perform a data truncation step, according to a given truncation period, truncate a data segment to be filled from the current data frame corresponding to the given truncation period, determine the position of the end of the data segment to be filled in the current data frame as the insertion position of the current data frame; insert the data segment to be filled into the insertion position of the current data frame, and re-execute the data truncation step until the adjusted actual frame length of the current data frame falls within the allowable error range of the frame length to be adjusted; wherein, the adjusted actual frame length of the current data frame is not less than the frame length to be adjusted; wherein, the given truncation period includes one of a complete waveform period and a non-complete waveform period.
[0184] In some embodiments, the adjustment module 1006 is configured to: identify the waveform direction of the subsequent data segment located after the insertion position in the current data frame, and selectively perform waveform reversal processing on the data segment to be filled and / or the subsequent data segment inserted in the current data frame.
[0185] In some embodiments, the adjustment module 1006 is configured to: detect each zero data in the current data frame that falls within the zero data range before performing data padding by truncating the data segment to be padded, so as to identify the zero data segment in the current data frame; if there is a zero data segment in the current data frame, perform padding of at least one zero data on the zero data segment so that the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted.
[0186] In some embodiments, the adjustment module 1006 is configured to: perform a current data frame determination step, determining a resampled data frame following the preceding data frame in each resampled data frame as the current data frame based on the preceding data frame in each resampled data frame; obtain the frame length to be adjusted of the current data frame based on the target frame length and the adjustment frame difference of the preceding data frame; compare the resampled frame length of the current data frame with the frame length to be adjusted, and if the resampled frame length is greater than the frame length to be adjusted, perform data discarding processing on the current data frame; obtain the adjustment frame difference of the current data frame based on the difference between the actual frame length of the current data frame and the frame length to be adjusted, update the adjustment frame difference of the current data frame to the adjustment frame difference of the preceding data frame, and return to perform the current data frame determination step.
[0187] In some embodiments, the adjustment module 1006 is configured to: perform a data truncation step, according to a given truncation period, truncate a data segment to be discarded from the current data frame corresponding to the given truncation period, and determine the beginning and end positions of the data segment to be discarded in the current data frame; delete the data segment to be discarded from the current data frame, and concatenate the beginning and end positions of the segment, and re-execute the data truncation step until the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted; wherein, the actual frame length of the current data frame after adjustment is not less than the frame length to be adjusted; wherein, the given truncation period includes one of a complete waveform period and a non-complete waveform period.
[0188] In some embodiments, the adjustment module 1006 is configured to: after deleting the data segment to be discarded from the current data frame, identify the waveform trends of the preceding data segment adjacent to the beginning position of the segment and the subsequent data segment adjacent to the end position of the segment in the current data frame, and selectively perform waveform reversal processing on the subsequent data segment.
[0189] In some embodiments, the adjustment module 1006 is configured to: detect each zero data in the current data frame that falls within the zero data range before performing data discarding processing by deleting the data segment to be discarded, so as to identify the zero data segment in the current data frame; if there is a zero data segment in the current data frame, perform at least one zero data discarding on the zero data segment, so that the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted.
[0190] In some embodiments, the motor includes a linear resonant motor; the ideal resonant frequency is determined based on the motor's design criteria.
[0191] In some embodiments, the resampling module 1004 is further configured to: perform waveform reshaping processing on each of the plurality of original data frames before resampling them.
[0192] In some embodiments, the adjustment module 1006 is further configured to: after obtaining the adjustment drive signal, send the adjustment drive signal frame by frame to the drive motor for playback.
[0193] electronic devices
[0194] Reference Figure 11 This document illustrates a schematic diagram of an electronic device according to an exemplary embodiment of the present application. The specific embodiments of the present application do not limit the specific implementation of the electronic device.
[0195] like Figure 11 As shown, the electronic device may include: a processor 1102, a communications interface 1104, a memory 1106, and a communications bus 1108.
[0196] in:
[0197] The processor 1102, communication interface 1104, and memory 1106 communicate with each other via communication bus 1108.
[0198] Communication interface 1104 is used to communicate with other electronic devices or servers.
[0199] The processor 1102 is used to execute program 1110, which can specifically execute the relevant steps in the above-described drive signal adjustment method embodiment.
[0200] Specifically, program 1110 may include program code that includes computer operation instructions.
[0201] The processor 1102 may be a CPU, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The smart device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0202] Memory 1106 is used to store program 1110. Memory 1106 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0203] Program 1110 may include multiple computer instructions. Specifically, program 1110 may use multiple computer instructions to cause processor 1102 to perform the operation corresponding to the drive signal adjustment method described in any of the foregoing multiple method embodiments.
[0204] The specific implementation of each step in program 1110 can be found in the corresponding descriptions of the steps and units in the above method embodiments, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0205] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a processor, implements the method described in any of the foregoing method embodiments. The computer storage medium includes, but is not limited to, compact disc read-only memory (CD-ROM), random access memory (RAM), floppy disk, hard disk, or magneto-optical disk.
[0206] This application also provides a computer program product, including computer instructions that instruct a computing device to perform operations corresponding to the drive signal adjustment method described in any of the above embodiments.
[0207] Furthermore, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0208] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.
[0209] The methods described in the embodiments of this application can be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code downloaded over a network that is originally stored in a remote recording medium or a non-transitory machine-readable medium and will be stored in a local recording medium. Thus, the methods described herein can be stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA)). It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components (e.g., Random Access Memory (RAM), Read-Only Memory (ROM), Flash Memory, etc.) capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods described herein. Furthermore, when a general-purpose computer accesses code used to implement the methods shown herein, the execution of the code transforms the general-purpose computer into a dedicated computer for executing the methods shown herein.
[0210] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0211] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. A method for adjusting a drive signal, comprising: Acquire multiple raw data frames of the raw drive signal; The original data frames are resampled based on the actual resonant frequency of the motor and the ideal resonant frequency of the motor to obtain multiple resampled data frames. Based on the comparison between the actual resonant frequency of the motor and the ideal resonant frequency of the motor, at least one of the multiple resampled data frames is either padded or discarded to obtain the target drive signal of the original drive signal. If the actual resonant frequency of the motor is greater than the ideal resonant frequency of the motor, data padding is performed on at least one of the multiple resampled data frames; if the actual resonant frequency of the motor is less than the ideal resonant frequency of the motor, data discarding is performed on at least one of the multiple resampled data frames.
2. The method according to claim 1, wherein, The method further includes: Select any one of the plurality of original data frames or the plurality of resampled data frames as the data frame to be processed; Based on a given range of zero data, identify each piece of data in the data frame to be processed; If all data in the data frame to be processed falls within the zero data range, the data frame to be processed is marked as a zero data frame. If at least one data in the data frame to be processed does not fall within the zero data range, the data frame to be processed is marked as a non-zero data frame.
3. The method according to claim 2, wherein, When any one of the plurality of original data frames is determined as the data frame to be processed, the plurality of original data frames are resampled based on the actual resonant frequency and the ideal resonant frequency of the motor to obtain a plurality of resampled data frames, including: Identify each non-zero data point in the data frame to be processed that does not fall within the zero data range; Resampling is performed on all non-zero data in the data frame to be processed to obtain a resampled data frame.
4. The method according to claim 2, wherein, The step of performing padding or discarding processing on at least one of the plurality of resampled data frames based on the result of comparing the actual resonant frequency of the motor with the ideal resonant frequency of the motor includes: The resampled data frames are sequentially input into the buffer, and data frames with the target frame length are sequentially output from the buffer. Real-time detection of the cache length of all cached data in the cache area; If the actual resonant frequency of the motor is greater than the ideal resonant frequency, and the buffer length is less than the first buffer threshold of the buffer area, data filling processing is performed in the buffer area according to the data of the resampled data frame currently input to the buffer area; If the actual resonant frequency of the motor is less than the ideal resonant frequency, and the buffer length is greater than the second buffer threshold of the buffer area, data discarding processing is performed in the buffer area according to the data of the resampled data frame currently input to the buffer area; Wherein, the second cache threshold of the cache area is greater than the first cache threshold.
5. The method according to claim 4, wherein, The padding process performed on at least one of the plurality of resampled data frames includes: Perform the current data frame determination step, and determine one resampled data frame as the current data frame in turn according to the collection timestamps corresponding to each resampled data frame; Input the current data frame into the buffer area and append the current data frame to the end of the buffered data in the buffer area; The cache length of all cached data in the cache area is detected. If the cache length is less than the first cache threshold of the cache area, data filling processing is performed in the cache area according to the data of the current data frame. Starting from the header of the cached data in the buffer, extract an adjusted data frame with the target frame length; Return to the current data frame determination step until all resampled data frames have been input into the buffer and all cached data in the buffer has been output.
6. The method according to claim 5, wherein, After the step of detecting the cache length of the cached data in the cache area, the method further includes: If the cache length falls within the range of the first cache threshold and the second cache threshold of the cache area, and the current data frame is marked as a zero data frame, data filling processing is performed in the cache area according to the data of the current data frame.
7. The method according to claim 5 or 6, wherein, The step of performing data filling processing in the buffer based on the data of the current data frame includes: Copy all data in the current data frame to obtain a copied data frame, and append the copied data frame to the end of the current data frame in the buffer; or Extract a data segment to be filled from the current data frame corresponding to a given extraction period. Determine the position of the end of the data segment to be filled in the current data frame as the insertion position of the current data frame. Insert the data segment to be filled into the insertion position of the current data frame. Repeat this step until the buffer length is greater than or equal to the first buffer threshold of the buffer area. The given truncation period includes either a complete waveform period or a non-complete waveform period.
8. The method according to claim 4, wherein, The step of discarding at least one of the plurality of resampled data frames includes: Perform the current data frame determination step, and determine one resampled data frame as the current data frame in turn according to the collection timestamps corresponding to each resampled data frame; The cache length of all cached data in the cache area is detected. If the cache length is less than or equal to the second cache threshold of the cache area, the current data frame is input into the cache area and the current data frame is appended to the end of the cached data in the cache area; or, if the cache length is greater than the second cache threshold of the cache area, data discarding is performed in the cache area according to the data of the current data frame. Starting from the header of the cached data in the buffer, extract an adjusted data frame with the target frame length, and return to execute the current data frame determination step until all the resampled data frames have been input into the buffer and all cached data in the buffer has been output.
9. The method according to claim 8, wherein, After the step of detecting the cache length of the cached data in the cache area, the method further includes: If the cache length falls within the range of the first cache threshold and the second cache threshold of the cache area, and the current data frame is marked as a zero data frame, data discarding is performed in the cache area based on the data of the current data frame.
10. The method according to claim 8 or 9, wherein, The step of performing data discarding processing in the buffer based on the data of the current data frame includes: Discard all data in the current data frame; or Extract the data segment to be discarded from the current data frame corresponding to a given extraction period, and determine the beginning and end positions of the data segment to be discarded in the current data frame. Delete the data segment to be discarded from the current data frame, and concatenate the beginning and end positions. Repeat this step until the buffer length is less than or equal to the second buffer threshold of the buffer area. The given truncation period includes either a complete waveform period or a non-complete waveform period.
11. The method according to claim 2, wherein, The step of performing padding or discarding processing on at least one of the plurality of resampled data frames based on the result of comparing the actual resonant frequency of the motor with the ideal resonant frequency of the motor includes: For any current data frame in each resampled data frame, the frame length to be adjusted for the current data frame is determined based on the target frame length and the actual frame length of the preceding data frames of the current data frame. If the actual resonant frequency of the motor is greater than the ideal resonant frequency, and the resampling frame length of the current data frame is less than the frame length to be adjusted, then the data filling process of the current data frame is performed. If the actual resonant frequency of the motor is less than the ideal resonant frequency, and the resampled frame length of the current data frame is greater than the frame length to be adjusted, the data of the current data frame is discarded.
12. The method according to claim 11, wherein, The padding process performed on at least one of the plurality of resampled data frames includes: Perform the current data frame determination step, and determine the current data frame as the resampled data frame following the preceding data frame in each resampled data frame based on the preceding data frame in each resampled data frame. The adjusted frame length of the current data frame is obtained based on the target frame length and the adjustment frame difference of the preceding data frames. The resampled frame length of the current data frame is compared with the frame length to be adjusted. If the resampled frame length is less than the frame length to be adjusted, data padding is performed on the current data frame. Based on the difference between the actual frame length of the current data frame and the frame length to be adjusted, the adjusted frame difference of the current data frame is obtained. The adjusted frame difference of the current data frame is then updated to the adjusted frame difference of the previous data frame, and the process returns to the current data frame determination step.
13. The method according to claim 12, wherein, The data padding process performed on the current data frame includes: Perform a data extraction step: according to a given extraction period, extract a data segment to be filled from the current data frame corresponding to the given extraction period, and determine the position of the end of the data segment to be filled in the current data frame as the insertion position of the current data frame. Insert the data segment to be filled into the insertion position of the current data frame, and re-execute the data truncation step until the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted; Wherein, the actual frame length of the current data frame after adjustment is not less than the frame length to be adjusted; The given truncation period includes either a complete waveform period or a non-complete waveform period.
14. The method according to claim 13, wherein, After inserting the data segment to be filled into the insertion position of the current data frame, the method further includes: Identify the waveform direction of the subsequent data segment located after the insertion position in the current data frame, and selectively perform waveform reversal processing on the data segment to be filled and / or the subsequent data segment inserted into the current data frame.
15. The method according to claim 13, wherein, Before performing data padding by truncating the data segment to be filled, the method further includes: Identify each zero data point in the current data frame that falls within the zero data range to determine the zero data segment in the current data frame; If there is a zero data segment in the current data frame, at least one zero data is padded to the zero data segment so that the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted.
16. The method according to claim 11, wherein, The step of performing data discarding processing on at least one of the plurality of resampled data frames includes: Perform the current data frame determination step, and determine the current data frame as the resampled data frame following the preceding data frame in each resampled data frame based on the preceding data frame in each resampled data frame. The adjusted frame length of the current data frame is obtained based on the target frame length and the adjustment frame difference of the preceding data frames. The resampled frame length of the current data frame is compared with the frame length to be adjusted. If the resampled frame length is greater than the frame length to be adjusted, the data is discarded for the current data frame. Based on the difference between the actual frame length of the current data frame and the frame length to be adjusted, the adjusted frame difference of the current data frame is obtained. The adjusted frame difference of the current data frame is then updated to the adjusted frame difference of the previous data frame, and the process returns to the current data frame determination step.
17. The method according to claim 16, wherein, The process of discarding data in the current data frame includes: Perform a data interception step, according to a given interception period, intercept the data segment to be discarded from the current data frame corresponding to the given interception period, and determine the beginning and end positions of the data segment to be discarded in the current data frame; The data segment to be discarded is deleted from the current data frame, and the beginning and end positions of the segment are concatenated. The data truncation step is then re-executed until the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted. Wherein, the actual frame length of the current data frame after adjustment is not less than the frame length to be adjusted; The given truncation period includes either a complete waveform period or a non-complete waveform period.
18. The method according to claim 17, wherein, After deleting the data segment to be discarded from the current data frame, the method further includes: Identify the waveform trends of the preceding data segment adjacent to the beginning of the segment and the subsequent data segment adjacent to the end of the segment in the current data frame, and selectively perform waveform reversal processing on the subsequent data segment.
19. The method according to claim 17, wherein, Before performing data discarding by deleting the data segment to be discarded, the method further includes: Identify each zero data point in the current data frame that falls within the zero data range to determine the zero data segment in the current data frame; If there is a zero data segment in the current data frame, at least one zero data segment is discarded, so that the actual frame length of the current data frame after adjustment falls within the allowable error range of the frame length to be adjusted.
20. The method according to claim 1, wherein, The motor includes a linear resonant motor; The ideal resonant frequency is determined based on the motor's design standards.
21. The method according to claim 1, wherein, The method further includes: Before resampling the plurality of original data frames, waveform reshaping processing is performed on each original data frame; After receiving the adjustment drive signal, the adjustment drive signal is sent to the drive motor frame by frame for playback.
22. A drive signal adjustment device, comprising: The acquisition module is used to acquire multiple raw data frames of the raw drive signal; The resampling module is used to resample the multiple original data frames based on the actual resonant frequency and the ideal resonant frequency of the motor to obtain multiple resampled data frames of the multiple original drive signals. An adjustment module is configured to perform padding or discarding processing on at least one data frame among the plurality of resampled data frames based on the result of comparing the actual resonant frequency of the motor with the ideal resonant frequency of the motor, so as to obtain the target drive signal of the original drive signal. Specifically, if the actual resonant frequency of the motor is greater than the ideal resonant frequency of the motor, data padding processing is performed on at least one data frame among the plurality of resampled data frames; or, if the actual resonant frequency of the motor is less than the ideal resonant frequency of the motor, data discarding processing is performed on at least one data frame among the plurality of resampled data frames.
23. An electronic device, comprising: The processor, the communication interface, the memory, and the bus are connected, and the processor, the communication interface, and the memory communicate with each other via the bus. The memory is used to store at least one executable instruction that causes the processor to perform an operation corresponding to the method as described in any one of claims 1 to 21.
24. A computer-readable storage medium storing computer instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 21.
