A method for controlling magnetic fluid to move following music melody using electromagnets

By performing frame processing and signal decomposition on the audio signal, and controlling the electromagnet with the calculation of local maximum values, the problem of discontinuous magnet movement in the prior art is solved, and magnetofluid motion control is realized suitable for various musical melodies.

CN115346750BActive Publication Date: 2025-03-28SHEN ZHEN AUDCOM ELECTRONIC CO LTD

Patent Information

Application Number
CN202210960886.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-11
Publication Date
2025-03-28
Estimated Expiration
2042-08-11

AI Technical Summary

Technical Problem

The existing magnetofluid control technology is difficult to adapt to changes in various musical melodies, resulting in discontinuous movement of magnetofluids and the inability to effectively visualize the rhythm in light music or voice signals.

Method used

Through the frame processing of the audio signal and the calculation of the average volume meter value, the empirical modal decomposition algorithm is used to signal decompose the volume meter value sequence, calculate the local maximum value in the first eigenmodal function, and judge the opening state of the electromagnet based on the difference, thereby controlling the movement of the magnetic fluid.

Benefits of technology

The continuity of magnetofluid movement and matching with musical melody is achieved, which can be applied to changes in various musical melody, avoiding the discontinuity problem caused by threshold settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115346750B_ABST
    Figure CN115346750B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for controlling a magnetic fluid to follow the movement of a music melody by using an electromagnet, which is characterized by comprising the following steps: S1, framing an audio signal; S2, calculating an average volume value of each frame; S3, obtaining a series of average volume values; S4, performing signal decomposition on the series of average volume values ​​by using an empirical mode decomposition algorithm; S5, calculating the first intrinsic mode function IMF obtained after decomposition. 1 All local maxima in S6. Calculate IMF 1 The difference between the length value and the position value of the last local maximum value; S7, judging the opening state of the electromagnet according to the obtained difference. The control method of the present invention can make the movement continuity of the magnetic fluid better and can be applied to the changes of various musical melodies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of magnetic fluid rhythm control, and in particular to a method of using an electromagnet to control a magnetic fluid to move following a musical melody. Background Art

[0002] As people's living standards improve, audio products are becoming more and more popular. In addition to the core playback function, how to visualize the sound is becoming more and more important. In the 1990s, audio equipment often used several light-emitting diodes to realize the volume meter (VU). The volume meter would control the light-emitting diodes according to the real-time volume of the playback to realize the visualization of the sound. Later, the spectrum display function appeared on high-end audio, that is, the corresponding spectrum was displayed on the LCD screen of the audio according to the real-time playback signal. Audio with spectrum function is more popular than audio with only volume meter.

[0003] With the development of science and technology, people are no longer satisfied with outdated volume meters and spectra, so magnetic fluids have begun to be widely used in the field of sound visualization. However, compared with volume meters and spectra, although magnetic fluids are more technological, they are more difficult to control and display. The volume meter is usually composed of several light-emitting diodes, so the visualization effect of the volume meter can adapt to various sounds with low and high volumes, and can reflect the volume and rhythm of the sound in visualization; the spectrum has an additional frequency attribute on the basis of the volume meter, so the spectrum can adapt to various sounds, and can reflect the volume, frequency and rhythm of the sound in visualization; and in magnetic fluids, when using electromagnets for control, there is only the on or off of the electromagnets, so how to control the electromagnets to make the magnetic fluid move has become a big problem.

[0004] At present, there are three common methods for magnetic fluid control:

[0005] 1. Calculate the volume meter value (VU) of the sound in real time. When the volume meter value is greater than the set threshold, the electromagnet is turned on. When the volume meter value is less than the set threshold, the electromagnet is turned off.

[0006] 2. Use spectrum analysis or multi-phase filtering technology to divide the sound signal into several frequency bands and calculate the amplitude of each frequency band. According to the relative amplitude between the frequency bands, strategically select and use the amplitude of a certain frequency band. If certain conditions are met, turn on the electromagnet, otherwise turn off the electromagnet.

[0007] 3. Calculate the rhythm of the audio signal (BPM, beats per minute), turn on the electromagnet at the beat, and turn off the electromagnet at other times.

[0008] However, all three methods mentioned above have defects. The defect of method 1 is that it cannot adapt to all sounds universally. If the threshold is too high, it cannot respond to low-volume sounds. If the threshold is too low, the electromagnet will be turned on all the time for loud sounds, and the magnetic fluid display effect is not good in the end. The defect of method 2 is that when switching and using amplitudes of different frequency bands, it will bring discontinuity to the visual appearance of the magnetic fluid. For example, if the low-frequency band is selected at the beginning, the display of the magnetic fluid will be bass drum beats. When it is suddenly switched to the high-frequency band, the movement of the magnetic fluid will instantly change from rhythmic drum beats to the melody of human voice or high-pitched instrument. At this time, there will be an obvious visual fault. The defect of method 3 is that when the audio signal is light music or speech, there is no rhythm attribute, so it cannot adapt to all types of sounds.

[0009] Since the technical effects of the above existing technical solutions are not very ideal when implemented, the inventor decided to develop a new control method that can perfectly overcome the above defects. Summary of the invention

[0010] The purpose of the present invention is to propose a method of using electromagnets to control the movement of magnetic fluid to follow the melody of music, which can completely overcome the defects existing in the above-mentioned prior art, make the movement continuity of the magnetic fluid better, and can be adapted to the changes of various musical melodies.

[0011] The technical solution adopted by the present invention to solve its technical problem is:

[0012] A method for controlling a magnetic fluid to move following a musical melody using an electromagnet, characterized in that it comprises the following steps:

[0013] S1. Frame processing of audio signals: the input audio signals are framed in equal lengths according to the preset single-frame sampling length, and the framed audio signals are named in the order of sampling time: SIG1, SIG2, SIG3, ..., SIG n ;

[0014] S2, calculate the average volume value of each frame: for the several audio signals SIG1, SIG2, SIG3, ..., SIG after framing n Calculate the average volume meter value of each frame and name them VU1, VU2, VU3, ..., VU n ;

[0015] S3, obtaining the average volume meter value series: when the number of collected VU values ​​reaches the preset number R, these collected VU values ​​are grouped into a VU sequence, that is, SEQ = [VU1, VU2, VU3, ..., VU R ]; the length of SEQ is R;

[0016] S4, using an empirical mode decomposition algorithm to perform signal decomposition on the average volume counter value series: performing signal decomposition on the obtained VU sequence SEQ according to the empirical mode decomposition algorithm to obtain the first intrinsic mode function IMF1;

[0017] S5. Calculate all local maxima in the first intrinsic mode function IMF1 obtained after decomposition: According to the calculation principle of the empirical mode decomposition algorithm, the length of IMF1 is consistent with the length of the SEQ input for decomposition, that is, the length of IMF1 is R; traverse the R numbers in IMF1 and calculate the W local maxima therein;

[0018] S6. Calculate the difference between the length value of IMF1 and the position value of the last local maximum value: extract the position m of the last local maximum value from the W local maximum values, and calculate the difference P between the length R of IMF1 and the position m of the last local maximum value, that is, P=Rm;

[0019] S7. Determine the on state of the electromagnet based on the obtained difference: if the difference P ≤ the on preset value, turn on the electromagnet to attract the magnetic fluid in the sealed container to move; if the difference P > the on preset value, turn off the electromagnet, and the magnetic fluid automatically returns to its original state under the action of its own tension and gravity.

[0020] According to a further preferred technical solution, the preset value of the single frame sampling length is set to 50 milliseconds.

[0021] According to a further preferred technical solution, the specific calculation method of the average volume meter value is:

[0022] S21. According to the preset single-frame sampling length and the PCM sampling frequency of the audio, the number of audio samples contained in a single frame is calculated, that is, the number of audio samples contained in a single frame H = single-frame sampling length * PCM sampling frequency; and the H sampled audios are named SIG n [1] SIG n [2] SIG n [3], ......, SIG n [H]; where n represents the nth frame of audio signal;

[0023] S22, calculate the average absolute value K of H sampled audios n , that is: the average absolute value K n =(ABS(SIG n [1])+ABS(SIG n [2])+ABS(SIG n [3])+......+ABS(SIG n[(H)) / H, where ABS() calculates the absolute value of a numerical value, the symbol "+" represents scalar addition, and the symbol " / " represents scalar division; the average absolute value K in this formula n is for the nth frame of the audio signal;

[0024] S23. According to the average volume meter value formula VU n = 20 * lgK n , calculate VU1, VU2, VU3,..., VU in step S2 respectively n ; where 20 is a calculation constant for VU n , and lg represents the logarithm with base 10.

[0025] In a further preferred technical solution, the single maximum screening times in the empirical mode decomposition algorithm are set to 10, and the screening termination condition is set to the standard deviation SD < 0.000001

[0026] In a further preferred technical solution, the definition of the local maximum value is: if there exists a sequence X[1~N], for m, satisfying X[m - 1] < X[m] ≥ X[m + 1], then E = X[m], and E is called a local maximum value of the sequence X, and m is the position value of this local maximum value.

[0027] In a further preferred technical solution, the opening preset value is set to 4, that is, if the difference P ≤ 4, the electromagnet is turned on, and if the difference P > 4, the electromagnet is turned off.

[0028] The beneficial effects of the present invention are as follows: The method of the present invention is based on the volume meter value, so all the melody and rhythm information in the sound signal is perfectly retained; secondly, using EMD to decompose the volume meter value sequence, the first IMF has the largest weight, so this method selects the most critical melody and rhythm sequences among all the melodies and rhythms; finally, the present invention uses the method of calculating the local maximum value to determine whether there is a rhythm point at the tail of the IMF, thus avoiding the problem of relying on thresholds. Description of the Drawings

[0029] Figure 1 is the audio processing flowchart in the magnetic fluid control process. Detailed Embodiment

[0030] The following further describes the present invention with reference to the drawings.

[0031] This embodiment details a method for controlling a magnetic fluid to move following the music melody using an electromagnet, and its audio signal processing flow is as Figure 1 shown, including the following steps:

[0032] S1. Frame processing of audio signals: the input audio signals are framed in equal lengths according to the preset single-frame sampling length, and the framed audio signals are named in the order of sampling time: SIG1, SIG2, SIG3, ..., SIG n ;

[0033] In this embodiment, the preset single-frame sampling length is 50 milliseconds, that is, SIG1 represents the input signal from time 0 to time 50 milliseconds, SIG2 represents the input signal from time 50 milliseconds to time 100 milliseconds, ..., and so on.

[0034] Regarding the single-frame sampling length, other implementers may adjust it according to the audio signal and other requirements during the specific implementation process;

[0035] S2, calculate the average volume value of each frame: for the several audio signals SIG1, SIG2, SIG3, ..., SIG after framing n Calculate the average volume meter value of each frame and name them VU1, VU2, VU3, ..., VU n ;

[0036] The specific calculation method of the average volume meter value is:

[0037] S21. According to the preset single-frame sampling length and the PCM sampling frequency of the audio, the number of audio samples contained in a single frame is calculated, that is, the number of audio samples contained in a single frame H = single-frame sampling length * PCM sampling frequency; and the H sampled audios are named SIG n [1] SIG n [2] SIG n [3], ......, SIG n [H]; where n represents the nth frame of audio signal; assuming that the PCM sampling frequency of the input audio is 40000 Hz, the number of audio samples contained in a single frame is H = 0.05 seconds * 40000 Hz = 2000;

[0038] S22, calculate the average absolute value K of H sampled audios n , that is: the average absolute value K n =(ABS(SIG n [1])+ABS(SIG n [2])+ABS(SIG n [3])+......+ABS(SIG n [H])) / H, where ABS() is the absolute value of the calculated value, the symbol “+” is scalar addition, and the symbol “ / ” is scalar division; the average absolute value K in this formula nis the nth frame of audio signal; in this embodiment, H=2000, that is:

[0039] Kn=(ABS(SIG n [1])+ABS(SIG n [2])+ABS(SIG n [3])+......+ABS(SIG n

[2000] )) / 2000;

[0040] S23, according to the average volume value formula VU n =20*lgK n , respectively calculate VU1, VU2, VU3, ..., VU in step S2 n ; Among them, 20 is VU n The calculation constant of , lg represents the logarithm with base 10.

[0041] S3, obtaining the average volume meter value series: when the number of collected VU values ​​reaches the preset number R, these collected VU values ​​are grouped into a VU sequence, that is, SEQ = [VU1, VU2, VU3, ..., VU R ]; the length of SEQ is R;

[0042] In this embodiment, R is preset to 60, and the following is obtained: SEQ = [VU1, VU2, VU3, ..., VU 60 ].

[0043] S4, using an empirical mode decomposition algorithm to perform signal decomposition on the average volume counter value series: performing signal decomposition on the obtained VU sequence SEQ according to the empirical mode decomposition algorithm to obtain the first intrinsic mode function IMF1;

[0044] Empirical mode decomposition (EMD) is a commonly used algorithm in the field of digital signal processing, so it will not be described in detail here. In this embodiment, the two parameters that need to be preset in the empirical mode decomposition algorithm are set as follows: the maximum number of single screening times is set to 10, and the screening termination condition is set to the standard deviation SD≤0.000001.

[0045] The decomposition process of the input signal x(t) by empirical mode decomposition (EMD) is as follows:

[0046] (1) Initialization: r(t) = x(t), i = 0, k = 1, the screening termination condition is set to standard deviation SD < 0.000001, and the maximum number of single screenings is set to 10; r(t) represents the residual signal;

[0047] (2) The local maximum and minimum points are obtained by calculating r(t); the maximum and minimum points are fitted by cubic spline curves to obtain the upper and lower envelopes of the signal e max (t) and e min (t), calculate the local average value from the upper and lower envelopes to obtain the average envelope m1(t);

[0048]

[0049] (3) Let i = i + 1, subtract the mean envelope from the original signal, and obtain the component to be identified: P1 1 (t) = r(t) - m1(t). Here, P1 1 (t) is generally not a stationary signal and does not meet the two conditions defined by IMF. Repeat the above process. Assume that after k times (in this embodiment, k is 10, i.e., the maximum number of single screening times) P1 k (t) satisfies the definition of IMF, then the first-order IMF component of the original signal x(t) is c1(t)=IMF1(t)=P1 k (t); Subtract c1(t) from the original signal x(t) to obtain a new signal r1(t) with high-frequency components removed: r1(t) = x(t) - c1(t);

[0050] At this time, the original signal is decomposed by EMD and can be expressed as: x(t)=IMF1(t)+r1(t).

[0051] In actual situations, the mean of the upper and lower envelopes cannot be zero. Usually, when the following formula is satisfied, the mean of the envelope is considered to satisfy the IMF mean zero condition:

[0052]

[0053] In this embodiment, the screening is stopped when the standard deviation SD≤0.000001.

[0054] S5. Calculate all local maxima in the first intrinsic mode function IMF1 obtained after decomposition: According to the calculation principle of the empirical mode decomposition algorithm, the length of IMF1 is consistent with the length of the SEQ input for decomposition, that is, the length of IMF1 is R; traverse the R numbers in IMF1 and calculate the W local maxima therein;

[0055] In this embodiment, since R is preset to be 60, the length of IMF1 is 60.

[0056] S6. Calculate the difference between the length value of IMF1 and the position value of the last local maximum: Extract the position m of the last local maximum from the W local maxima, and calculate the difference P between the length R of IMF1 and the position m of the last local maximum, that is: P = R - m;

[0057] Among them, the definition of the local maximum is: If there exists a sequence X[1~N], for m, satisfying X[m - 1] < X[m] ≥ X[m + 1], then E = X[m], and E is called a local maximum of the sequence X, and m is the position value of this local maximum.

[0058] In this embodiment, P = 60 - m.

[0059] S7. Determine the opening state of the electromagnet according to the obtained difference: If the difference P ≤ the opening preset value, turn on the electromagnet, and the electromagnet attracts the ferrofluid in the sealed container to move; if the difference P > the opening preset value, turn off the electromagnet, and the ferrofluid in the sealed container automatically returns to the original state under the action of its own tension and weight.

[0060] In this embodiment, the opening preset value is set to 4, that is, if the difference P ≤ 4, turn on the electromagnet; if the difference P > 4, turn off the electromagnet.

[0061] The ferrofluid motion control method disclosed by the present invention is mainly a control method based on an electromagnet as a control means. In this solution, unlike the traditional solution, it does not simply directly adopt means such as the volume meter value of the input audio, the amplitude of each frequency band, or the number of beats, and set the on-off threshold of the electromagnet directly based on these reference factors to control the on-off of the electromagnet.

[0062] Because the differences between different styles of music sometimes vary greatly, when the prior art uses the above means to control, the electromagnet will always be in the on or off state for a long time, giving the user the feeling that the music is still playing melodiously, while the ferrofluid always remains in a certain state without moving. By adopting this solution, not only can it be ensured that the user can always observe the movement of the ferrofluid when playing any style of music, but also the regular movement matching the music melody can be observed.

[0063] The above shows and describes the basic principle, main features and advantages of this solution. Those skilled in the art of this industry should understand that this solution is not limited by the above embodiments. What is described in the above embodiments and the specification only illustrates the principle of this solution. Without departing from the spirit and scope of this solution, this solution will have various changes and improvements, and these changes and improvements all fall within the scope of this solution required to be protected. The scope of protection required by this solution is defined by the appended claims and their equivalents.

Claims

1. A method for controlling a magnetic fluid to move following a musical melody using an electromagnet, characterized in that: It includes the following steps: S1. Frame processing of audio signals: the input audio signals are framed in equal lengths according to the preset single-frame sampling length, and the framed audio signals are named in the order of sampling time: SIG1, SIG2, SIG3, ..., SIG n ; S2, calculate the average volume value of each frame: for the several audio signals SIG1, SIG2, SIG3, ..., SIG after framing n Calculate the average volume meter value of each frame and name them VU1, VU2, VU3, ..., VU n ; S3, obtaining the average volume meter value series: when the number of collected VU values ​​reaches the preset number R, these collected VU values ​​are grouped into a VU sequence, that is, SEQ = [VU1, VU2, VU3, ..., VU R ]; the length of SEQ is R; S4. Use the empirical mode decomposition algorithm to decompose the signal of the average volume meter value sequence: Decompose the obtained VU sequence SEQ according to the empirical mode decomposition algorithm to obtain the first intrinsic mode function IMF1; S5. Calculate all local maxima in the first intrinsic mode function IMF1 obtained after decomposition: According to the calculation principle of the empirical mode decomposition algorithm, the length of IMF1 is the same as the length of the input SEQ to be decomposed, that is, the length of IMF1 is R; Traverse the R numbers in IMF1 and calculate the W local maxima existing therein; S6. Calculate the difference between the length value of IMF1 and the position value of the last local maximum: Extract the position m of the last local maximum from the W local maxima and calculate the difference P between the length R of IMF1 and the position m of the last local maximum, that is: P = R - m; S7. Judge the opening state of the electromagnet according to the obtained difference: If the difference P ≤ the opening preset value, turn on the electromagnet to attract the movement of the ferrofluid in the sealed container; If the difference P > the opening preset value, turn off the electromagnet, and the ferrofluid automatically returns to the original state under the action of its own tension and gravity.

2. A method for controlling a magnetic fluid to move following a musical melody using an electromagnet as claimed in claim 1, characterized in that: The preset value of the single-frame sampling length is set to 50 milliseconds.

3. A method for controlling a magnetic fluid to move following a musical melody using an electromagnet as claimed in claim 1, characterized in that: The specific calculation method of the average volume meter value is: S21. According to the preset single-frame sampling length and the PCM sampling frequency of the audio, the number of audio samples contained in a single frame is calculated, that is, the number of audio samples contained in a single frame H = single-frame sampling length * PCM sampling frequency; and the H sampled audios are named SIG n [1] SIG n [2] SIG n [3], ......, SIG n [H]; where n represents the nth frame of audio signal; S22, calculate the average absolute value K of H sampled audios n , that is: the average absolute value K n =(ABS(SIG n [1])+ABS(SIG n [2])+ABS(SIG n [3])+......+ABS(SIG n [H])) / H, where ABS() is the absolute value of the calculated value, the symbol "+" is scalar addition, and the symbol " / " is scalar division; the average absolute value K in this formula n is the nth frame of audio signal; S23, according to the average volume value formula VU n =20*lgK n , respectively calculate VU1, VU2, VU3, ..., VU in step S2 n ; Among them, 20 is VU n The calculation constant of , lg represents the logarithm with base 10.

4. A method for controlling a magnetic fluid to move following a musical melody using an electromagnet as claimed in claim 1, characterized in that: In the empirical mode decomposition algorithm, the single maximum screening times is set to 10, and the screening termination condition is set to standard deviation SD < 0.000001.

5. The method of using electromagnets to control magnetic fluid to move following a musical melody as claimed in claim 1, characterized in that: The definition of the local maximum is: If there exists a sequence X[1~N], for m, satisfying X[m - 1] < X[m] ≥ X[m + 1], then E = X[m], and E is called a local maximum of the sequence X, and m is the position value of the local maximum.

6. A method for controlling a magnetic fluid to move following a musical melody using an electromagnet as claimed in claim 1, characterized in that: The opening preset value is set to 4, that is, if the difference P ≤ 4, turn on the electromagnet, and if the difference P > 4, turn off the electromagnet.

Citation Information

Patent Citations

  • Visualization method and device for enabling magnetofluid to change along with music

    CN113923563A

Cited By

  • Earphone magnetic fluid and audio signal linkage control method

    CN122741839A