CN110661502A - Volume adjusting method based on embedded system - Google Patents

Volume adjusting method based on embedded system Download PDF

Info

Publication number
CN110661502A
CN110661502A CN201910995976.XA CN201910995976A CN110661502A CN 110661502 A CN110661502 A CN 110661502A CN 201910995976 A CN201910995976 A CN 201910995976A CN 110661502 A CN110661502 A CN 110661502A
Authority
CN
China
Prior art keywords
digital signal
embedded system
range
codec
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910995976.XA
Other languages
Chinese (zh)
Inventor
朱茜
谭锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHANGHAI RUIWEI ELECTRONIC TECHNOLOGY Co Ltd
Original Assignee
SHANGHAI RUIWEI ELECTRONIC TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHANGHAI RUIWEI ELECTRONIC TECHNOLOGY Co Ltd filed Critical SHANGHAI RUIWEI ELECTRONIC TECHNOLOGY Co Ltd
Priority to CN201910995976.XA priority Critical patent/CN110661502A/en
Publication of CN110661502A publication Critical patent/CN110661502A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03GCONTROL OF AMPLIFICATION
    • H03G3/00Gain control in amplifiers or frequency changers
    • H03G3/20Automatic control

Landscapes

  • Circuit For Audible Band Transducer (AREA)

Abstract

The invention discloses a volume adjusting method based on an embedded system, which comprises the following steps: decoding an audio file, and acquiring a digital signal of the audio file as an initial digital signal; obtaining a scaling coefficient of volume adjustment; zooming the initial digital signal according to the zooming coefficient to obtain a second digital signal; correcting the second digital signal to obtain a third digital signal; inputting the third digital signal into a codec. The invention can realize the volume adjusting function only through the coder-decoder, thereby not only ensuring the user experience, but also reducing the cost and having obvious economic benefit.

Description

Volume adjusting method based on embedded system
Technical Field
The invention relates to the field of audio module digital signal processing, in particular to a volume adjusting method based on an embedded system.
Background
With the development of the internet of things becoming faster and faster, various internet of things devices emerge endlessly. The market has very many voice broadcast products, and competition is very violent, and how to promote the performance, can also reduce cost, then becomes the key of preempting the market.
In the voice broadcast product in the prior art, to implement audio Signal Processing, a CODEC (Coder-Decoder) is generally adopted to convert an Analog Signal (Analog) that can be heard by human ears into a Digital Signal (Digital) that can be processed by a computer, and convert the processed Digital Signal into an Analog Signal that can be heard by human ears, thereby implementing audio Signal Processing.
Disclosure of Invention
According to the embodiment of the invention, the volume adjusting method based on the embedded system comprises the following steps:
decoding an audio file, and acquiring a digital signal of the audio file as an initial digital signal;
obtaining a scaling coefficient of volume adjustment;
zooming the initial digital signal according to the zooming coefficient to obtain a second digital signal;
correcting the second digital signal to obtain a third digital signal;
inputting the third digital signal into a codec.
Further, the preset value range of the digital signal received by the codec is-32768 ~ 32767.
Further, the scaling factors include, but are not limited to: 0.2, 0.4, 0.8, 1.0, 1.4, 1.8, 2.0.
Further, the modifying the second digital signal to obtain a third digital signal further includes the following sub-steps:
judging whether the maximum value or the minimum value of the second digital signal overflows a preset numerical range of the digital signal received by the coder-decoder;
if the second digital signal does not overflow the preset numerical range of the digital signal received by the coder-decoder, the second digital signal is a third digital signal;
and if the maximum value or the minimum value of the second digital signal overflows the preset numerical range of the digital signal received by the coder-decoder, setting the maximum value or the minimum value of the second digital signal as the maximum value or the minimum value of the preset numerical range of the digital signal received by the coder-decoder, and acquiring a third digital signal.
Further, the value range of the second digital signal is the same as the preset value range of the digital signal received by the codec.
Further, the value range of the second digital signal is-32768 ~ 32767.
Further, the value range of the initial digital signal is 1/2 of the preset value range of the digital signal received by the codec.
Further, the initial digital signal has a value in the range of-16384 ~ 16383.
According to the volume adjusting method based on the embedded system, the volume adjusting function can be realized only through the coder-decoder, so that the user experience is guaranteed, the cost is reduced, and the economic benefit is remarkable.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and are intended to provide further explanation of the claimed technology.
Drawings
FIG. 1 is a flow chart of a volume adjustment method based on an embedded system according to an embodiment of the present invention;
fig. 2 is a flow chart illustrating sub-steps of processing the second digital signal to obtain a third digital signal according to fig. 1.
Detailed Description
The present invention will be further explained by describing preferred embodiments of the present invention in detail with reference to the accompanying drawings.
First, a volume adjustment method based on an embedded system according to an embodiment of the present invention will be described with reference to fig. 1 ~ 2, and a voice broadcast product for an embedded system has a wide application range.
As shown in fig. 1, the volume adjusting method based on the embedded system according to the embodiment of the present invention includes the following steps:
specifically, as shown in fig. 1, in S1, the audio file is read and decoded to obtain the digital signal of the audio file, and the decoded digital signal is taken as the initial digital signal. Therefore, the decoding of the Digital signals of the audio files is directly finished by configuring the audio decoder on a software layer without depending on a hardware Digital Signal Processing (DSP) chip, so that the cost is greatly reduced, and the competitiveness of the product is enhanced.
Further, in this embodiment, the maximum value range of the digital signal is-32768 ~ 32767, that is, the preset value range of the digital signal received by the codec is-32768 ~ 32767, and the value range can be adjusted according to the performance of the embedded system.
Specifically, as shown in fig. 1, in S2, a scaling factor of the volume adjustment is acquired; in this embodiment, 7 volume levels are adopted, that is, scaling coefficients are 0.2, 0.4, 0.8, 1.0, 1.4, 1.8, and 2.0, and 7 types in total, so that the volume level can be flexibly set according to requirements in actual use, and the volume level is large in adjustment range and flexible in adjustment.
Further, since the maximum volume level is twice as large, when the numerical range of the digital signal of the selected audio file is within 1/2 of the maximum numerical range of the digital signal, then the amplification by 2 times does not exceed the representation range, the audio is not distorted, and when the amplification by 2 times is reduced, only the data not divisible by 2 has a deviation which is small relative to the data itself, that is, in the present embodiment, the numerical range of the digital signal of the preferred audio file, i.e., the initial digital signal, is selected to be-16384 ~ 16383, and the selection of such an audio file can satisfy both the sufficient condition of small distortion and the necessary condition for the implementation of the algorithm.
Further, for the embedded system using external audio, since the maximum and minimum values of audio data are basically concentrated in 1/2 of the maximum numerical range of the digital signal, the distortion can be ensured to be small by performing the volume adjustment with small amplitude.
Specifically, as shown in fig. 1, in S3, the initial digital signal is scaled according to the scaling factor to obtain the second digital signal, and the audio source digital signal is directly obtained and scaled up and down to simulate a DSP for signal processing, so that the amplitude of the audio signal is directly changed without hardware, thereby implementing dynamic control of the volume.
Specifically, as shown in fig. 1 and 2, in S4, the second digital signal is modified to obtain a third digital signal.
Specifically, as shown in fig. 2, in S41, it is determined whether the maximum or minimum value of the second digital signal exceeds a preset value range of the digital signal received by the codec, i.e., the maximum value range of the digital signal.
Specifically, as shown in fig. 2, in S42, if the second digital signal does not overflow the preset value range of the digital signal received by the codec, the second digital signal input to the codec is the third digital signal, the value range of the second digital signal that does not overflow is the same as the maximum value range of the digital signal, i.e., in this embodiment, the value range of the second digital signal is-32768 ~ 32767.
Specifically, as shown in fig. 2, in S43, if the maximum or minimum value of the second digital signal exceeds the preset value range of the digital signal received by the codec, the maximum or minimum value of the second digital signal is set as the maximum or minimum value of the preset value range of the digital signal received by the codec, and a third digital signal is obtained.
Specifically, as shown in fig. 1, in S5, the third digital signal is input to the codec, converted by the codec, and played through the power amplifier and the speaker, which does not need to pass through DSP hardware any more, thereby saving cost, achieving volume adjustment, and improving user experience.
In the above, with reference to fig. 1 ~ 2, the volume adjustment method based on the embedded system according to the embodiment of the present invention is described, and the volume adjustment function can be realized only by the codec, so that the user experience is ensured, the cost is reduced, and the economic benefit is significant.
It should be noted that, in the present specification, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an embedded system-based volume adjustment method" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.

Claims (8)

1. A volume adjusting method based on an embedded system is characterized by comprising the following steps:
decoding an audio file, and acquiring a digital signal of the audio file as an initial digital signal;
obtaining a scaling coefficient of volume adjustment;
zooming the initial digital signal according to the zooming coefficient to obtain a second digital signal;
correcting the second digital signal to obtain a third digital signal;
inputting the third digital signal into a codec.
2. The embedded system-based volume adjusting method of claim 1, wherein the codec receives the digital signal with a preset value range of-32768 ~ 32767.
3. The embedded system based volume adjusting method of claim 1, wherein the scaling factor includes but is not limited to: 0.2, 0.4, 0.8, 1.0, 1.4, 1.8, 2.0.
4. The method for adjusting the volume based on the embedded system according to claim 1 or 2, wherein the modifying the second digital signal to obtain the third digital signal further comprises the sub-steps of:
judging whether the maximum value or the minimum value of the second digital signal overflows a preset numerical range of the digital signal received by the coder-decoder;
if the second digital signal does not overflow the preset numerical range of the digital signal received by the coder-decoder, the second digital signal is a third digital signal;
and if the maximum value or the minimum value of the second digital signal overflows the preset numerical range of the digital signal received by the coder-decoder, setting the maximum value or the minimum value of the second digital signal as the maximum value or the minimum value of the preset numerical range of the digital signal received by the coder-decoder, and acquiring a third digital signal.
5. The embedded system-based volume adjustment method of claim 4, wherein the range of values of the second digital signal is the same as the preset range of values of the digital signal received by the codec.
6. The embedded system-based volume adjustment method of claim 5, wherein the second digital signal has a value ranging from-32768 ~ 32767.
7. The embedded system-based volume adjustment method of claim 1, 2 or 3, wherein the initial digital signal has a value range of 1/2 of the preset value range of the digital signal received by the codec.
8. The embedded system-based volume adjustment method of claim 7, wherein the initial digital signal has a value ranging from-16384 ~ 16383.
CN201910995976.XA 2019-10-18 2019-10-18 Volume adjusting method based on embedded system Pending CN110661502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910995976.XA CN110661502A (en) 2019-10-18 2019-10-18 Volume adjusting method based on embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910995976.XA CN110661502A (en) 2019-10-18 2019-10-18 Volume adjusting method based on embedded system

Publications (1)

Publication Number Publication Date
CN110661502A true CN110661502A (en) 2020-01-07

Family

ID=69041298

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910995976.XA Pending CN110661502A (en) 2019-10-18 2019-10-18 Volume adjusting method based on embedded system

Country Status (1)

Country Link
CN (1) CN110661502A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111580135A (en) * 2020-05-27 2020-08-25 上海锐伟电子科技有限公司 Method and structure for reducing GPS drift

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929298A (en) * 2005-09-07 2007-03-14 鸿富锦精密工业(深圳)有限公司 Audio frequency processing system and method
CN101267222A (en) * 2007-03-13 2008-09-17 智多微电子(上海)有限公司 Device for controlling multi-channel sound signal volume adjustment in mobile device sound mixing device
CN102005206A (en) * 2010-11-16 2011-04-06 上海华平信息技术股份有限公司 Audio mixing method of multiple-channel audio frequency
CN102568512A (en) * 2011-12-15 2012-07-11 无锡中星微电子有限公司 Method and device of volume control
CN105227998A (en) * 2014-06-30 2016-01-06 惠州市伟乐科技股份有限公司 The method and apparatus of balance Multi-audio-frequency volume
CN107526570A (en) * 2017-08-18 2017-12-29 广东欧珀移动通信有限公司 volume adjusting method, device, terminal device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929298A (en) * 2005-09-07 2007-03-14 鸿富锦精密工业(深圳)有限公司 Audio frequency processing system and method
CN101267222A (en) * 2007-03-13 2008-09-17 智多微电子(上海)有限公司 Device for controlling multi-channel sound signal volume adjustment in mobile device sound mixing device
CN102005206A (en) * 2010-11-16 2011-04-06 上海华平信息技术股份有限公司 Audio mixing method of multiple-channel audio frequency
CN102568512A (en) * 2011-12-15 2012-07-11 无锡中星微电子有限公司 Method and device of volume control
CN105227998A (en) * 2014-06-30 2016-01-06 惠州市伟乐科技股份有限公司 The method and apparatus of balance Multi-audio-frequency volume
CN107526570A (en) * 2017-08-18 2017-12-29 广东欧珀移动通信有限公司 volume adjusting method, device, terminal device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王升杨等: "全半带滤波器数字D类音频PWM调制芯片设计", 《电声技术》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111580135A (en) * 2020-05-27 2020-08-25 上海锐伟电子科技有限公司 Method and structure for reducing GPS drift

Similar Documents

Publication Publication Date Title
JP6753499B2 (en) Decoding device and method, and program
EP3329592B1 (en) Encoded audio metadata-based loudness equalization and dynamic equalization during drc
CN104410379B (en) A kind of volume adjusting method
CN105245195B (en) For the technology of distortion reduction multiband compressor reducer protected with sound quality
US8355908B2 (en) Audio signal processing device for noise reduction and audio enhancement, and method for the same
CN104363510B (en) A kind of playback terminal
JP2015050685A (en) Audio signal processor and method and program
CN104486668B (en) A kind of volume adjusting method
US20180083587A1 (en) Method and apparatus for controlling audio playback based upon the instrument
US9119007B2 (en) Method of and hearing aid for enhancing the accuracy of sounds heard by a hearing-impaired listener
WO2019033943A1 (en) Volume adjusting method and device, mobile terminal and storage medium
CN111966322A (en) Audio signal processing method, device, equipment and storage medium
WO2019033942A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
CN108540886A (en) A kind of method for protecting hearing ability, system, storage device and bluetooth headset
WO2019033940A1 (en) Volume adjustment method and apparatus, terminal device, and storage medium
CN110661502A (en) Volume adjusting method based on embedded system
CN112992159B (en) LC3 audio encoding and decoding method, device, equipment and storage medium
JP2010212887A (en) Signal characteristic adjustment device
CN110611862A (en) Microphone gain adjusting method, device, system and storage medium
CN103456334A (en) Method and device for playing audio file
JPWO2017094429A1 (en) Signal processing apparatus and signal processing method
US10264366B2 (en) Hearing aid and method for dynamically adjusting recovery time in wide dynamic range compression
CN102403970A (en) Method and device for adjusting volume of digital graphic equalizer
TWI591624B (en) Method for reducing noise and computer program thereof and electronic device
JP5611029B2 (en) Acoustic device and output sound control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200107

RJ01 Rejection of invention patent application after publication