Control method and device for light display

文档序号:1026216 发布日期:2020-10-27 浏览:9次 中文

阅读说明:本技术 一种灯光显示的控制方法及装置 (Control method and device for light display ) 是由 姚博 刘宗孺 李志为 于 2017-09-27 设计创作,主要内容包括:本发明公开了一种灯光显示的控制方法,包括以下步骤:数据获取步骤:获取音乐的PCM波形数据,并从PCM波形数据中抽取相应的数据以生成音乐数据段;频谱生成步骤:对各个音乐数据段进行快速傅里叶变换以生成频谱特征图;第一灯光调整步骤:根据频谱特征图中的频谱特征获取得灯光显示特征以对灯光进行相应的调整。本发明还公开了一种电子设备、计算机可读存储介质和灯光显示的控制装置。本发明的灯光显示的控制方法能够更加完整的通过灯光变化展现出音乐频谱特征,使得人耳可感知的频率响度等变化信息直接通过灯光展现出来,从而实现音乐可视化。(The invention discloses a control method of lamplight display, which comprises the following steps: a data acquisition step: acquiring PCM waveform data of music and extracting corresponding data from the PCM waveform data to generate music data segments; a spectrum generation step: performing fast Fourier transform on each music data segment to generate a spectral feature map; a first light adjusting step: and obtaining the light display characteristics according to the frequency spectrum characteristics in the frequency spectrum characteristic diagram so as to correspondingly adjust the light. The invention also discloses an electronic device, a computer readable storage medium and a control device for light display. The control method for the light display can show the music frequency spectrum characteristics more completely through the light change, so that the change information such as frequency loudness and the like which can be perceived by human ears is directly shown through the light, and the music visualization is realized.)

1. A control method for light display is characterized by comprising the following steps:

a data acquisition step: acquiring PCM waveform data of music and extracting corresponding data from the PCM waveform data to generate music data segments;

a spectrum generation step: performing fast Fourier transform on each music data segment to generate a spectral feature map;

a first light adjusting step: obtaining a light display characteristic according to the frequency spectrum characteristic in the frequency spectrum characteristic diagram so as to correspondingly adjust the light; the spectral characteristics comprise a spectral change rate, spectral complexity and musical tone intensity; the lamplight display characteristics comprise a hue value, lamplight saturation and lamplight brightness; the light display characteristic is light saturation, and the first light adjustment step specifically is: according to the mapping relation between the light saturation and the frequency spectrum characteristic value: and S0[ (1-b) × k + b ], obtaining the light saturation to correspondingly adjust the light, wherein S0 is the maximum value of the light saturation, b is a preset parameter, S is the light saturation, and k is a frequency spectrum characteristic value.

2. A light display control method according to claim 1, wherein the light display characteristic is a hue value, and the first light adjustment step is: according to the mapping relation between the hue value and the spectrum characteristic value: h0+ Δ h, and Δ h g × k, where h0 is the hue value at the previous moment, Δ h is the hue change value, g is the hue change coefficient, and k is the spectrum characteristic value.

3. The light display control method according to claim 1, wherein the light display characteristic is a light brightness value, and the first light adjustment step specifically includes: obtaining a light brightness value according to a brightness value formula B ═ k × m/n, wherein B is the light brightness value, k is a frequency spectrum characteristic value, n is a frequency spectrum proportionality coefficient, and m is a maximum brightness value; and obtaining a spectrum scale coefficient n according to the n-f/m, and updating n in the brightness value formula, wherein f is the maximum spectrum characteristic value.

4. A control method of light display according to claim 1, 2 or 3, characterized in that the spectral feature is a spectral change rate, and the spectral change rate calculating step comprises the following substeps:

calculating a frequency amplitude difference value: calculating and summing the absolute value of the amplitude difference value of each frequency point in the frequency spectrum characteristic diagram at the current moment and the previous moment, and recording the result as s 1;

a comparison step: and comparing the amplitude of each frequency point in the spectrum characteristic diagram of the current time and the previous time, summing the larger values of the amplitudes, recording the result as s2, and obtaining the spectrum change rate k1 which is s1/s 2.

5. A light display control method according to claim 1, 2 or 3, wherein when the spectral feature is a spectral complexity, the spectral complexity calculation formula specifically includes the following sub-steps:

and (3) calculating the ratio: calculating the proportion p of the maximum amplitude corresponding to the frequency points in the frequency spectrum characteristic diagram in the total amplitude;

and a complexity calculation step: the spectral complexity is obtained according to the formula q 1-p.

6. A light display control method according to claim 1, wherein the spectral feature is a music intensity, the light display feature is a light brightness value, and the first light adjustment step specifically includes the following substeps:

sound intensity obtaining step: obtaining the current music sound intensity, and obtaining a light brightness value according to a brightness value formula B ═ x × m/n, wherein B is the light brightness value, x is the current music sound intensity, n is a proportionality coefficient, and m is the maximum brightness value;

a judging step: judging whether the light brightness value is larger than the maximum brightness value, if so, correspondingly adjusting the light according to the light brightness value and executing the coefficient calculation step, and if not, correspondingly adjusting the light according to the light brightness value;

coefficient calculation step: and taking the current music sound intensity as the maximum music sound intensity, adjusting the light brightness value to be the maximum brightness value, obtaining a proportional coefficient n according to the condition that n is f/m, and updating n in a brightness value formula, wherein f is the maximum music sound intensity.

7. A light display control method according to claim 1, wherein when the number of the lamps is plural, the spectrum at each time is segmented according to the number of the lamps, the spectrum variation of each segment at each time is calculated, and a corresponding control signal is obtained according to the spectrum variation to control the corresponding lamp to perform light adjustment.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of:

a data acquisition step: acquiring PCM waveform data of music and extracting corresponding data from the PCM waveform data to generate music data segments;

a spectrum generation step: performing fast Fourier transform on each music data segment to generate a spectral feature map;

a first light adjusting step: obtaining a light display characteristic according to the frequency spectrum characteristic in the frequency spectrum characteristic diagram so as to correspondingly adjust the light; the spectral characteristics comprise a spectral change rate, spectral complexity and musical tone intensity; the lamplight display characteristics comprise a hue value, lamplight saturation and lamplight brightness; the light display characteristic is light saturation, and the first light adjustment step specifically is: according to the mapping relation between the light saturation and the frequency spectrum characteristic value: and S0[ (1-b) × k + b ], obtaining the light saturation to correspondingly adjust the light, wherein S0 is the maximum value of the light saturation, b is a preset parameter, S is the light saturation, and k is a frequency spectrum characteristic value.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program, when executed by a processor, implements the method of any one of claims 1-7.

10. A control device for light display is characterized by comprising the following modules:

a data acquisition module: PCM waveform data for acquiring music and extracting corresponding data from the PCM waveform data to generate music data pieces;

a spectrum generation module: the system comprises a data processing module, a data processing module and a data processing module, wherein the data processing module is used for performing fast Fourier transform on each music data segment to generate a spectrum characteristic map;

first light adjustment module: the lamplight display characteristic is obtained according to the frequency spectrum characteristic in the frequency spectrum characteristic diagram so as to correspondingly adjust lamplight; the spectral characteristics comprise a spectral change rate, spectral complexity and musical tone intensity; the lamplight display characteristics comprise a hue value, lamplight saturation and lamplight brightness; the light shows the characteristic and is the light saturation, and first light adjustment module specifically is: according to the mapping relation between the light saturation and the frequency spectrum characteristic value: and S0[ (1-b) × k + b ], obtaining the light saturation to correspondingly adjust the light, wherein S0 is the maximum value of the light saturation, b is a preset parameter, S is the light saturation, and k is a frequency spectrum characteristic value.

Technical Field

The invention relates to the technical field of light control, in particular to a control method and device for light display. The application is a divisional application, the application number of a parent application is 201710892476.4, the application date of the parent application is 2017, 9 and 27, and the invention name of the parent application is a control method and a control device for light display.

Background

At present, a plurality of bulbs for supporting and adjusting color and brightness are available on the market, and people can change the light effect according to scene needs. Many stage performances, concerts, KTVs and indoor light shows all require that the lighting effect and the music match.

Most of current stage lighting still adopt artifical programming's mode in advance, realize the cooperation of music and light effect, need consume a large amount of manpowers, and inefficiency. The ordinary indoor light show has a cyclic repeating effect generally, and cannot well match with the melody and rhythm of music playing.

For the variable color bulb, the display parameters usually only have hue, saturation and brightness, the music usually has only intensity corresponding to the brightness of the light, and the music has melody, tone and other abstract features which are difficult to establish a proper and general model and correspond to the parameters of the light.

The application numbers are: 201610627665.4 discloses a music color lamp controller design based on rhythm following, which discloses that the short-time energy extreme value is used to judge and achieve the music rhythm detection effect, to obtain the time point information of the music rhythm, and at the time point of the music rhythm, to perform the spectrum analysis and processing to the short-time signal at the time point, to obtain the real-time sound wave energy and spectrum characteristic parameters, to respectively establish the mapping relation model of pitch and color domain, tone and saturation, tone intensity and brightness, to change the color of the color lamp into the color obtained by the frequency domain information conversion of the audio waveform at the point, to realize the synchronization of the color lamp color change and the music rhythm change.

However, the existing solutions have the following drawbacks:

the color of the colored lamps is controlled at the rhythm point of the music, other characteristics in the music cannot be reflected, and the change of the light is less at the non-rhythm point and the position where the rhythm is not obvious. The method of mapping the relationship between the pitch and the color domain and between the tone and the saturation is not suitable for all situations, most music has chords and harmony, and popular music and rock music have more track information, which track is suitable for the real pitch and is not easy to distinguish, so that the method is also insufficient in the color control of the light.

Disclosure of Invention

In order to overcome the disadvantages of the prior art, an object of the present invention is to provide a method for controlling a light display, which can solve the technical problem of responding to a corresponding light according to music.

Another object of the present invention is to provide an electronic device that can solve the technical problem of responding to the corresponding light according to music.

It is another object of the present invention to provide a computer-readable storage medium that can solve the technical problem of responding to corresponding lights according to music.

It is a fourth object of the present invention to provide a control device for light display, which can solve the technical problem of responding to the corresponding light according to music.

One of the purposes of the invention is realized by adopting the following technical scheme:

a control method of light display comprises the following steps:

a data acquisition step: acquiring PCM waveform data of music and extracting corresponding data from the PCM waveform data to generate music data segments;

a spectrum generation step: performing fast Fourier transform on each music data segment to generate a spectral feature map;

a first light adjusting step: and obtaining the light display characteristics according to the frequency spectrum characteristics in the frequency spectrum characteristic diagram so as to correspondingly adjust the light.

Further, the spectral features include spectral rate of change, spectral complexity, and musical tone intensity; the light display characteristics include hue value, light saturation and light brightness.

Further, the light display characteristic is a hue value, and the first light adjustment step is: : according to the mapping relation between the hue value and the spectrum characteristic value: h0+ Δ h, and Δ h g × k, where h0 is the hue value at the previous moment, Δ h is the hue change value, g is the hue change coefficient, and k is the spectrum characteristic value.

Further, the light display characteristic is light saturation, and the first light adjustment step specifically includes: according to the mapping relation between the light saturation and the frequency spectrum characteristic value: and S0[ (1-b) × k + b ], obtaining the light saturation to correspondingly adjust the light, wherein S0 is the maximum value of the light saturation, b is a preset parameter, S is the light saturation, and k is a frequency spectrum characteristic value.

Further, the light display characteristic is a light brightness value, and the first light adjustment step specifically includes: obtaining a light brightness value according to a brightness value formula B ═ k × m/n, wherein B is the light brightness value, k is a frequency spectrum characteristic value, n is a frequency spectrum proportionality coefficient, and m is a maximum brightness value; and obtaining a spectrum scale coefficient n according to the n-f/m, and updating n in the brightness value formula, wherein f is the maximum spectrum characteristic value.

Further, the spectral feature is a spectral change rate, and the spectral change rate calculating step specifically includes the following substeps:

calculating a frequency amplitude difference value: calculating and summing the absolute value of the amplitude difference value of each frequency point in the frequency spectrum characteristic diagram at the current moment and the previous moment, and recording the result as s 1;

a comparison step: and comparing the amplitude of each frequency point in the spectrum characteristic diagram at the current moment and the amplitude of each frequency point in the spectrum characteristic diagram at the previous moment, summing the larger values of the amplitudes, recording the result as s2, and obtaining the spectrum change rate k as s1/s 2.

Further, when the spectral feature is a spectral complexity, the spectral complexity calculation formula specifically includes the following sub-steps:

and (3) calculating the ratio: calculating the proportion p of the maximum amplitude corresponding to the frequency points in the frequency spectrum characteristic diagram in the total amplitude;

and a complexity calculation step: the spectral complexity is obtained according to the formula k-1-p.

Further, the spectral feature is a music sound intensity, the light display feature is a light brightness value, and the first light adjustment step specifically includes the following substeps:

sound intensity obtaining step: obtaining the current music sound intensity, and obtaining a light brightness value according to a brightness value formula B ═ x × m/n, wherein B is the light brightness value, x is the current music sound intensity, n is a proportionality coefficient, and m is the maximum brightness value;

a judging step: judging whether the light brightness value is larger than the maximum brightness value, if so, correspondingly adjusting the light according to the light brightness value and executing the coefficient calculation step, and if not, correspondingly adjusting the light according to the light brightness value;

coefficient calculation step: and taking the current music sound intensity as the maximum music sound intensity, adjusting the light brightness value to be the maximum brightness value, obtaining a proportional coefficient n according to the condition that n is f/m, and updating n in a brightness value formula, wherein f is the maximum music sound intensity.

Further, when the number of the lamps is multiple, the frequency spectrum of each moment is segmented averagely according to the number of the lamps, the frequency spectrum change of each small section of each moment is calculated, and a corresponding control signal is obtained according to the frequency spectrum change so as to control the corresponding lamp to adjust the light.

The second purpose of the invention is realized by adopting the following technical scheme:

an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the program:

a data acquisition step: acquiring PCM waveform data of music and extracting corresponding data from the PCM waveform data to generate music data segments;

a spectrum generation step: performing fast Fourier transform on each music data segment to generate a spectral feature map;

a first light adjusting step: and obtaining the light display characteristics according to the frequency spectrum characteristics in the frequency spectrum characteristic diagram so as to correspondingly adjust the light.

The third purpose of the invention is realized by adopting the following technical scheme:

a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any of the above.

The fourth purpose of the invention is realized by adopting the following technical scheme:

a control device for light display comprises the following modules:

a data acquisition module: PCM waveform data for acquiring music and extracting corresponding data from the PCM waveform data to generate music data pieces;

a spectrum generation module: the system comprises a data processing module, a data processing module and a data processing module, wherein the data processing module is used for performing fast Fourier transform on each music data segment to generate a spectrum characteristic map;

first light adjustment module: and the lamp light display characteristic is obtained according to the spectrum characteristic in the spectrum characteristic diagram so as to correspondingly adjust the lamp light.

Compared with the prior art, the invention has the beneficial effects that:

the control method for the light display can show the music frequency spectrum characteristics more completely through the light change, so that the change information such as frequency loudness and the like which can be perceived by human ears is directly shown through the light, and the music visualization is realized.

Drawings

FIG. 1 is a flow chart of a control method of a light display according to the present invention;

FIG. 2 is a block diagram of a control device for a light display according to the present invention;

FIG. 3 is a graph of a spectrum of lower complexity;

fig. 4 is a graph of a spectrum with higher complexity.

Detailed Description

The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种用于居民小区夜间智能照明控制电路及其控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!