Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a sound level control device suitable for use in a sound recording device. 2. Description of the Related Art Generally, in a sound recording apparatus, if a large input sound exceeding the recordable dynamic range of the apparatus is directly recorded, the quality of reproduced sound is remarkably deteriorated. Audio level control device that operates so as to quickly lower the gain of the audio amplifier circuit according to the input level when the input level of the audio is input, and then to return the gain to the original value when the input level decreases. Built-in. In such an audio level control device, when the recording target is a telephone conversation or a conversation between persons at a conference or the like, the return speed when the above-mentioned gain is returned to the original value is set to a large value. By doing so, the audio to be recorded can always be recorded at a fixed volume. However, if the recording target is, for example, a sound source in which a plosive sound such as applause and a low-level steady sound such as a babbling of a river are mixed, it is preferable to set the return speed to a large value as described above. There is a problem in that the sound of the babbling of the river becomes an unnatural sound whose level changes in response to the plosive sound.  On the other hand, if the above-mentioned return speed is set to a small value, such a problem does not occur, but, for example, the recording target is a babbling of a river, and a fireworks such as a fireworks during the recording. When a plosive sound occurs only once, the gain is immediately reduced to a level corresponding to the plosive sound, and the sound of the river babble cannot be recorded with sufficient volume. There is a problem that it takes time for the gain to return to the level before the occurrence. Conventionally, an analog audio level control apparatus employs control using a double time constant in order to solve the above-mentioned problem of the return speed. This is to speed up the tracking of the level control for an instantaneous loud volume, and to slow down the tracking for a loud sound with a constant energy or a continuous energy for a certain period of time or more. Is used in combination with two analog integrators having different time constants in a sound detection circuit for generating the signal. In the audio level control device using such a double time constant circuit, only two integration time constants can be selected. Following is impossible. In addition, since the time constant of integration is set to be several tens of seconds, it is necessary to increase the calculation accuracy if this is to be constituted by a digital circuit.
There is a disadvantage that processing becomes complicated. A sound level control device according to the present invention derives absolute value data relating to a digital audio signal, and derives average value data for a predetermined number of samples of the absolute value data. Means for deriving envelope detection data for the average value data, means for setting the value of the predetermined number of samples, means for deriving envelope detection data for the absolute value data, Means for setting the gain of the audio signal amplifying means based on the larger one of the envelope detection data for the value data and the envelope detection data for the average value data. It is characterized by. In this case, the means for setting the value of the predetermined number of samples is such that the higher the level of the envelope detection data is, the higher the value of the predetermined number of samples is based on the envelope detection data of the average value data. It is preferable to configure this. When controlling the audio levels of a plurality of channels, use the largest absolute value among the absolute values of the digital audio signals of the plurality of channels as the absolute value data. It is desirable to do. The gain control is performed according to the level of the sound source, and the return time until the gain reduced by the large input sound returns to the original gain is adaptively adjusted according to the level of the sound source. Controlled. FIG. 1 is a block diagram showing an audio level control apparatus according to the present invention.
Embodiments will be described with reference to the drawings. FIG. 1 is a diagram showing an audio signal processing stage provided with such an audio level control device. This audio signal processing stage samples each analog input audio signal of channel 1 and channel 2 at 48 KHz and outputs 20.8 μs. A / D conversion circuits 31 and 32 for outputting digital audio signals having a period of .times., And coefficient units 33 and 34 functioning as variable amplifiers for digital audio signals A1 and A2 output from these circuits.
And a detector block surrounded by a dotted line for generating a coefficient k to be supplied to each coefficient unit based on each output of the coefficient units 33 and 34. The operation of generating the coefficient k in the detector block will be described. First, the outputs A3 and A4 of the coefficient units 33 and 34 are input to absolute value processing units 35 and 36, and the absolute values A7 and A6 are obtained. Taken out. These absolute values are input to the comparison gate unit 38,
Here, only the larger absolute value (A8) of the absolute values A7 and A6 is output. The absolute value signal A8 output from the comparison gate unit 38 is input to the averaging processing unit 39 and the envelope detection unit 40. The processing in the envelope detector 40 will be described with reference to FIG. 2. (1) in FIG.
An input A8 to the envelope detector 40 is shown, and (2) represents an output A12 of the envelope detector. Here, the following characteristic of the output A12 with respect to the input A8 is set to about 20 ms for the rising characteristic and about 20 ms to 100 ms for the falling characteristic with respect to the input change of 40 dB corresponding to the dynamic range of the audio signal. A8 is
As shown in this figure, a signal is obtained that almost exactly follows the input A8 with a small time constant. The input A8 is input to an averaging section 39, where the averaging section 39 performs an averaging process in accordance with the number N of samples set by the averaging sample number setting section 37. Note that the sample number N is set based on the output A11 obtained by performing envelope detection on the output A9 of the averaging unit 39 in the envelope detection unit 41. Next, these processing units 3
The processes in 9, 41 and 37 will be described with reference to FIG. In response to the input A8 shown in FIG. 1A, an averaging processing unit 39 outputs an averaged output A9 in accordance with the following arithmetic expression based on the number of samples N given from the averaging sample number setting unit. Derive. A9 = (a1 + a2 + a3 +... + AN) / N Here, a1, a2, a3,..., AN represent N pieces of audio data that are continuously input to the input A8. The value of N is designed to be a value of about 320 when a normal-level sound is input, and as a result, an averaged output A9 shown in (2) of FIG. As a result, data having a period of about 6.6 ms (= 320 × 20.8 μs) is obtained. Next, the averaged output A9 is input to the envelope detector 41 and converted into data having the original period of 20.8 μs, and predetermined rising characteristics and falling characteristics are further provided. The rising characteristic given here is set so as to follow an input change of 40 dB up to about 20 ms similarly to the rising characteristic in the envelope detector 40, and the falling characteristic is several seconds to several tens of minutes. Set the time constant to a very large one, such as seconds. By performing the above processing, an output A11 as shown in (3) of this figure is obtained as the output of the envelope detector 41 (note that the signal diagrams shown in these (1) to (3)). Is a simplified one, and the number of samples and the level of each sample data are not accurately represented). The number of samples to be provided to the averaging section 39 is set in the averaged sample number setting section 37 based on the level of the output A11 obtained in this manner. In this case, the level of A11 is large. Set a larger value for the number of samples. The specific characteristics of setting N for the level of A11 may be determined according to the required control characteristics of the audio level control. For example, this is shown in (4) of FIG. like,,
, Etc. can be employed. The envelope detection output A11 generated as described above is input to the comparison gate unit 43. In this comparison gate section, the signal is compared with the above-mentioned envelope detection output A12, and a signal having a higher level of the two inputs A11 and A12 is extracted as an output A13. This output A13
Is input to the coefficient generation unit 42, and a coefficient k having a smaller value is generated as the level of A13 increases. Then, feedback control is executed by supplying the coefficient k to the coefficient units 33 and 34, and digital audio signals A3 and A4 amplified to desired levels are obtained. In this case, it is desirable to design such that the amplification characteristic between the input and output of each coefficient unit is approximately as shown in FIG. Note that in this characteristic diagram, the output level of an input whose level is equal to or higher than P is suppressed to L, and this output level L is set to a value close to the maximum dynamic range of the S / N. Desirable in terms of surface. In the case of an audio recording device in which the standard output level is set, it is desirable to set the value slightly beyond the standard output level. Although the above-described embodiment is for recording audio of two channels, the present invention can be applied to an apparatus for recording audio of any other number of channels. For example, in the case of a device that records only one channel of audio, the comparison gate unit 38 in FIG. 1 is not necessary. And the absolute value output is input to the comparison gate unit 38. Next, the control characteristics of the audio level control device shown in FIG. 1 will be described by taking a specific case as an example. (1) to (4) shown in FIG. 5 are signals A8, A12, A11, and A1 when a high-level plosive sound is generated only once while a low-level stationary sound is being recorded.
3 shows the respective envelope waveforms. As shown in this figure, the output A12 obtained by performing envelope detection on A8 in the processing unit 40 in FIG. 1 has almost the same envelope waveform as A8, whereas A8 is processed by the processing unit 39 in FIG. The output A11 extracted by averaging and envelope detection in steps 41 and 41 has a waveform that rises somewhat during the period of the plosive sound and then gradually falls. As a result, an output A13 obtained by inputting A11 and A12 to the comparison gate 43 has an envelope waveform as shown in FIG. Accordingly, the value of the coefficient k generated based on the A13 is rapidly reduced during the period of the plosive sound generation to suppress the plosive sound, and returns to almost the original value after the elapse of the period. You will be able to record enough steady sounds again. FIG. 6 shows signals A8, A12, A11, and A8 when a high-level plosive sound repeatedly occurs for a predetermined period while a low-level stationary sound is being recorded.
And A13 respectively represent the envelope waveforms. In the case of this figure, the output A11 has a waveform that gradually rises every time a plosive sound occurs because the fall characteristic is gentle, and that the output A11 gradually falls after the elapse of the period in which the plosive sound is repeatedly generated. It will be. As a result, the output A13 obtained by inputting A11 and A12 to the comparison gate 43 has an envelope waveform as shown in FIG. That is, when a plosive sound is repeatedly generated in this manner, the level of A13 in the period from the end of one plosive sound to the occurrence of the next plosive sound gradually increases. The recording level of the low-level stationary sound is gradually kept at a low level, and the recording level of the stationary sound does not fluctuate as in the related art. Further, since the number of samples for averaging when generating A11 based on A8 is set to increase as the level of A11 increases, the falling characteristic of the waveform of A11 is determined by the level of A11. The higher the value, the slower it becomes. In other words, the smaller the number of repetitions of the plosive sound, the faster the fall of the waveform of A13 after the elapse of the repetition period of the plosive sound, and the lower the level of the steady sound is recorded. The detector block in the above-described audio level control device can be constituted by hardware for all the internal processing units, but can also be constituted by microcomputer control. Therefore, an example of a configuration in which the function of the detector block is realized by a microcomputer will be described below with reference to FIGS. FIG. 7 shows the structure of a detector block when a microcomputer is used. The signals A3 and A4 are input to the microcomputer 55 via the interface 53, and the coefficient k derived in the microcomputer based on these inputs. Is output via the interface 53. A register Ra for storing the output A8, a register Rh for storing the output A12, and a register R for storing the output A9 are stored in the RAM 56 in the microcomputer.
m, a register Ro for storing the output A11, a register Rn for storing the number of averaged samples N, and a register Rc for storing the number of times of inputting audio data to the microcomputer 55. "A11 → N" for extracting the averaged sample number N corresponding to the level of the output A11 in addition to the ordinary microcomputer program
A conversion table Tn and an “A13 → k” conversion table Tk for setting a coefficient k based on the level of the output A13 are provided. Next, a flow of generating the coefficient k in the microcomputer 55 will be described with reference to FIG. In this figure, by executing steps S1 and S2, default values are respectively stored in the registers Rn, Ro, and Rh, and the contents of the registers Rc and Rm are cleared.
Next, in step S3, the process stands by until the audio data A3 and A4 are input. When the audio data is input, the absolute value data A8 having the larger value among the absolute value data of the input audio data A3 and A4 is stored in the register Ra. (Step S4). In the next step S5, a value obtained by dividing the data A8 in the register Ra by the number of averaged samples stored in the register Rn is added to the data stored in the register Rm, and the added output is stored in the register Rm. At the same time, the content of the register Rc is increased by "1". Next, in step S6T, envelope detection data A12 relating to the data A8 in the register Ra is derived, and this is stored in the register Rh.
After that, in step S7, it is determined whether or not the value of the input count data in the register Rc is equal to the number of averaged samples in the register Rn. If the result of this determination is NO, the register R
h and the data in the register Ro (A1
1), the coefficient k corresponding to the larger data value is read from the table Tk, output to the coefficient units 33 and 34 (steps S8 to S10), and then the process returns to step S3. When the result of the determination in step S7 becomes YES by repeatedly executing the loop consisting of steps S3 to S10, it means that the averaged data A9 for the number of averaged samples to be obtained has been stored in the register Rm. Then, the envelope detection data A11 relating to the data A9 is derived, and the data in the register Ro is updated to the newly derived data A11 (steps S7 and S11). Next, the number of averaged samples to be set corresponding to the data A11 is read from the table Tn and stored in the register Rn to prepare for the next averaging operation (step S12). Data A12 in Rh is compared with data (A11) in register Ro, and coefficient k corresponding to the larger data value is read from table Tk and output to coefficient units 33 and 34 (steps S13 to S15). After that, step S2
Return to The specific flow of step S4 in this figure is configured as shown in FIG. The specific flow of step S6 is configured as shown in FIG. 10, the absolute value data A8 (contents of the register Ra) extracted from the input audio data is equal to the envelope detection data (register Rh) of one sample before.
When the value has the same value as that of the register Rh, the value of the envelope detection data (A12) in the register Rh is not updated, but when the value is not equal, the value of the data A12 in the register Rh is updated. That is, when the value of the data A8 in the register Ra is larger than the value of the data in the register Rh,
8 is stored in the register Rh (step S2).
2) If the magnitude relation is reversed, a value obtained by subtracting the value β from the data in the register Rh is stored in the register Rh (step S23). Here, the value of α determines the rising characteristic of the envelope detection data, and the value of β determines the falling characteristic. These values are set so that the rising and falling characteristics described with reference to FIG. 2 can be obtained. Is set to The specific flow of the envelope detection in step S11 is executed as shown in FIG. 11, as in step S6. The value of γ in step S27 and the value of δ in step S28 in FIG.
Similarly to the case of 0, the rise characteristic and the fall characteristic of the envelope detection are determined, and these values are set so as to obtain the rise characteristic and the fall characteristic described in FIG. The arithmetic expressions for determining the envelope detection data values at the time of rising and falling used in the flow of the envelope detection of FIGS. 10 and 11 are step S22 and step S23, step S27 and step S28. , For example, in step S2
2 and step S23, FIG.
Although various types such as (iii) can be considered, the present embodiment employs the arithmetic expressions shown in FIGS. 10 and 11 which have the highest auditory quality in the experiment. As described above, in the present invention, by adaptively controlling the followability in accordance with the level of a sound source, a natural gain control is performed in terms of audibility when recording a sound source having a wide dynamic range. When this is performed by microcomputer control, it can be realized by a simple algorithm. In addition, as an audio recording device to which the present invention can be applied,
A variety of devices may be used regardless of whether analog recording or digital recording is used, but it goes without saying that the present invention can also be applied to a device such as a VTR or a video disc which records sound together with images. When recording a sound source with a wide dynamic range, gain control that is natural in terms of audibility is performed. When configured using microcomputer control, it can be realized with a simple algorithm.
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a diagram showing a configuration of one embodiment of the present invention. FIG. 2 is a diagram illustrating a process of an envelope detector 40 according to the embodiment. FIG. 3 is a diagram illustrating processing of an averaging processing unit 39, an envelope detection unit 41, and an averaging sample number setting unit 37 in the embodiment. FIG. 4 is a diagram for explaining amplification characteristics in the embodiment. FIG. 5 is a diagram illustrating control characteristics when a plosive sound occurs only once in the embodiment. FIG. 6 is a diagram illustrating control characteristics when a plosive sound is continuously generated a plurality of times in the embodiment. FIG. 7 is an explanatory diagram in the case where the control unit of the embodiment is configured by a microcomputer. FIG. 8 is a diagram showing an operation flow of the microcomputer. FIG. 9 is a flowchart for realizing the processing of the absolute value processing units 35 and 36 and the comparison gate unit 38 of FIG. 1 by the microcomputer. FIG. 10 is a flowchart for realizing the processing of the envelope detection unit 40 by the microcomputer. FIG. 11 is a flowchart for realizing the processing of the envelope detection unit 41 by the microcomputer. FIG. 12 is an example of another arithmetic expression that can be employed when the envelope detection processing is executed by the microcomputer. [Description of Signs] 33, 34: Coefficient unit, 35, 36: Absolute value processing unit, 38, 43: Comparison gate unit, 37: Averaged sample number setting unit, 39: Averaging processing unit, 40, 4
1: Envelope detector, 42: coefficient generator,