Lamp control method and device, vehicle and storage medium
By extracting audio features and controlling the brightness and color of the ambient light, the problem of low matching of the music follow-up function of the ambient light in the existing technology is solved, and rich lighting effects synchronized with music and the function of automatically adapting to different music sources are realized.
Patent Information
- Application Number
- CN202310403692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2024-10-18
AI Technical Summary
In the existing technology, the visual and auditory matching of the music follow-up function of the ambient lamp is low, and there is a lack of effective control means.
By acquiring audio data, extracting audio feature data, dividing it into multiple audio frames, determining the standard energy value of each frame, and controlling the brightness and color of the ambient light according to the relationship between the preset energy value and the lamp working parameters, realizing the integration with music. Synchronized lighting effects.
It achieves precise matching of ambient lighting and music, enriches lighting effects, and can automatically adapt to different music sources to create a unique ambient lighting experience.
Smart Images

Figure CN118790141A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of signal processing, and in particular to a method, device, vehicle and storage medium for controlling a lamp. Background Art
[0002] With the rapid development of vehicle technology and the continuous improvement of users' vehicle experience, the current mainstream models in the market are equipped with ambient lights, which are usually designed with music-following functions, and the changes in the ambient light are used to create a live atmosphere. However, in the related art, the control of ambient lights to achieve the music-following function has the problem of low or no matching between visual and auditory senses, and there is currently a lack of effective means for controlling ambient lights to achieve the music-following function. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a lamp control method, device, vehicle and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an atmosphere light control method, comprising:
[0005] Get audio data;
[0006] Extracting features from the audio data to obtain audio feature data;
[0007] Segmenting the audio feature data to obtain multiple audio frames;
[0008] Determining a standard energy value corresponding to each audio frame, wherein the standard energy value is related to the energy value of the audio frame and the standard energy value is mapped within a preset value interval;
[0009] Determine the lamp operating parameter corresponding to the standard energy value of each audio frame according to the preset correspondence between the standard energy value and the lamp operating parameter;
[0010] The lamp is controlled according to the lamp operating parameters.
[0011] According to a second aspect of an embodiment of the present disclosure, a control device for a lamp is provided, comprising:
[0012] A feature extraction module acquires audio data and performs feature extraction on the audio data to obtain audio feature data;
[0013] A data segmentation module, used for segmenting the audio feature data to obtain multiple audio frames;
[0014] An energy determination module, configured to determine a standard energy value corresponding to each audio frame, wherein the standard energy value is related to the energy value of the audio frame and the standard energy value is mapped within a preset value interval;
[0015] The control module is used to determine the lamp working parameter corresponding to the standard energy value of each audio frame according to the corresponding relationship between the preset standard energy value and the lamp working parameter, and control the lamp according to the lamp working parameter.
[0016] According to a third aspect of an embodiment of the present disclosure, a vehicle is provided, comprising:
[0017] At least one ambient light and at least one speaker;
[0018] At least one processor, the processor being communicatively connected to the atmosphere light and the speaker respectively;
[0019] At least one memory is communicatively connected to the at least one processor; wherein,
[0020] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.
[0021] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor, the processor is enabled to execute the method described in the first aspect above.
[0022] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0023] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: it can accurately extract audio features of multiple dimensions of music, such as beat, melody features and high-frequency features, and output respective brightness values according to the beat features, melody features and high-frequency features. Since each dimension corresponds to a light group of the atmosphere light, the brightness of different light groups can be adjusted according to the brightness values of different dimensions, and the lighting effect is richer. In addition, the music follow-up function of the atmosphere light is realized, which can automatically adapt to different music sources and create different atmosphere light effects for different music sources.
[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0026] Figure 1 The figure is a flow chart of a method for controlling a lamp according to an exemplary embodiment.
[0027] Figure 2 The flowchart of another method for controlling a lamp according to an exemplary embodiment is shown.
[0028] Figure 3 The flowchart of another method for controlling a lamp according to an exemplary embodiment is shown.
[0029] Figure 4 The figure is a block diagram of a lamp control device according to an exemplary embodiment.
[0030] Figure 5 is a block diagram of a vehicle according to an exemplary embodiment. DETAILED DESCRIPTION
[0031] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. Among them, in the description of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0032] It should be noted that the atmosphere light control method provided by the embodiment of the present disclosure can be applied to vehicles. For example, the application scenario of the technical solution of the present disclosure is that in a vehicle environment, while playing a music source in combination with an audio device, the atmosphere light control method of the embodiment of the present disclosure is used to analyze the characteristics of the music source, analyze and match different music styles, convert them into brightness information and send them to the atmosphere light, so as to control the atmosphere light to realize the corresponding music following function. Or it can also be extended to other fields that need to cooperate with the rhythm of music, and the present disclosure does not make specific limitations on this.
[0033] Figure 1 is a flow chart of a method for controlling a lamp according to an exemplary embodiment. Figure 1 As shown, the method includes but is not limited to the following steps.
[0034] S101, obtaining audio data.
[0035] In one implementation, the lamp control method of the embodiment of the present disclosure is applied to a vehicle and can be used to control the ambient light in the vehicle.
[0036] In some implementations, the audio data may be from the audio system of the vehicle-mounted multimedia system. For example, the audio data may be the audio played by the audio system of the vehicle-mounted multimedia system. Alternatively, the audio data may also be the audio played by the mobile device (such as a smart phone) of the vehicle occupant, and the audio played by the mobile device may be obtained through connection. Alternatively, the audio data may also be obtained through implementation methods, which are not specifically limited in this disclosure.
[0037] In some implementations, original audio data to be played is obtained, where the original audio data is multi-channel audio data. Optionally, the multi-channel audio data is converted into a single channel to obtain single-channel audio data.
[0038] For example, the number of channels of the original audio data may be 2.0, 5.1, 7.1.4, etc. In some implementations, the data of all channels in the multi-channel music data may be summed and averaged to obtain single-channel music data.
[0039] S102, extracting features from the audio data to obtain audio feature data.
[0040] In some implementations, the audio feature data may include beat feature data, melody features, and high frequency features.
[0041] In some implementations, the audio data is divided into multiple frequency bands according to a preset frequency band division rule, and for each frequency band, a filter corresponding to the frequency band is used to perform feature filtering processing on the audio data of the frequency band to obtain audio feature data corresponding to the frequency band.
[0042] S103, segmenting the audio feature data to obtain multiple audio frames.
[0043] In one implementation, the audio feature data is segmented according to a preset frame length L to obtain multiple audio frames. That is, after obtaining the audio feature data on multiple dimensions, the feature data on each dimension can be framed according to the preset frame length L, that is, the beat feature data, melody feature data, and high-frequency feature data can be framed according to the preset frame length L. Based on the beat feature data, melody feature data, and high-frequency feature data belonging to the same frame after framing, an audio frame is obtained.
[0044] S104: Determine a standard energy value corresponding to each audio frame.
[0045] In some implementations, the standard energy value corresponding to the audio frame is related to the energy value of the audio frame, and the standard energy value is mapped within a preset numerical range. For example, the numerical range can be (0 to 100)
[0046] In some implementations, for each audio frame, the average energy value of the audio frame is calculated, wherein the audio frame includes L frequency points, and optionally, the total energy values of the L frequency points of the audio frame are calculated, and the average energy value of the audio frame is determined according to the total energy value of the audio frame and the number of frequency points of the audio frame, that is, the average energy value of the audio frame may be the average value of the total energy values of the L frequency points. Further, according to the average energy value of each audio frame, a standard energy value corresponding to the audio frame is determined.
[0047] S105, determining the lamp operating parameters corresponding to the standard energy value of each audio frame according to the preset correspondence between the standard energy value and the lamp operating parameters.
[0048] In some implementations, the lamp operating parameters include: a brightness value and / or a color value of the lamp.
[0049] In some implementations, the correspondence between the preset standard energy value and the lamp operating parameter may include a mapping relationship between the preset standard energy value and the brightness value of the lamp, and / or a mapping relationship between the preset standard energy value and the color value of the lamp.
[0050] After obtaining the standard energy value of each audio frame, the corresponding relationship between the standard energy value and the lamp working parameter can be queried, and the lamp working parameter corresponding to the standard energy value of the audio frame can be determined from the corresponding relationship. In other words, the mapping relationship between the preset standard energy value and the brightness value of the lamp is queried to obtain the brightness value of the lamp corresponding to the standard energy value of each audio frame; the mapping relationship between the preset standard energy value and the color value of the lamp is queried to obtain the color value of the lamp corresponding to the standard energy value of each audio frame.
[0051] S106, controlling the lamp according to the lamp working parameters.
[0052] In the disclosed embodiments, the audio features of multiple dimensions of music, such as beat feature data, melody feature data and high-frequency feature data, can be accurately extracted, and the standard energy value of each audio frame can be determined based on the beat feature data, melody feature data and high-frequency feature data. This allows the brightness and / or color of the light to be adjusted according to the energy value of the music, resulting in richer lighting effects. In addition, the music-following function of the atmosphere light is realized, which can automatically adapt to different music sources and create different atmosphere light effects for different music sources.
[0053] Figure 2is a flow chart showing a method for controlling an interior lamp of a vehicle according to an exemplary embodiment. Figure 2 As shown, the method includes but is not limited to the following steps.
[0054] S201, obtaining audio data.
[0055] In the embodiments of the present disclosure, the implementation of step S201 may be implemented in any of the embodiments of the present disclosure, which is not limited here and will not be described in detail.
[0056] S202, dividing the audio data into multiple frequency bands according to a preset frequency band division rule, and for each frequency band, performing feature filtering processing on the audio data of the frequency band using a filter corresponding to the frequency band to obtain audio feature data corresponding to the frequency band.
[0057] That is to say, the multi-band filter can be used to extract features of music data in multiple dimensions. In the embodiment of the present disclosure, the multi-band filter can be used to extract feature data such as beat, melody, and high frequency from the music data, and beat feature data, melody feature data, and high frequency feature data can be obtained. It can be understood that in signal processing, the multi-band filter is a process of retaining certain frequency band information from a signal. In the embodiment of the present disclosure, the multi-band filter can be used to extract feature data such as beat, melody, and high frequency from single-channel music data.
[0058] In some implementations, the preset frequency band division rule is: below 200 Hz is the low frequency band, 200-1000 Hz is the medium frequency band, and 5000-8000 Hz is the high frequency band.
[0059] For the low frequency band, a low-pass filter is used to extract features of the audio data in the band to obtain beat feature data. For the medium frequency band, a first band-pass filter is used to extract features of the audio data in the band to obtain melody feature data. For the high frequency band, a second band-pass filter is used to extract features of the audio data in the band to obtain high frequency feature data.
[0060] In some implementations, the low-pass filter may be a low-pass filter below 200 Hz; the first band-pass filter may be a band-pass filter of 200 Hz-1000 Hz; and the second band-pass filter may be a band-pass filter of 5000 Hz to 8000 Hz.
[0061] S203, segmenting the audio feature data to obtain multiple audio frames.
[0062] In order to reduce computing resources and reduce the delay of audio processing, optionally, after the audio feature data is acquired, the audio feature data may be downsampled.
[0063] In some implementations, the downsampling coefficients of different types of feature data may be the same or different.
[0064] In some implementations, the sampling rate and downsampling coefficient of each feature data are determined. Further, based on the sampling rate and the downsampling coefficient of each feature dimension, the extracted candidate beat feature data, candidate melody feature data, and candidate high-frequency feature data are downsampled to obtain the downsampled beat feature data, melody feature data, and high-frequency feature data.
[0065] According to the downsampling theorem, in order to prevent aliasing after downsampling, the highest frequency of the signal must satisfy the following formula (5):
[0066]
[0067] Among them, f h is the highest frequency of the downsampled signal, f s is the sampling rate, and D is the downsampling coefficient. Optionally, when downsampling each feature data, after determining the downsampling coefficient of the current type of feature signal, the audio feature data of every D points of the current type of feature signal can be retained as the audio feature data to be processed later. Thus, the computing power can be reduced and the delay can be reduced by downsampling processing.
[0068] Furthermore, according to a preset frame length L, the downsampled audio feature data is segmented to obtain a plurality of audio frames.
[0069] S204: For each audio frame, calculate an average energy value of the audio frame.
[0070] In some implementations, the audio frame includes L frequency points, wherein the average energy value is an average value of total energy values of the L frequency points.
[0071] For example, taking the energy calculation of the nth audio frame as an example, for each audio frame, the average energy value p of the frame can be calculated. For example, the calculation formula of the average energy value p is expressed as follows:
[0072]
[0073] Wherein, x(n) represents the nth frame, L is the frame length, which represents the number of sampling points included in the frame, and each sampling point corresponds to a set of feature data.
[0074] S205 , performing normalization processing on the average energy value of each audio frame according to a preset normalization algorithm to obtain a normalized energy value corresponding to each audio frame.
[0075] Optionally, the average energy value of the current frame is normalized based on the average energy value of the current frame, the average energy value of the previous frame, and the average energy difference between the current frame and the previous frame to obtain a normalized energy value corresponding to the average energy value of the current frame. Optionally, based on the difference, the historical maximum energy value is determined from the average energy value of the previous frame and the average energy of the current frame and the previous frame. If the difference is greater than zero, it means that the average energy value of the previous frame is greater than the average energy value of the current frame and the previous frame, and it can be determined that the average energy value of the previous frame is the historical maximum energy value. If the difference is less than zero, it means that the average energy value of the previous frame is less than the average energy value of the current frame and the previous frame, and it can be determined that the average energy value of the current frame is the historical maximum energy value.
[0076] By way of example, after obtaining the average energy value p of the nth audio frame, the average energy value of the frame may be normalized to control the standard energy value of the audio frame within a preset value range, for example, the value range may be 0-100.
[0077] In the present disclosure, the historical maximum energy value maxPow(k) can be obtained by comparing the energies p(k-1) and p(k) of the previous and next frames, and p(k) can be normalized using the historical maximum energy value maxPow(k) to obtain the normalized energy value normPow(k):
[0078]
[0079]
[0080] Among them, maxPow(k) is the historical maximum capacity value; normPow(k) is the normalized energy value; p(k-1) is the energy value of the (n-1)th frame; and p(k) is the energy value of the nth frame.
[0081] S206: Smoothing the normalized energy value corresponding to each audio frame according to a preset smoothing algorithm to obtain a smoothed energy value corresponding to each audio frame.
[0082] In order to reduce noise to obtain data with less noise and ensure the smoothness of feature data between adjacent frames, the normalized energy values of the two frames before and after can be smoothed, so that the changes of the working parameters of the lamp between frames are stable.
[0083] In some implementations, a first smoothing coefficient of the current frame and a second smoothing coefficient of the previous frame are determined based on the normalized energy value of the current frame. Furthermore, based on the first smoothing coefficient and the second smoothing coefficient, weighted smoothing is performed on the normalized energy value of the previous frame and the smoothed energy value of the current frame to obtain a smoothed energy value corresponding to the normalized energy value of the current frame.
[0084] For example, after obtaining the normalized energy value of the nth audio frame, the first smoothing coefficient of the nth audio frame and the second smoothing coefficient of the n-1th audio frame can be determined according to the normalized energy value of the nth audio frame. For example, the first smoothing coefficient of the nth audio frame is set to a, and the second smoothing coefficient of the n-1th audio frame is set to 1-a. In the embodiment of the present disclosure, the normalized energy value of the nth audio frame is determined as the first smoothing coefficient a of the nth audio frame.
[0085] Optionally, based on the first smoothing coefficient and the second smoothing coefficient, the feature data of the n-1th audio frame and the feature data of the nth audio frame are smoothed to obtain a smoothed energy value of the nth audio frame.
[0086] As an example, the calculation formula of the smoothing process is expressed as follows:
[0087] y(n)=x(n-1)*a+x(n)*(1-a)a∈[0,1](4)
[0088] Among them, y(n) is the smoothed energy value of the nth frame after smoothing, x(n-1) is the normalized energy value of the n-1th audio frame before smoothing, x(n) is the normalized energy value of the nth audio frame before smoothing, and a is the smoothing coefficient. The larger the smoothing coefficient, the smaller the impact of the current frame and the more obvious the smoothing effect.
[0089] S207: Convert the smoothed energy value corresponding to each audio frame according to a preset dynamic range control algorithm to obtain a standard energy value corresponding to each audio frame.
[0090] The smoothed energy value of the audio frame is compressed using a dynamic range compression algorithm to obtain a standard energy value of the audio frame, so as to map the standard energy value of the audio frame to a preset numerical range, which can be in the range of 0-100.
[0091] Dynamic Range Control (DRC) maps the dynamic range of the input audio data to a specified dynamic range, which can make the sound sound softer or louder, that is, a signal amplitude adjustment method. Usually, the dynamic range after mapping is smaller than the dynamic range before mapping, so it is called dynamic range compression. DRC is widely used in the field of audio processing. In some implementations, the standard energy value of the audio frame is converted from the linear domain to the dB domain to obtain the decibel value corresponding to the audio frame. Further, based on the decibel value and the DRC static curve, the DRC initial gain is determined. Further, the DRC initial gain is gain-smoothed by the attack time, release time, and hold time to obtain the DRC smoothed gain. After determining the DRC smoothed gain, the DRC smoothed gain can be gain-supplemented to obtain the DRC supplemented gain. Further, the DRC supplemented gain is converted from the dB domain to the linear domain to obtain the DRC linear domain gain, and the DRC linear domain gain is multiplied by the standard energy value of the audio frame to obtain the standard energy value.
[0092] S208, determining the lamp operating parameters corresponding to the standard energy value of each audio frame according to the preset correspondence between the standard energy value and the lamp operating parameters.
[0093] In the embodiments of the present disclosure, the implementation of step S208 may be implemented in any of the embodiments of the present disclosure, which is not limited here and will not be described in detail.
[0094] S209, controlling the lamp according to the lamp working parameters.
[0095] In the disclosed embodiments, the audio features of multiple dimensions of music, such as beat feature data, melody feature data, and high-frequency feature data, can be accurately extracted. According to the beat, melody, high-frequency and other feature data, the standard energy value of the audio frame can be determined, and the working parameters of the lamp can be determined based on the standard energy value, so that the brightness and / or color of the lamp can be adjusted according to the energy value of the music, the lighting effect is richer, and the music follow-up function of the atmosphere lamp is realized, which can automatically adapt to different music sources and create different lighting effects for different music sources. In addition, the computing power can be reduced and the delay can be reduced by downsampling. In addition, smoothing processing is performed during the acquisition of standard energy acquisition, and data with less noise can be obtained to achieve a noise reduction effect.
[0096] The following will be combined Figure 3 The present disclosure is described exemplarily.
[0097] like Figure 3As shown, the atmosphere light control method may include the following steps.
[0098] Step 1: Multi-channel music data can be synthesized into single-channel music data.
[0099] Step 2: Input a single-channel music source into a multi-band filter, and obtain beat feature data, melody feature data, and high-frequency feature data through the multi-band filter.
[0100] Step 3: Down-sampling and framing the beat feature data, melody feature data and high-frequency feature data respectively.
[0101] Step 4: Process the framed beat feature data, melody feature data and high-frequency feature data through a basic algorithm to obtain a standard energy value of the audio frame.
[0102] Among them, the basic algorithm mainly calculates the energy, normalization and dynamic range compression of each frame of data to obtain a standard energy value. Further, based on the standard energy value, the working parameters of the lamp, such as the brightness value and / or color value of the lamp, are obtained.
[0103] In the disclosed embodiments, the audio features of multiple dimensions of music, such as beat feature data, melody feature data, and high-frequency feature data, can be accurately extracted. According to the beat, melody, high-frequency and other feature data, the standard energy value of the audio frame can be determined, and the working parameters of the lamp can be determined based on the standard energy value, so that the brightness and / or color of the lamp can be adjusted according to the energy value of the music, the lighting effect is richer, and the music follow-up function of the atmosphere lamp is realized, which can automatically adapt to different music sources and create different lighting effects for different music sources. In addition, the computing power can be reduced and the delay can be reduced by downsampling. In addition, smoothing processing is performed during the acquisition of standard energy acquisition, and data with less noise can be obtained to achieve a noise reduction effect.
[0104] On the basis of the above embodiments, a possible implementation method is to pre-group the lamp beads on the lamp (such as the interior atmosphere lamp) to obtain different lamp groups, and each lamp group can correspond to different feature dimensions. The interior atmosphere lamp is introduced as an example: Optionally, several consecutive lamp groups or a continuous section of beads can be divided into a group. For example, the length of the atmosphere lamp is 3 meters, and the lamp beads on 0 to 1 meter can be divided into lamp group A, the lamp beads on 1 to 2 meters can be divided into lamp group B, and the lamp beads on 2 to 3 meters can be divided into lamp group C.
[0105] Optionally, the lamp beads on the atmosphere lamp can be divided into lamp groups according to a certain rule. For example, the 1st lamp bead, the 4th lamp bead, the 7th lamp bead ... the (3n+1)th lamp bead can be divided into lamp group A; the 2nd lamp bead, the 5th lamp bead, the 8th lamp bead ... the (3n+2)th lamp bead can be divided into lamp group B; the 3rd lamp bead, the 6th lamp bead, the 8th lamp bead ... the (3n+3)th lamp bead can be divided into lamp group C.
[0106] Optionally, the light groups on the atmosphere light can be divided into light groups according to interval periods. For example, the 1st to 10th lamp beads can be divided into light group A, the 11th to 20th lamp beads can be divided into light group B, and the 21st to 30th lamp beads can be divided into light group C. Further, the 31st to 40th lamp beads can be divided into light group A, the 41st to 50th lamp beads can be divided into light group B, the 51st to 60th lamp beads can be divided into light group C... and so on. That is to say, the atmosphere light is first divided into multiple sections, each section includes a light group of each dimension.
[0107] It is understandable that the atmosphere lights may be grouped in other implementations in the present disclosure, and the present disclosure does not make any specific limitation on this.
[0108] In some implementations, the standard energy component value of the audio frame in each feature dimension can be calculated based on the audio feature data of the audio frame in each feature dimension. Optionally, the standard energy component value of the audio frame in the beat feature dimension can be calculated based on the beat feature data of the audio frame in the beat feature dimension. Optionally, the average energy component value of the audio frame in the beat feature dimension is determined based on the beat feature data, and the average energy component value is normalized based on a preset normalization algorithm to obtain the normalized energy component value of the audio frame in the beat feature dimension. Further, the normalized energy component value is smoothed based on a preset smoothing algorithm to obtain the smoothed energy component value of the audio frame in the beat feature dimension, and the smoothed energy component value is converted based on a preset DRC algorithm to obtain the standard energy component value of the audio frame in the beat feature dimension. The process of the standard energy component value of the audio frame in the melody feature dimension and the standard energy component value in the high-frequency feature dimension is similar to the process of the standard energy component value in the beat feature dimension, and will not be repeated here.
[0109] Furthermore, based on the standard energy component value corresponding to each characteristic dimension, the light operating parameters of the light group corresponding to the characteristic dimension are determined, for example, the brightness value and / or color value of the light group. After the light operating parameters of the light group corresponding to each characteristic dimension are determined, the brightness value and / or color value of the light group corresponding to the characteristic dimension are adjusted according to the light operating parameters of the characteristic dimension, so that the brightness value and / or color value of the light group corresponding to the characteristic dimension can be dynamically changed with the group music, so that the display effect is more matched with the music.
[0110] By way of example, the light group corresponding to the beat feature dimension is light group A, the light group corresponding to the melody feature dimension is light group B, and the light group corresponding to the high-frequency feature dimension is light group C. After determining the standard energy component value of the audio frame in the beat feature dimension, the light working parameters of light group A can be determined based on the standard energy component value in the beat feature dimension, and light group A can be controlled to display according to the brightness value and / or color value of light group A. After determining the standard energy component value of the audio frame in the melody feature dimension, the light working parameters of light group B can be determined based on the standard energy component value in the melody feature dimension, and light group B can be controlled to display according to the brightness value and / or color value of light group B. After determining the standard energy component value of the audio frame in the high-frequency feature dimension, the light working parameters of light group C can be determined based on the standard energy component value in the high-frequency feature dimension, and light group C can be controlled to display according to the brightness value and / or color value of light group C. It can be understood that in the present disclosure, the standard energy component values are output respectively according to the beat characteristics, melody characteristics and high-frequency characteristics. Based on the standard energy component values in the feature dimensions, the atmosphere lights can be grouped and controlled, so that the brightness value and / or color value of the light group corresponding to each feature dimension can be adjusted according to the brightness values of different dimensions, and the lighting effect is richer.
[0111] Figure 4 is a block diagram of a lamp control device according to an exemplary embodiment. Figure 4 The device includes: a feature extraction module 401, a data framing module 402, an energy determination module 403 and a control module 404.
[0112] The feature extraction module 401 acquires audio data and performs feature extraction on the audio data to obtain audio feature data;
[0113] A data framing module 402 is used to segment the audio feature data to obtain multiple audio frames;
[0114] An energy determination module 403, configured to determine a standard energy value corresponding to each audio frame, wherein the standard energy value is related to the energy value of the audio frame and the standard energy value is mapped within a preset value interval;
[0115] The control module 404 is used to determine the lamp operating parameters corresponding to the standard energy value of each audio frame according to the preset correspondence between the standard energy value and the lamp operating parameters, and control the lamp according to the lamp operating parameters.
[0116] In some implementations, the lamp operating parameters include: the brightness value and / or color value of the lamp; the correspondence between the preset standard energy value and the lamp operating parameters includes: the mapping relationship between the preset standard energy value and the brightness value of the lamp, and / or, the mapping relationship between the preset standard energy value and the color value of the lamp.
[0117] In some implementations, the feature extraction module 401 is further used to: divide the audio data into multiple frequency bands according to a preset frequency band division rule; for each frequency band, use a filter corresponding to the frequency band to perform feature filtering on the audio data of the frequency band to obtain audio feature data corresponding to the frequency band.
[0118] In some implementations, the preset frequency band division rule is: below 200 Hz is a low frequency band, 200-1000 Hz is a medium frequency band, and 5000-8000 Hz is a high frequency band;
[0119] In some implementations, the feature extraction module 401 is also used to: for the low-frequency band, use a low-pass filter to perform feature extraction on the audio data in the frequency band to obtain beat feature data; for the medium-frequency band, use a first band-pass filter to perform feature extraction on the audio data in the frequency band to obtain melody feature data; for the high-frequency band, use a second band-pass filter to perform feature extraction on the audio data in the frequency band to obtain high-frequency feature data.
[0120] In some implementations, the feature extraction module 401 is further used to: after obtaining the audio feature data corresponding to the frequency band, downsample the obtained audio feature data according to a preset sampling rate and sampling coefficient; wherein the preset sampling rate and sampling coefficient satisfy the following formula:
[0121]
[0122] where f h is the highest frequency after downsampling, f s is the sampling rate and D is the downsampling factor.
[0123] In some implementations, the data framing module 402 is further used to segment the audio feature data according to a preset frame length L to obtain multiple audio frames.
[0124] In some implementations, the energy determination module 403 is further used to: calculate, for each audio frame, an average energy value of the audio frame, wherein the audio frame includes L frequency points, and the average energy value is the average value of the total energy values of the L frequency points; and determine a standard energy value corresponding to the audio frame based on the average energy value of each audio frame.
[0125] In some implementations, the energy determination module 403 is also used to: normalize the average energy value of each audio frame according to a preset normalization algorithm to obtain a normalized energy value corresponding to each audio frame; smooth the normalized energy value corresponding to each audio frame according to a preset smoothing algorithm to obtain a smoothed energy value corresponding to each audio frame; convert the smoothed energy value corresponding to each audio frame according to a preset dynamic range control algorithm to obtain the standard energy value.
[0126] In some implementations, the energy determination module 403 is also used to: normalize the average energy value of the current frame according to the average energy value of the current frame, the average energy value of the previous frame, and the average energy difference between the current frame and the previous frame, to obtain a normalized energy value corresponding to the average energy value of the current frame.
[0127] In some implementations, the energy determination module 403 is also used to: determine a first smoothing coefficient of the current frame and a second smoothing coefficient of the previous frame based on the normalized energy value of the current frame; and perform weighted smoothing on the normalized energy value of the previous frame and the smoothed energy value of the current frame based on the first smoothing coefficient and the second smoothing coefficient to obtain a smoothed energy value corresponding to the normalized energy value of the current frame.
[0128] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0129] In the disclosed embodiments, the audio features of multiple dimensions of music, such as beat feature data, melody feature data, and high-frequency feature data, can be accurately extracted. According to the beat, melody, high-frequency and other feature data, the standard energy value of the audio frame can be determined, and the working parameters of the lamp can be determined based on the standard energy value, so that the brightness and / or color of the lamp can be adjusted according to the energy value of the music, the lighting effect is richer, and the music follow-up function of the atmosphere lamp is realized, which can automatically adapt to different music sources and create different lighting effects for different music sources. In addition, the computing power can be reduced and the delay can be reduced by downsampling. In addition, smoothing processing is performed during the acquisition of standard energy acquisition, and data with less noise can be obtained to achieve a noise reduction effect.
[0130] Figure 5is a block diagram of a vehicle 500 according to an exemplary embodiment. Figure 5 , the vehicle 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 505 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 515 .
[0131] The processing component 502 generally controls the overall operation of the vehicle 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-described method. In addition, the processing component 502 may include one or more modules to facilitate interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
[0132] The memory 504 is configured to store various types of data to support operations on the device 500. Examples of such data include instructions for any application or method operating on the vehicle 500, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0133] Power assembly 505 provides power to various components of vehicle 500. Power assembly 505 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to vehicle 500.
[0134] The multimedia component 508 includes a screen that provides an output interface between the vehicle 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes one or more cameras. The camera may receive external multimedia data when the device 500 is in an operating mode, such as a shooting mode or a video mode. Each camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0135] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the vehicle 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 515. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals. The audio component 510 can also include a speaker for externally playing audio signals.
[0136] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0137] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the vehicle 500. For example, the sensor assembly 514 can detect the open / closed state of the device 500, the relative positioning of the components, such as the display and keypad of the vehicle 500, and the sensor assembly 514 can also detect the position change of the vehicle 500 or a component of the vehicle 500, the presence or absence of user contact with the vehicle 500, the orientation or acceleration / deceleration of the vehicle 500, and the temperature change of the vehicle 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0138] The communication component 515 is configured to facilitate wired or wireless communication between the vehicle 500 and other devices. The vehicle 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 515 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 515 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0139] In an exemplary embodiment, the vehicle 500 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described methods.
[0140] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, which can be executed by a processor 520 of the vehicle 500 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0141] In an exemplary embodiment, a computer program product is also provided, comprising a computer program, which implements the steps of the above method when executed by the processor 520 of the vehicle 500 .
[0142] In an exemplary embodiment, the vehicle may further include at least one ambient light 530, which may be a light-emitting diode (LED) light strip. The ambient light 530 may be disposed at the top of the vehicle, or at the bottom of the vehicle, or at the rear of the vehicle.
[0143] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0144] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for controlling a lamp, characterized in that: include: Get audio data; Extracting features from the audio data to obtain audio feature data; Segmenting the audio feature data to obtain multiple audio frames; Determining a standard energy value corresponding to each audio frame, wherein the standard energy value is related to the energy value of the audio frame and the standard energy value is mapped within a preset value interval; Determine the lamp operating parameter corresponding to the standard energy value of each audio frame according to the preset correspondence between the standard energy value and the lamp operating parameter; The lamp is controlled according to the lamp operating parameters.
2. The method according to claim 1, characterized in that: The lamp operating parameters include: the brightness value and / or color value of the lamp; The correspondence between the preset standard energy value and the lamp operating parameter includes: a mapping relationship between the preset standard energy value and the brightness value of the lamp, and / or a mapping relationship between the preset standard energy value and the color value of the lamp.
3. The method according to claim 1, characterized in that The step of extracting features from the audio data to obtain audio feature data includes: Dividing the audio data into multiple frequency bands according to a preset frequency band division rule; For each frequency band, a filter corresponding to the frequency band is used to perform feature filtering processing on the audio data of the frequency band to obtain audio feature data corresponding to the frequency band.
4. The method according to claim 3, characterized in that The preset frequency band division rule is: below 200 Hz is the low frequency band, 200-1000 Hz is the medium frequency band, and 5000-8000 Hz is the high frequency band; For each frequency band, the audio data of the frequency band is subjected to feature filtering processing by using a filter corresponding to the frequency band to obtain audio feature data corresponding to the frequency band: including: For the low-frequency band, a low-pass filter is used to extract features of the audio data in the band to obtain beat feature data; For the intermediate frequency band, using a first bandpass filter to extract features from the audio data in the band to obtain melody feature data; For the high-frequency frequency band, a second bandpass filter is used to extract features from the audio data in the frequency band to obtain high-frequency feature data.
5. The method according to claim 3, characterized in that: After obtaining the audio feature data corresponding to the frequency band, the method further includes: The obtained audio feature data is downsampled according to a preset sampling rate and sampling coefficient; wherein the preset sampling rate and sampling coefficient satisfy the following formula: where f h is the highest frequency after downsampling, f s is the sampling rate and D is the downsampling factor.
6. The method according to any one of claims 1 to 5, characterized in that The step of segmenting the audio feature data to obtain a plurality of audio frames includes: The audio feature data is segmented according to a preset frame length L to obtain a plurality of audio frames.
7. The method according to claim 6, characterized in that The determining of the standard energy value corresponding to each audio frame includes: For each audio frame, calculating an average energy value of the audio frame, wherein the audio frame includes L frequency points, and the average energy value is an average value of total energy values of the L frequency points; A standard energy value corresponding to each audio frame is determined according to the average energy value of the audio frame.
8. The method according to claim 7, characterized in that The step of determining a standard energy value corresponding to each audio frame according to the average energy value of the audio frame includes: According to a preset normalization algorithm, the average energy value of each audio frame is normalized to obtain a normalized energy value corresponding to each audio frame; According to a preset smoothing algorithm, the normalized energy value corresponding to each audio frame is smoothed to obtain a smoothed energy value corresponding to each audio frame; According to a preset dynamic range control algorithm, the smoothed energy value corresponding to each audio frame is converted to obtain the standard energy value corresponding to each audio frame.
9. The method according to claim 8, characterized in that The step of normalizing the average energy value of each audio frame according to a preset normalization algorithm to obtain a normalized energy value corresponding to each audio frame includes: According to the average energy value of the current frame, the average energy value of the previous frame, and the average energy difference between the current frame and the previous frame, the average energy value of the current frame is normalized to obtain a normalized energy value corresponding to the average energy value of the current frame.
10. The method according to claim 8, characterized in that The step of smoothing the normalized energy value corresponding to each audio frame according to a preset smoothing algorithm to obtain a smoothed energy value corresponding to each audio frame includes: Determine, according to the normalized energy value of the current frame, a first smoothing coefficient of the current frame and a second smoothing coefficient of the previous frame; Based on the first smoothing coefficient and the second smoothing coefficient, weighted smoothing is performed on the normalized energy value of the previous frame and the smoothed energy value of the current frame to obtain a smoothed energy value corresponding to the normalized energy value of the current frame.
11. A lamp control device, characterized in that: include: A feature extraction module acquires audio data and performs feature extraction on the audio data to obtain audio feature data; A data framing module, used to segment the audio feature data to obtain multiple audio frames; An energy determination module, configured to determine a standard energy value corresponding to each audio frame, wherein the standard energy value is related to the energy value of the audio frame and the standard energy value is mapped within a preset value interval; The control module is used to determine the lamp working parameter corresponding to the standard energy value of each audio frame according to the corresponding relationship between the preset standard energy value and the lamp working parameter, and control the lamp according to the lamp working parameter.
12. A vehicle, characterized in that: include: At least one ambient light and at least one speaker; At least one processor, the processor being communicatively connected to the atmosphere light and the speaker respectively; At least one memory is communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor, the processor is enabled to perform the method according to any one of claims 1 to 10.
