Sound playing adjustment method and portable device

文档序号:1908674 发布日期:2021-11-30 浏览:22次 中文

阅读说明:本技术 声音播放调整方法及可携式装置 (Sound playing adjustment method and portable device ) 是由 吴俊德 于 2020-05-26 设计创作,主要内容包括:一种用于可携式装置的声音播放调整方法,所述方法在所述可携式装置非处于声音播放状态时,播放侦测音频信号并接收所述侦测音频信号的反射音频信号,计算获取所述反射音频信号的音量权值列表。根据所述可携式装置的当前音量设定值,获取对应的参考音频信号的音量权值列表,根据所述参考音频信号的音量权值列表以及所述反射音频信号的音量权值列表计算不同频段对应的第一调整参数。当所述可携式装置播放音源文件前,根据所述不同频段对应的第一调整系数,调整所述音源文件的音频信号后再进行播放。本发明还公开一种可携式装置。本发明可以使得所述可携式装置自适应所属环境的频率响应特性并进行声音播放的调整。(A sound playing adjusting method for a portable device is characterized in that when the portable device is not in a sound playing state, a detection audio signal is played, a reflection audio signal of the detection audio signal is received, and a volume weight list of the reflection audio signal is obtained through calculation. And calculating first adjustment parameters corresponding to different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal. And before the portable device plays the sound source file, adjusting the audio signal of the sound source file according to the first adjustment coefficients corresponding to the different frequency bands and then playing the sound source file. The invention also discloses a portable device. The invention can make the portable device self-adapt to the frequency response characteristic of the environment and adjust the sound playing.)

1. A method for adjusting sound playing of a portable device, the method comprising:

detecting whether the portable device is in a sound playing state, if the portable device is not in the sound playing state, continuously executing the following steps:

playing the detected audio signal;

receiving a reflected audio signal of the detection audio signal;

acquiring a volume weight list of the corresponding reference audio signal according to the volume set value;

calculating to obtain a volume weight list of the reflected audio signal, and calculating first adjustment coefficients corresponding to different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal; and

and receiving a sound source file to be played, and adjusting the audio signal of the sound source file according to the first adjustment coefficient corresponding to the different frequency bands and then playing.

2. The method of claim 1, wherein the detecting audio signal comprises n sets of triangular waveform detecting audio signals with different frequencies, and a fundamental frequency of the triangular waveform detecting audio signal is preset between 20Hz and 770 Hz.

3. The method of claim 2, further comprising adjusting a sound pressure level of the triangular waveform detection audio signal according to an audibility threshold in an equal loudness curve such that the sound pressure level is below the audibility threshold.

4. The method of claim 2, further comprising calculating an intensity matrix of the reflected audio signal according to the sets of fundamental frequency amplitudes of the detected audio signal, and calculating a volume weight list of the reflected audio signal according to the triangular waveform detected audio signal and the intensity matrix.

5. A portable device, the device comprising:

a sound playing device;

a sound receiving device;

a processor; and

a memory for storing at least one computer program, wherein the computer program contains instructions for execution by the processor to cause the processor to perform the steps of:

detecting whether the portable device is in a sound playing state, if the portable device is not in the sound playing state, continuously executing the following steps:

playing the detected audio signal through the sound playing device;

receiving a reflected audio signal of the detection audio signal through the sound receiving device;

acquiring a volume weight list of the corresponding reference audio signal according to the volume set value;

calculating to obtain a volume weight list of the reflected audio signal, and calculating first adjustment coefficients corresponding to different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal; and

and receiving a sound source file to be played, and adjusting the audio signal of the sound source file according to the first adjustment coefficient corresponding to the different frequency bands and then playing the audio signal through the sound playing device.

6. The apparatus of claim 5, wherein the detection audio signal comprises n sets of triangular waveform detection audio signals with different frequencies, and a fundamental frequency of the triangular waveform detection audio signal is preset between 20Hz and 770 Hz.

7. The apparatus of claim 6, wherein the step of adjusting the sound pressure level of the triangular waveform detection audio signal according to an audibility threshold in an equal loudness curve such that the sound pressure level is below the audibility threshold.

8. The apparatus of claim 6, further comprising calculating an intensity matrix of the reflected audio signal according to the sets of fundamental frequency amplitudes of the detected audio signal, and calculating a volume weight list of the reflected audio signal according to the detected audio signal and the intensity matrix.

Technical Field

The present invention relates to the field of digital signal processing technologies, and in particular, to a method for adjusting sound playing and a portable device.

Background

When the portable device plays music, the portable device is placed on the surface of an object made of different materials, or is carried into different rooms, the sound volume can be found to be obviously changed, and meanwhile, the sound quality is also changed. Therefore, how to automatically adjust the played sound according to the surface and the space of the object placed on the portable device is a problem to be solved.

Disclosure of Invention

In view of the above, an object of the present invention is to provide a sound playing adjustment method and a portable device, which can automatically adjust the played sound according to the location and the space.

The invention provides a sound playing adjusting method for a portable device, which is characterized by comprising the following steps of detecting whether the portable device is in a sound playing state, and if the portable device is not in the sound playing state, continuing to execute the following steps of playing a detection audio signal; receiving a reflected audio signal of the detection audio signal; acquiring a volume weight list of the corresponding reference audio signal according to the volume set value; calculating to obtain a volume weight list of the reflected audio signal, and calculating first adjustment coefficients corresponding to different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal; and receiving a sound source file to be played, and adjusting the audio signal of the sound source file according to the first adjustment coefficient corresponding to the different frequency bands and then playing.

The invention also provides a portable device, which is characterized by comprising a sound playing device; a sound receiving device; a processor; and a memory for storing at least one computer program, wherein the computer program includes instructions for execution by the processor to cause the processor to perform the steps of detecting whether the portable device is in a sound playing state, and if the portable device is not in the sound playing state, continuing to perform the steps of playing a detected audio signal via the sound playing device; receiving a reflected audio signal of the detection audio signal through the sound receiving device; acquiring a volume weight list of the corresponding reference audio signal according to the volume set value; calculating to obtain a volume weight list of the reflected audio signal, and calculating first adjustment coefficients corresponding to different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal; and receiving a sound source file to be played, and adjusting the audio signal of the sound source file according to the first adjustment coefficient corresponding to the different frequency bands and then playing the audio signal through the sound playing device.

Compared with the prior art, the sound playing adjustment method and the portable device detect the frequency response of the environment in advance before the sound source file is not played, and obtain the adjustment coefficient so as to dynamically adjust the subsequent sound playing.

Drawings

Fig. 1 is a block diagram of a portable device according to an embodiment of the invention.

Fig. 2 is a flowchart of a sound playing adjustment method according to an embodiment of the invention.

Fig. 3 is a schematic diagram of an equal loudness curve of a sound playing adjustment method according to an embodiment of the present invention.

Fig. 4 is a schematic diagram illustrating a matrix operation of a sound playing adjustment method according to an embodiment of the present invention.

Fig. 5 is a flowchart of a sound playing adjustment method according to another embodiment of the invention.

Description of the main elements

Detailed Description

Referring to fig. 1, a block diagram of a portable device 100 according to an embodiment of the invention is shown. The portable device 100 may be a portable device capable of running an application, such as a mobile phone, a tablet, a set-top box, a multimedia player, and a sound box. The portable device 100 includes a processor 102, a memory 104, a sound playing device 106, and a sound receiving device 108. The processor 102 is electrically coupled to the memory 104, the audio playing device 106, and the audio receiving device 108. The processor 102 may be a microcontroller, a microprocessor, a complex instruction set computing microprocessor, a reduced instruction set computing microprocessor, an ultra-long instruction word microprocessor, an ultra-parallel instruction set computing microprocessor, a digital signal processor, or other circuitry with computing capabilities. The processor 102 is configured to execute or process instructions, data, and computer programs stored in the memory 104. The storage unit 104 includes a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical/tangible (e.g., non-transitory) computer-readable storage medium for storing one or more computer programs that control the operations of the portable device 100 and is executed by the processor 102. The sound player 106 may be any device suitable for playing sound signals, such as, but not limited to, a speaker. The sound receiving device 108 may be any device suitable for receiving sound signals, such as, but not limited to, a microphone.

In one embodiment, the portable device 100 further comprises at least one sensor (not shown in fig. 1), including but not limited to a motion sensor, a light sensor, and a proximity sensor.

Referring to fig. 2, a flow chart of a sound playing adjustment method according to an embodiment of the invention is shown, the method is applied in the portable device 100, and the processor 102 executes a computer program stored in the memory 104 to perform the following steps:

step S202, detecting whether the portable device 100 is in a sound playing state. If the portable device 100 is detected to be in the audio playing state, the process is ended and no audio playing adjustment is performed in order to not affect the listening experience of the user. If the portable device 100 is not in the audio playing state, step S204 is executed.

In step S204, the sound playing device 106 is controlled to play the detected audio signal. In one embodiment, the detection audio signal is a repetitive waveform with frequency variation, including a ramp sawtooth, a triangle, and a sine waveform. In one embodiment, the detection audio signal may be a triangular waveform detection audio signal that is not audible to human ears.

The frequency of sound that humans can perceive is in a range, and most people can hear it in a frequency range between 20Hz and 20000 Hz. However, the perception of the human ear's hearing for all frequencies is not linear, but follows an equal loudness curve. For example, fig. 3 shows an equal loudness curve perceived by the human ear, wherein the Y-axis represents the actual Sound Pressure intensity (Sound Pressure level) in decibels (dB-SPL) and the X-axis represents the different frequencies in hertz (Hz). The loudness (also called sound or volume) level is expressed in units of square (Phon), with 0 square representing the weakest loudness at which the human ear can hear sound, also called the threshold of audibility, below which the human ear cannot hear sound. The loudness curves in fig. 3 are measured every 20 square units and show the sound pressure intensity required for equal loudness due to sounds of different frequencies. The loudness is mainly determined by the sound pressure intensity, the sound pressure intensity is improved, and the loudness level is correspondingly increased. However, the loudness of sound is not determined solely by the sound pressure intensity, but also depends on the frequency. As shown in fig. 3, for 20hz sound, a sound pressure intensity of 70 db is required for the human ear to hear just right; and for a sound of 3000 hz, the human ear can hear the sound with a sound pressure intensity of-5 db.

In one embodiment, the equal loudness curve, including the mapping of loudness level, frequency, and sound intensity, is stored in the memory 104. In order to make the user of the portable device 100 unable to detect the triangle detection audio signal, the processor 102 may query the equal loudness curve, and adjust the sound pressure intensity of the triangle detection audio signal according to the equal loudness curve so that the sound pressure intensity is lower than the threshold of the equal loudness curve, so that the triangle detection audio signal played by the sound playing device 106 is inaudible to the human ear. According to the hearing characteristics of human ears, the resolution capability of the frequency span of the middle and low frequencies is larger than that of the high frequency section, and according to the actual measurement, the resonance frequency of the space and the object where the portable device such as a mobile phone is generally placed is found to be less than 10000 hz, so in this embodiment, the interval from 20hz to 10000 hz is cut into m groups of frequency bands, for example, 13 groups of frequency bands, by frequency logarithm according to the hearing characteristics of human ears. The fundamental frequency of the triangular detection audio signal is preset to be gradually increased from 20Hz to 770 Hz and divided into n groups, for example 16 groups, and the triangular wave is composed of 6 fundamental frequency string waves to 11 th harmonic waves, so that the triangular detection audio signal can detect the frequency domain characteristics of the reflected wave of 10000 Hz at most. Specifically, the processor 102 may control the sound playing apparatus 106 to sequentially play n sets of triangle detection audio signals with different frequencies from a low frequency to a high frequency.

In step S206, the reflected audio signal is received via the sound receiving device 108. It is understood that, a part of the n sets of detected audio signals played in step S204 reaches the sound receiving device 108 through air propagation, and another part of the detected audio signals reaches the sound receiving device 108 after forming reflection with objects in the environment of the portable device 100 through air propagation, and the signals received by the sound receiving device 108 are superimposed signals of direct sound and reflected sound, and are converted into the n sets of reflected audio signals through an analog-to-digital converter (not shown in fig. 1) of the sound receiving device 108.

Step S208, according to the volume setting value, a corresponding reference audio signal volume weight list is obtained. In an embodiment, before the portable device 100 leaves the factory, a corresponding reference audio signal volume weight list is pre-stored according to different volume setting values that can be set by a user through a user interface. Specifically, the portable device 100 may obtain the reference audio signals corresponding to different volume setting values in a laboratory-implemented free Space (F ee Space) before the factory shipment. In one embodiment, the reference audio signal is a reflected audio signal received by the sound receiving device 108 after the portable device 100 plays the detected audio signal in free space through the sound playing device 106. In one embodiment, the specific manner of obtaining the volume weight list of the reference audio signal is to detect 16 sets of triangular waves with different frequencies under a specific volume setting, and play the audio signals from low frequency to high frequency by the sound playing device 106, and receive the reference audio signal by the sound receiving device 108. The amplitude of the detected audio fundamental frequency of each group is 100%, 6 reference audio frequency spectrum intensities are obtained through calculation, 16x6 reference audio frequency intensity values are obtained in total, and a reference audio frequency intensity matrix with the dimension of 16x6 is formed. Then, dimension conversion is performed on the 16 × 6 detected audio frequency matrix (401 in fig. 4) and the reference audio intensity matrix (402 in fig. 4) corresponding to the m groups of frequency bands, in this embodiment, the original dimension of 16 × 6 is converted into a dimension of 13 × 7, that is, m is set to 13, and the insufficient matrix elements are partially complemented with a special value NaN or a minimum value. The transformed detected audio frequency matrix is 403 in fig. 4, and the transformed reference audio intensity matrix is 404 in fig. 4. The dimension-converted detection audio frequency matrix is sorted in a row-column scanning manner by sorting the matrix elements in ascending order according to the frequency values, as shown at 405 in fig. 4, and at the same time, the matrix elements in the reference audio intensity matrix are also sorted according to their corresponding detection audio frequencies, as shown at 406 in fig. 4. And after each row of matrix elements are squared and added by the reordered reference audio intensity matrix, taking root mean square to obtain 13 groups of effective values as a volume weight list of the reference audio signal.

Step S210, calculating and obtaining a volume weight list of the reflected audio signal, and calculating and obtaining first adjustment coefficients of different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal.

And calculating and acquiring a volume weight list of the reflected audio signal in the same way as the volume weight list of the reference audio signal. Specifically, the amplitude of the 16 detected audio fundamental frequencies is 100%, 6 reflected audio spectrum intensities are respectively calculated, and 16 × 6 reflected audio intensity values are obtained in total to form a reflected audio intensity matrix with dimension of 16 × 6. Then, dimension conversion is performed on the 16 × 6 detected audio frequency matrix and the reflected audio intensity matrix corresponding to the m groups of frequency bands, in this embodiment, the original dimension of 16 × 6 is converted into a dimension of 13 × 7, that is, m is set to 13, and the insufficient matrix elements are partially complemented by a special value NaN or a minimum value. And sequencing the matrix elements of the dimension-converted detection audio frequency matrix in an ascending order according to the frequency values in a row-column scanning mode, and meanwhile, reordering the matrix elements in the reflection audio intensity matrix according to the corresponding detection audio frequencies. And after each row of matrix elements are squared and added by the reordered reflected audio intensity matrix, taking root mean square to obtain 13 groups of effective values as a volume weight list of the reflected audio signals.

In this embodiment, the first adjustment coefficients of different frequency bands are calculated and obtained by calculating ratios of each element in the volume weight list of the reference audio signal to elements at corresponding positions in the volume weight list of the reflected audio signal, and obtaining 13 groups of ratios in total as the 13 groups of first adjustment coefficients of different frequency bands.

Step S212 is to receive the sound source file to be played, and adjust the audio signal of the sound source file according to the first adjustment coefficient corresponding to the different frequency bands, and then play the audio signal through the sound playing device 106.

In this embodiment, the sound source file is divided into a plurality of playing frames by 2048 points, fast fourier transform is performed on each playing frame, a signal is converted from an original domain into a frequency domain, each playing frame is multiplied by a first adjustment coefficient of a corresponding frequency band, then inverse fourier transform is performed to convert the obtained product into a time domain, and finally, the adjusted sound source file is played by the sound playing device 106.

In this embodiment, the steps S202 to S210 are used to obtain the frequency response characteristic of the environment where the portable device 100 is located. In another embodiment, to avoid the power consumption problem caused by the portable device 100 frequently executing these steps, a trigger condition may be added to the process to reduce the power consumption of the portable device 100. For example, the sensing data obtained by the sensor of the portable device 100 is used to determine whether the portable device 100 changes from the moving state to the stationary state, and determine whether the portable device 100 keeps the stationary state for the first time. If the portable device 100 has not changed for the first time period, it may be determined that the portable device 100 is in a stationary state, and at this time, the portable device 100 is triggered to execute the steps S202 to S210 to obtain the frequency response characteristic of the environment where the portable device 100 is located. The first time length may be default at the time of factory shipment, for example, the default value is one minute, or may be set by a user according to the default value. In another embodiment, the trigger condition may also be a specific instruction input by the user.

In an embodiment, when a control command for increasing the playing volume is received, the intensity values of different frequency bands may be directly adjusted without changing the current volume setting value of the portable device 100, so as to maximize the playing volume while allowing a certain degree of distortion. The specific process steps are shown in fig. 5.

Step S502, elements of the reflected audio intensity matrix which are larger than the average value are obtained. The reflected audio intensity matrix is obtained as described in step S210. And after calculating all elements in the reflected audio intensity matrix to obtain an average value, further obtaining all elements larger than the average value.

Step S504, standardize the elements larger than the average value to obtain a new reflected audio intensity matrix. That is, the intensity values of the elements of the reflected audio intensity matrix that were originally larger than the average value are further enhanced to form the new reflected audio intensity matrix.

In step S506, a volume weight list of the corresponding reference audio signal is obtained according to the current volume setting value.

Step S508, calculating a volume weight list of the reflected audio signal, and calculating and obtaining a second adjustment coefficient of different frequency bands according to the volume weight list of the reference audio signal and the volume weight list of the reflected audio signal, where a specific calculation manner of the second adjustment coefficient is the same as that in step S210.

Step S510, adjusting the audio signal of the audio source file to be played according to the second adjustment coefficient, and then playing the audio signal. The detailed implementation is the same as step S212.

To summarize, the sound playing adjustment method and the portable device of the present invention play the detected sound that is not easily perceived by human ears to confirm the frequency response characteristic of the environment when no sound is played. When the audio source file is to be played, the amplitude of each frequency band is finely adjusted to achieve the feeling of the same volume, so that the electric quantity of the portable device can be saved. When the user requests to increase the volume and allow a certain degree of distortion, the volume is maximized by reinforcing the frequency band with obvious frequency response characteristics.

It should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种在线拾音主电单元、方法及可穿戴设备

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!