Digital audio processing device, digital audio processing method, and digital audio processing program
The digital audio processing device and method address the issue of suboptimal sound quality in waveforms with consecutive identical samples by employing a maximum/minimum sample detection and correction mechanism, ensuring improved harmonic signal generation and sound quality.
Patent Information
- Application Number
- PCT/JP2025/027776
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-09-02
- Filing Date
- 2025-08-05
- Publication Date
- 2026-03-05
AI Technical Summary
Existing digital audio processing methods fail to generate ideal harmonic signals when digital audio signals contain waveforms with multiple consecutive samples having the same value as a maximum or minimum sample, leading to suboptimal sound quality.
A digital audio processing device and method that includes a maximum/minimum sample detection unit, correction unit, sample number detection unit, difference value calculation unit, and addition/subtraction unit to assign tags to samples differently when consecutive samples have the same value, calculate correction values based on sample intervals, and apply these values to improve sound quality.
The solution enables the generation of ideal harmonic signals even in waveforms with consecutive identical samples, enhancing sound quality by accurately detecting and correcting sample intervals.
Smart Images

Figure JP2025027776_05032026_PF_FP_ABST
Abstract
Description
Digital audio processing device, digital audio processing method, and digital audio processing program
[0001] The present disclosure relates to a digital audio processing device, a digital audio processing method, and a digital audio processing program.
[0002] Patent Document 1 describes a digital audio processing device and a digital audio processing method that can improve the audible sound quality when a digital audio signal is reproduced.
[0003] Patent No. 3401171
[0004] The digital audio processing device and digital audio processing method described in Patent Document 1 add a correction value to a sample adjacent to a maximum sample having a maximum value in the waveform of a digital audio signal, and subtract the correction value from a sample adjacent to a minimum sample having a minimum value. In this case, the digital audio processing device and digital audio processing method determine the correction value according to the number of samples between the adjacent maximum and minimum samples. The digital audio processing device and digital audio processing method described in Patent Document 1 do not assume a waveform in which multiple consecutive samples have the same value as the maximum or minimum sample.
[0005] When an analog audio signal is sampled and converted into a digital audio signal, or when a digital audio signal is compressed, a waveform may be generated in which multiple consecutive samples with the same value as a maximum or minimum sample are generated.
[0006] A waveform in which multiple consecutive samples have the same value as a maximum or minimum sample may not be the sample determined to be the maximum or minimum sample, but another sample among the multiple consecutive samples with the same value may be the sample that has the true maximum or minimum value.The digital audio processing device and digital audio processing method described in Patent Document 1 may erroneously detect the number of samples between adjacent maximum and minimum samples when a digital audio signal includes a waveform in which multiple consecutive samples have the same value as a maximum or minimum sample, and may therefore be unable to generate an ideal harmonic signal for improving sound quality.
[0007] One or more embodiments aim to provide a digital audio processing device, a digital audio processing method, and a digital audio processing program that can generate ideal harmonic signals to improve sound quality, even if the digital audio signal contains a waveform with multiple consecutive samples of the same value as a maximum or minimum sample.
[0008] A first aspect of one or more embodiments includes a maximum / minimum sample detection unit that detects maximum samples and minimum samples in a series of samples that constitute an input digital audio signal, and when there are two or more consecutive first consecutive samples that have the same value as the maximum sample detected by the maximum / minimum sample detection unit, including the maximum sample, a maximum sample tag is assigned from the first consecutive samples to a sample different from the maximum sample, when there are not two or more consecutive samples that have the same value as the maximum sample detected by the maximum / minimum sample detection unit, including the maximum sample, a maximum sample tag is assigned to the maximum sample, and when there are two or more consecutive second consecutive samples that have the same value as the minimum sample detected by the maximum / minimum sample detection unit, including the minimum sample, a minimum sample tag is assigned from the second consecutive samples to a sample different from the minimum sample, and a previous sample detected by the maximum / minimum sample detection unit. The present invention provides a digital audio processing device comprising: a maximum / minimum sample correction unit that assigns a minimum sample tag to a minimum sample when there are no two or more consecutive samples with the same value as the minimum sample, including the minimum sample; a sample number detection unit that detects the number of samples between adjacent samples to which the maximum sample tag is assigned and the minimum sample tag is assigned; a difference value calculation unit that calculates a difference value between adjacent samples in the series of samples; a correction value calculation unit that calculates a correction value by multiplying the difference value calculated by the difference value calculation unit by a predetermined coefficient corresponding to the number of samples detected by the sample number detection unit; and an addition / subtraction unit that adds the correction value calculated by the correction value calculation unit to at least the sample immediately before and immediately after the sample to which the maximum sample tag is assigned, and subtracts the correction value calculated by the correction value calculation unit from at least the sample immediately before and immediately after the sample to which the minimum sample tag is assigned.
[0009] A second aspect of one or more embodiments includes detecting a maximum sample and a minimum sample in a series of samples constituting an input digital audio signal, and when there are two or more consecutive first consecutive samples having the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag from the first consecutive samples to a sample different from the maximum sample, and when there are two or more consecutive samples having the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag to the maximum sample, and when there are two or more consecutive second consecutive samples having the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag to the minimum sample, and when there are two or more consecutive samples having the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag to the minimum sample, and detecting the number of adjacent samples between the sample to which the maximum sample tag is assigned and the sample to which the minimum sample tag is assigned. A digital audio processing method is provided that calculates a difference value between adjacent samples in the series of samples, multiplies the calculated difference value by a predetermined coefficient corresponding to the number of detected samples to calculate a correction value, adds the correction value to at least the sample in the series of samples that is one before and one after the sample to which the maximum sample tag is assigned, and subtracts the correction value from at least the sample to which the minimum sample tag is assigned and one after the sample to which the minimum sample tag is assigned.
[0010] A third aspect of one or more embodiments includes the steps of: detecting a maximum sample and a minimum sample in a series of samples constituting an input digital audio signal; when there are two or more consecutive first consecutive samples having the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag from the first consecutive samples to a sample different from the maximum sample; when there are two or more consecutive samples having the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag to the maximum sample; and when there are two or more consecutive second consecutive samples having the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag from the second consecutive samples to a sample different from the minimum sample. a step of assigning a minimum sample tag to the detected minimum sample when there are no two or more consecutive samples having the same value as the detected minimum sample, including the minimum sample; a step of detecting the number of samples between the adjacent sample to which the maximum sample tag is assigned and the sample to which the minimum sample tag is assigned; a step of calculating a difference value between adjacent samples in the series of samples; a step of multiplying the calculated difference value by a predetermined coefficient corresponding to the number of detected samples to calculate a correction value; and a step of adding the correction value to at least the sample immediately before and immediately after the sample to which the maximum sample tag is assigned, and subtracting the correction value from at least the sample immediately before and immediately after the sample to which the minimum sample tag is assigned.
[0011] According to one or more embodiments of the digital audio processing device, digital audio processing method, and digital audio processing program, even if the digital audio signal contains a waveform with multiple consecutive samples of the same value as a maximum or minimum sample, it is possible to generate a harmonic signal that is ideal for improving sound quality.
[0012] FIG. 1 is a block diagram illustrating a digital audio processing device according to one or more embodiments. FIG. 2A is a waveform diagram illustrating an example of the waveform of an audio signal input to the digital audio processing device according to one or more embodiments. FIG. 2B is a waveform diagram illustrating a state in which the digital audio processing device according to one or more embodiments performs addition and subtraction processing on the waveform illustrated in FIG. 2A . FIG. 3 is a diagram illustrating an example of a table of correction values set for each number of samples between a maximum sample and a minimum sample. FIG. 4A is a diagram illustrating a corrected waveform in which an addition and subtraction unit included in the digital audio processing device according to one or more embodiments adds correction values to samples one before and one after a maximum sample. FIG. 4B is a diagram illustrating a corrected waveform in which an addition and subtraction unit included in the digital audio processing device according to one or more embodiments subtracts correction values from samples one before and one after a minimum sample. FIG. 5A is a diagram illustrating a corrected waveform in which an addition and subtraction unit included in the digital audio processing device according to one or more embodiments adds correction values to samples one before, two before, one after, and two after a maximum sample. FIG. 5B is a diagram showing a corrected waveform obtained by subtracting a correction value from the samples one before, two before, one after, and two after a minimum sample by an adder / subtractor unit included in a digital audio processing device according to one or more embodiments. FIG. 6 is a diagram showing an example of a waveform in which multiple samples having the same value as a maximum sample occur in succession. FIG. 7 is a diagram conceptually illustrating a maximum sample correction operation performed by a maximum / minimum sample correction unit included in a digital audio processing device according to one or more embodiments. FIG. 8 is a diagram showing a corrected waveform obtained by performing an add / subtract process on a waveform in which a maximum sample has been corrected by the maximum / minimum sample correction unit, by an adder / subtractor unit included in a digital audio processing device according to one or more embodiments. FIG. 9 is a diagram showing an example of a waveform in which multiple samples having the same value as a minimum sample occur in succession. FIG. 10 is a diagram conceptually illustrating a minimum sample correction operation performed by a maximum / minimum sample correction unit included in a digital audio processing device according to one or more embodiments. FIG. 11 is a diagram showing a corrected waveform obtained by performing addition and subtraction processing on a waveform in which the maximum and minimum sample correction unit has corrected the minimum samples, using an addition and subtraction unit provided in a digital audio processing device according to one or more embodiments.Fig. 12 is a diagram for explaining a calculation formula used by a maximum / minimum sample correction unit included in a digital audio processing device according to one or more embodiments when correcting a maximum sample. Fig. 13 is a diagram for explaining a calculation formula used by a maximum / minimum sample correction unit included in a digital audio processing device according to one or more embodiments when correcting a minimum sample. Fig. 14 is a flowchart showing the operation of a digital audio processing device according to one or more embodiments, a digital audio processing method according to one or more embodiments, and a process executed by a computer according to a digital audio processing program according to one or more embodiments. Fig. 15 is a flowchart showing the specific process of step S33 shown in Fig. 14. Fig. 16 is a block diagram showing an example configuration of a microcomputer that executes a digital audio processing program according to one or more embodiments.
[0013] Hereinafter, a digital audio processing device, a digital audio processing method, and a digital audio processing program according to one or more embodiments will be described with reference to the accompanying drawings.
[0014] 1, a digital audio processing device 100 according to one or more embodiments includes a maximum / minimum sample detection unit 11, a maximum / minimum sample correction unit 12, a sample number detection unit 13, a difference value calculation unit 14, a correction value calculation unit 15, and an addition / subtraction unit 16. The maximum / minimum sample correction unit 12 is a component unique to the digital audio processing device according to one or more embodiments, and is not included in the digital audio processing device described in Patent Document 1.
[0015] First, we will explain the basic operation of the digital audio processing device 100. We will take as an example a waveform in which the digital audio signal (hereinafter referred to as audio signal) input to the digital audio processing device 100 does not contain a waveform in which two or more consecutive samples with the same value as a maximum sample or minimum sample exist, but in which each maximum sample and minimum sample exists independently.
[0016] 1 , for example, an audio signal with a quantization bit rate of 24 bits and a sampling frequency of 96 kHz is input to the maximum / minimum sample detection unit 11. The maximum / minimum sample detection unit 11 detects maximum samples, which are samples having maximum values, and minimum samples, which are samples having minimum values, by determining the magnitude relationship between adjacent sample values in the input audio signal. Specifically, the maximum / minimum sample detection unit 11 detects as a maximum sample a sample immediately before a sample where the slope of the waveform of the audio signal changes from a positive state including zero to a negative state, and as a minimum sample a sample immediately before a sample where the slope changes from a negative state including zero to a positive state.
[0017] Fig. 2A shows an example of the waveform of an input audio signal. A series of samples constituting the waveform of the audio signal are arranged in the time direction at sample intervals T0. When the waveform of the input audio signal is the waveform shown in Fig. 2A, the maximum / minimum sample detection unit 11 detects sample S0 as a minimum sample and sample S3 as a maximum sample. The waveform between the minimum sample S0 and the maximum sample S3 is shown by a thin solid line.
[0018] 2A does not have two or more consecutive samples with the same value as the maximum or minimum sample. Therefore, the maximum / minimum sample correction unit 12 assigns maximum sample tags and minimum sample tags to the maximum and minimum samples detected by the maximum / minimum sample detection unit 11. In other words, the maximum / minimum sample correction unit 12 does not correct the maximum and minimum samples.
[0019] The sample number detection unit 13 detects the number of samples (sample interval) between a sample to which a maximum sample tag is assigned and a sample to which a minimum sample tag is assigned, which are adjacent to each other. Here, the sample to which a maximum sample tag is assigned is a maximum sample detected by the maximum / minimum sample detection unit 11, and the sample to which a minimum sample tag is assigned is a minimum sample detected by the maximum / minimum sample detection unit 11. Hereinafter, the number of samples between adjacent maximum and minimum samples may be abbreviated to the sample interval between the maximum and minimum samples, or simply the sample interval.
[0020] The number of samples between a sample tagged with a maximum sample tag and a sample tagged with a minimum sample tag refers to the number of samples in the portion where the sample value increases from minimum sample S0 to maximum sample S3, as shown in Figure 2A, and the number of samples in the portion where the sample value decreases from maximum sample S3 to a minimum sample not shown. In the waveform shown in Figure 2A, the sample number detection unit 13 detects that the interval between minimum sample S0 and maximum sample S3 is three samples. If the sample period is denoted as fs, the sample interval between minimum sample S0 and maximum sample S3 shown in Figure 2A is 3fs.
[0021] The difference value calculation unit 14 calculates the difference value between adjacent samples in the input audio signal. The correction value calculation unit 15 calculates the correction value by multiplying the difference value between the adjacent samples by a predetermined coefficient corresponding to the sample interval between the sample tagged with the maximum sample tag and the sample tagged with the minimum sample tag. The coefficient is a number equal to or smaller than 1.
[0022] 3 shows an example of a coefficient by which the correction value calculation unit 15 multiplies the difference value between adjacent samples. The maximum sample-minimum sample interval shown in FIG. 3 means the number of samples between a sample tagged with a maximum sample tag and a sample tagged with a minimum sample tag.
[0023] 1 is configured such that a level selection signal is input to the correction value calculation unit 15, and a coefficient by which the difference value is multiplied can be selected by the level selection signal. It is not essential that the correction value be adjustable by selecting the coefficient by which the difference value is multiplied, but it is preferable that the correction value be adjustable.
[0024] 3, the correction value calculation unit 15 has coefficients set corresponding to level selection signals 00, 01, 10, and 11 for sample intervals between the maximum and minimum samples ranging from two samples to a predetermined number of samples. The predetermined number can be set as appropriate. When the level selection signal is 00, the correction value is maximum, and as the level selection signal approaches 11, the correction value decreases. In other words, the harmonic signal added to the audio signal is maximum when the level selection signal is 00, and decreases as the level selection signal approaches 11.
[0025] The adding / subtracting unit 16 adds the correction value calculated by the correction value calculating unit 15 to samples in the input audio signal near samples to which maximum sample tags have been assigned, and subtracts the correction value calculated by the correction value calculating unit 15 from samples near samples to which minimum sample tags have been assigned. Here, the samples to which maximum sample tags have been assigned and the samples to which minimum sample tags have been assigned are samples detected as maximum samples and minimum samples by the maximum / minimum sample detecting unit 11, respectively. Therefore, the adding / subtracting unit 16 adds the correction value to samples near maximum samples and subtracts the correction value from samples near minimum samples.
[0026] 4A, 4B, 5A, and 5B, a specific description will be given of how the adder / subtractor 16 adds a correction value to a sample near a maximum sample and subtracts a correction value from a sample near a minimum sample. In FIGS. 4A, 4B, 5A, and 5B, Smax indicates a maximum sample, and Smin indicates a minimum sample. Sample S(-1) indicates the sample immediately preceding the maximum sample Smax or minimum sample Smin, and sample S(-2) indicates the sample immediately preceding the maximum sample Smax or minimum sample Smin. Sample S(+1) indicates the sample immediately following the maximum sample Smax or minimum sample Smin, and sample S(+2) indicates the sample immediately following the maximum sample Smax or minimum sample Smin.
[0027] 4A , the addition / subtraction unit 16 adds the correction value Vadd, which the correction value calculation unit 15 calculated by multiplying the difference value Δ(−1) between the maximum sample Smax and sample S(−1) by a coefficient, to the sample S(−1) adjacent to the maximum sample Smax. The addition / subtraction unit 16 adds the correction value Vadd, which the correction value calculation unit 15 calculated by multiplying the difference value Δ(+1) between the maximum sample Smax and sample S(+1) by a coefficient, to the sample S(+1) adjacent to the maximum sample Smax. The uncorrected samples S(−1) and S(+1), indicated by the dashed lines, are corrected to samples S(−1)′ and S(+1)′, indicated by the solid lines, by adding the correction value Vadd.
[0028] 4B , the addition / subtraction unit 16 subtracts the correction value Vsub, which the correction value calculation unit 15 calculated by multiplying the difference value Δ(−1) between the minimal sample Smin and sample S(−1) by a coefficient, from the sample S(−1) adjacent to the minimal sample Smin. The addition / subtraction unit 16 subtracts the correction value Vsub, which the correction value calculation unit 15 calculated by multiplying the difference value Δ(+1) between the minimal sample Smin and sample S(+1) by a coefficient, from the sample S(+1) adjacent to the minimal sample Smin. The uncorrected samples S(−1) and S(+1), indicated by the dashed lines, are corrected to samples S(−1)′ and S(+1)′, indicated by the solid lines, by subtracting the correction value Vsub.
[0029] As an example, if the sample interval between the maximum sample Smax and the minimum sample Smin is between two and five samples, the addition / subtraction unit 16 performs the addition / subtraction process shown in Figures 4A and 4B. If the sample interval is six samples or more, the addition / subtraction unit 16 performs the addition / subtraction process shown in Figures 5A and 5B. In this way, the addition / subtraction unit 16 may select between the addition / subtraction process shown in Figures 4A and 4B and the addition / subtraction process shown in Figures 5A and 5B depending on the sample interval.
[0030] As shown in FIG. 5A , the adding / subtracting unit 16 adds the correction value Vadd to the sample S(−1), similarly to FIG. 4A . In addition, the adding / subtracting unit 16 adds the correction value Vadd calculated by the correction value calculation unit 15 by multiplying the difference value Δ(−2) between the sample S(−1) and the sample S(−2) by a coefficient to the sample S(−2) that is two samples before the maximum sample Smax. As shown in FIG. 4A , the adding / subtracting unit 16 adds the correction value Vadd to the sample S(+1). In addition, the adding / subtracting unit 16 adds the correction value Vadd calculated by the correction value calculation unit 15 by multiplying the difference value Δ(+2) between the sample S(+1) and the sample S(+2) by a coefficient to the sample S(+2) that is two samples after the maximum sample Smax.
[0031] The uncorrected samples S(-1), S(-2), S(+1), and S(+2) shown by dashed lines are corrected to samples S(-1)', S(-2)', S(+1)', and S(+2)' shown by solid lines by adding the correction value Vadd.
[0032] As shown in FIG. 5B , the adder-subtractor 16 subtracts the correction value Vsub from the sample S(-1), similarly to FIG. 4B . In addition, the adder-subtractor 16 subtracts the correction value Vsub calculated by the correction value calculation unit 15 by multiplying the difference value Δ(-2) between the sample S(-1) and the sample S(-2) by a coefficient from the sample S(-2) that is two samples before the minimum sample Smin. As shown in FIG. 4B , the adder-subtractor 16 subtracts the correction value Vsub from the sample S(+1). In addition, the adder-subtractor 16 subtracts the correction value Vsub calculated by the correction value calculation unit 15 by multiplying the difference value Δ(+2) between the sample S(+1) and the sample S(+2) by a coefficient from the sample S(+2) that is two samples after the minimum sample Smin.
[0033] The uncorrected samples S(-1), S(-2), S(+1), and S(+2) shown by dashed lines are corrected to samples S(-1)', S(-2)', S(+1)', and S(+2)' shown by solid lines by subtracting the correction value Vsub.
[0034] In this manner, the adding / subtracting unit 16 adds the correction value Vadd to the sample near the maximum sample and subtracts the correction value Vsub from the sample near the minimum sample, thereby outputting an audio signal to which a harmonic signal has been added from the adding / subtracting unit 16. Note that the difference value calculating unit 14 may calculate only the difference value between the sample to which the adding / subtracting unit 16 adds or subtracts the correction value Vadd or Vsub and its adjacent sample.
[0035] 4A and 4B , when the sample interval between the maximum sample Smax and the minimum sample Smin is two samples, both addition and subtraction are performed on the intermediate sample between the maximum sample Smax and the minimum sample Smin. To avoid this, the addition / subtraction unit 16 preferably performs only addition on the intermediate sample when the sample interval is two samples. The addition / subtraction unit 16 may perform only addition on the intermediate sample when the sample value increases from the minimum sample Smin to the maximum sample Smax, and may perform only subtraction on the intermediate sample when the sample value decreases from the maximum sample Smax to the minimum sample Smin.
[0036] Since the waveform shown in FIG. 2A has an interval of three samples, the addition / subtraction unit 16 performs the addition / subtraction processing shown in FIGS. 4A and 4B. As shown in FIG. 2B, the uncorrected sample S1 shown by the dashed line is corrected to the sample S1' shown by the solid line by subtracting the correction value Vsub, and the sample value decreases as shown by the arrow. The uncorrected sample S2 shown by the dashed line is corrected to the sample S2' shown by the solid line by adding the correction value Vadd, and the sample value increases as shown by the arrow. The waveform shown by the dashed line between the minimum sample S0 and the maximum sample S3 is corrected to the waveform shown by the thin solid line. The waveform shown by the dashed line in FIG. 2B corresponds to the waveform shown by the thin solid line in FIG. 2A.
[0037] The case where the sample interval between the maximum sample and the minimum sample is divided into two to five sample intervals and six or more sample intervals is merely an example. The addition / subtraction unit 16 may perform only the addition / subtraction process shown in FIGS. 4A and 4B when the sample interval between the maximum sample and the minimum sample is from two sample intervals to a predetermined number of sample intervals. When selecting the addition / subtraction process shown in FIGS. 4A and 4B and the addition / subtraction process shown in FIGS. 5A and 5B, the addition / subtraction unit 16 may perform the addition / subtraction process shown in FIGS. 5A and 5B for sample intervals greater than six sample intervals. The addition / subtraction unit 16 may add a correction value to the samples three samples before and three samples after the maximum sample, or any samples thereafter, and may subtract a correction value from the samples three samples before and three samples after the minimum sample, or any samples thereafter.
[0038] The adding / subtracting unit 16 adds the correction value Vadd to at least the sample immediately before and immediately after the maximum sample among the series of samples, and subtracts the correction value Vsub from at least the sample immediately before and immediately after the minimum sample.
[0039] Next, the operation of the digital audio processing device 100 will be described when the audio signal input to the digital audio processing device 100 includes the waveform shown in Figure 6. As shown in Figure 6, the sample values increase in order from minimum sample S0 to sample S3, and samples of the same value continue from sample S3 to sample S6. The sample values decrease in order from sample S6 to minimum sample S9. In this case, the maximum / minimum sample detection unit 11 detects sample S6 as the maximum sample. The waveform shown in Figure 6 is an example of a waveform in which there is a first series of two or more consecutive samples having the same value as the maximum sample (sample S6 in this case), including the maximum sample.
[0040] If the maximum / minimum sample correction unit 12 were not provided, the sample number detection unit 13 would detect that the interval between the minimum sample S0 and the maximum sample S6 is six samples (6 fs), and the interval between the maximum sample S6 and the minimum sample S9 is three samples (3 fs). In other words, the sample number detection unit 13 would detect that the number of samples between the minimum sample S0 and the maximum sample S6 is six, and the number of samples between the maximum sample S6 and the minimum sample S9 is three.
[0041] 6, it is highly likely that sample S6, which has been determined to have a maximum value, is not the sample having the true maximum value, and that a sample other than sample S6 among the first consecutive samples is the sample having the true maximum value. Therefore, the maximum / minimum sample corrector 12 corrects the maximum sample as follows.
[0042] 7 conceptually illustrates the operation of correcting a maximum sample by the maximum / minimum sample corrector 12. As shown in FIG. 7, the maximum / minimum sample corrector 12 sets a first line SL1 connecting the first sample S3 in the first series of samples and the sample S2 immediately preceding it. The maximum / minimum sample corrector 12 sets a second line SL2 connecting the last sample S6 in the first series of samples, which is detected as a maximum sample by the maximum / minimum sample detector 11, and the sample S7 immediately following it.
[0043] The maximum / minimum sample correction unit 12 sets an estimated maximum sample SmaxE, which is estimated to have a true maximum value, at the intersection of the first line SL1 and the second line SL2. The maximum / minimum sample correction unit 12 regards the sample closest to a projection point PpE, which is obtained by projecting the estimated maximum sample SmaxE onto the flat waveform of the first consecutive samples, as the sample having the true maximum value. Here, the maximum / minimum sample correction unit 12 regards sample S4 as the sample having the true maximum value and assigns a maximum sample tag to sample S4. Sample S4, to which the maximum sample tag is assigned, becomes the corrected maximum sample. That is, the maximum / minimum sample correction unit 12 corrects the maximum sample from sample S6 to sample S4, which is the corrected maximum sample having the true maximum value.
[0044] Depending on the slope of the first line SL1 and the second line SL2, a sample detected as a maximum sample by the maximum / minimum sample detection unit 11 may be regarded as a sample having a true maximum value, and a maximum sample tag may be assigned to that sample.
[0045] Since the minimum samples S0 and S9 detected by the maximum / minimum sample detection unit 11 do not have consecutive samples with the same value, the maximum / minimum sample correction unit 12 does not correct the minimum samples S0 and S9, and a minimum sample tag is assigned to each of the minimum samples S0 and S9. Therefore, the sample number detection unit 13 detects the number of samples between the adjacent minimum sample S0 tagged with a minimum sample tag and the adjacent sample S4 tagged with a maximum sample tag, and the number of samples between the adjacent sample S4 tagged with a maximum sample tag and the adjacent minimum sample S9 tagged with a minimum sample tag. Therefore, the sample number detection unit 13 detects that the interval between the minimum sample S0 and sample S4 is four samples (4 fs), and the interval between sample S4 and the minimum sample S9 is five samples (5 fs). In other words, the sample number detection unit 13 detects that the number of samples between the minimum sample S0 and sample S4 is four, and the number of samples between sample S4 and the minimum sample S9 is five.
[0046] 8 shows a corrected waveform obtained by adding or subtracting a correction value to or from the waveform obtained by the maximum / minimum sample correction unit 12 correcting the maximum sample from sample S6 to sample S4 as shown in FIG. 7. Since sample S3, which is immediately before sample S4, and sample S5, which is immediately after sample S4, have the same value as sample S4, the difference value calculated by the difference value calculation unit 14 is 0, and the correction value Vadd is not added to samples S3 and S5. The correction value Vsub is subtracted from samples S1 and S8.
[0047] 5A and 5B when the sample interval is six samples or more. Let us assume that the adding / subtracting unit 16 performs the adding / subtracting process shown in Fig. 6 while leaving sample S6 detected by the maximum / minimum sample detecting unit 11 as the maximum sample. Then, subtraction of the correction value Vsub is performed on samples S1 and S2, addition of the correction value Vadd is performed on sample S7, and subtraction of the correction value Vsub is performed on sample S8.
[0048] As described above, in the waveform shown in Figure 6, sample S6 is not the sample having the true maximum value, but sample S4 is the sample having the true maximum value. By including the maximum / minimum sample correction unit 12, the digital audio processing device 100 can perform the addition / subtraction processing shown in Figure 8. Even if the audio signal contains a waveform in which multiple consecutive samples have the same value as a maximum sample, the digital audio processing device 100 can more accurately detect the sample interval and generate an ideal harmonic signal for improving sound quality. Tests by the inventors have confirmed that this improves the perceived sound quality.
[0049] Next, the operation of the digital audio processing device 100 will be described when the audio signal input to the digital audio processing device 100 includes the waveform shown in Fig. 9. As shown in Fig. 9, the sample values decrease sequentially from maximum sample S20 to sample S23, and samples of the same value are consecutive from sample S23 to sample S26. The sample values increase sequentially from sample S26 to maximum sample S29. In this case, the maximum / minimum sample detection unit 11 detects sample S26 as a minimum sample. The waveform shown in Fig. 9 is an example of a waveform in which there is a second consecutive sample, in which two or more consecutive samples having the same value as the minimum sample (here, sample S26), including the minimum sample, are present.
[0050] If the maximum / minimum sample correction unit 12 were not provided, the sample number detection unit 13 would detect that the interval between the maximum sample S20 and the minimum sample S26 is six samples (6 fs), and that the interval between the minimum sample S26 and the maximum sample S29 is three samples (3 fs). In other words, the sample number detection unit 13 would detect that the number of samples between the maximum sample S20 and the minimum sample S26 is six, and that the number of samples between the minimum sample S26 and the maximum sample S29 is three.
[0051] 9, it is highly likely that sample S26, which has been determined to have a minimum value, is not the sample having the true minimum value, and that a sample other than sample S26 among the second consecutive samples is the sample having the true minimum value. Therefore, the maximum / minimum sample corrector 12 corrects the minimum sample as follows.
[0052] 10 conceptually illustrates the minimum sample correction operation performed by the maximum / minimum sample correction unit 12. As shown in FIG. 10, the maximum / minimum sample correction unit 12 sets a third line SL11 connecting the first sample S23 in the second series of samples and the sample S22 immediately preceding it. The maximum / minimum sample correction unit 12 sets a fourth line SL12 connecting sample S26, which is the last sample in the second series of samples and has been detected as a minimum sample by the maximum / minimum sample detection unit 11, and the sample S27 immediately following it.
[0053] The maximum / minimum sample correction unit 12 sets an estimated minimum sample SminE, which is estimated to have a true minimum value, at the intersection of the third line SL11 and the fourth line SL12. The maximum / minimum sample correction unit 12 regards the sample closest to a projection point PpE, which is obtained by projecting the estimated minimum sample SminE onto the flat waveform of the second consecutive samples, as the sample having the true minimum value. Here, the maximum / minimum sample correction unit 12 regards sample S24 as the sample having the true minimum value and assigns a minimum sample tag to sample S24. Sample S24 to which the minimum sample tag is assigned becomes the corrected minimum sample. That is, the maximum / minimum sample correction unit 12 corrects the minimum sample from sample S26 to sample S24, which is a corrected minimum sample having a true minimum value.
[0054] Depending on the slope of the third line SL11 and the fourth line SL12, a sample detected as a minimum sample by the maximum / minimum sample detection unit 11 may be regarded as a sample having a true minimum value, and a minimum sample tag may be assigned to that sample.
[0055] Because the maximum samples S20 and S29 detected by the maximum / minimum sample detection unit 11 do not have consecutive samples with the same value, the maximum / minimum sample correction unit 12 does not correct the maximum samples S20 and S29, and maximum samples S20 and S29 are assigned maximum sample tags. Therefore, the sample number detection unit 13 detects the number of samples between the adjacent maximum sample S20 with a maximum sample tag and the adjacent sample S24 with a minimum sample tag, and the number of samples between the adjacent sample S24 with a minimum sample tag and the maximum sample S29 with a maximum sample tag. Therefore, the sample number detection unit 13 detects that the interval between the maximum sample S20 and sample S24 is four samples (4 fs), and that the interval between sample S24 and the maximum sample S29 is five samples (5 fs). In other words, the sample number detection unit 13 detects that the number of samples between the maximum sample S20 and sample S24 is four, and the number of samples between sample S24 and maximum sample S9 is five.
[0056] 11 shows a corrected waveform obtained by adding / subtracting a correction value to / from the waveform obtained by the maximum / minimum sample correction unit 12 correcting the minimum sample from sample S26 to sample S24 as shown in FIG. 10. Since sample S23, which is immediately before sample S24, and sample S25, which is immediately after sample S24, have the same value as sample S24, the difference value calculated by the difference value calculation unit 14 is 0, and the correction value Vsub is not subtracted from samples S23 and S25. The correction value Vadd is added to samples S21 and S28.
[0057] 5A and 5B when the sample interval is six samples or more. Let us assume that the adding / subtracting unit 16 performs the adding / subtracting process shown in Fig. 9 while leaving sample S26 detected by the maximum / minimum sample detecting unit 11 as the minimum sample. Then, the adding / subtracting unit 16 adds the correction value Vadd to samples S21 and S22, subtracts the correction value Vsub from sample S27, and adds the correction value Vadd to sample S28.
[0058] As described above, in the waveform shown in Figure 9, sample S26 is not a sample having a true minimum value, but sample S24 is a sample having a true minimum value. By including the maximum / minimum sample correction unit 12, the digital audio processing device 100 can perform addition / subtraction processing as shown in Figure 11. Even if the audio signal contains a waveform in which multiple consecutive samples have the same value as a minimum sample, the digital audio processing device 100 can more accurately detect the sample interval and generate an ideal harmonic signal for improving sound quality. Tests by the inventors have confirmed that this improves the sound quality perceived by ear.
[0059] The correction operation of maximum and minimum samples by the maximum / minimum sample correction unit 12 has been conceptually explained using Figures 7 and 10, but the samples to which maximum sample tags should be assigned and the samples to which minimum sample tags should be assigned can be determined by calculation as shown in Figures 12 and 13.
[0060] FIG. 12 shows the same waveform as FIG. 6. In FIG. 12, the x-axis is the axis passing through the flat waveform of the first consecutive samples, and the y-axis is the axis passing through the first sample S3 of the flat waveform and perpendicular to the x-axis. A two-dimensional coordinate system is set with sample S3 as the origin (x0, y0). The coordinates of sample S2 are (x(-1), y(-1)), the coordinates of sample S6 are (x3, y3), and the coordinates of sample S7 are (x4, y4). In this way, each sample of the waveform shown in FIG. 6 can be represented by x and y coordinates on the x and y axes.
[0061] The slope of the first straight line SL1 is d3, and since the first straight line SL1 passes through the origin, the first straight line SL1 can be expressed by the following formula (1). The slope of the second straight line SL2 is (-d7), and since it passes through the coordinates (x3, y3), the second straight line SL2 can be expressed by the following formula (2). The symbol * indicates multiplication. y = d3 * x ... (1) y = (-d7) * x + (d7 * x3) ... (2)
[0062] The x component of the estimated maximum sample SmaxE, which is the intersection of the first line SL1 and the second line SL2, can be calculated by the following equation (3): SmaxE=(d7*x3) / (d3+d7) (3)
[0063] If the sample closest to the projection point PpE obtained by projecting the estimated maximum sample SmaxE onto the flat waveform is called Se, sample Se can be calculated using equation (4). The projection point PpE is the x-component of the estimated maximum sample SmaxE calculated using equation (3). In equation (4), FL is the length of the flat waveform (sample interval), which is 3 in this example. (int) is a function that rounds down to an integer. By substituting FL for x3 in equation (3) and adding 0.5 to the result of dividing (d7 * FL) / (d3 + d7) to round down the decimal point, the coordinate indicating the sample is rounded up or down, and the coordinate of sample Se closest to projection point PpE can be obtained. d3 and d7 in equation (4) are absolute values. Here, sample S4 is calculated as sample Se. Se = (int) [(d7 * FL) / (d3 + d7) + 0.5] ... (4)
[0064] FIG. 13 shows the same waveform as FIG. 9. In FIG. 13, the x-axis is the axis passing through the flat waveform of the second consecutive samples, the y-axis is the axis passing through the first sample S23 of the flat waveform and perpendicular to the x-axis, and a two-dimensional coordinate system is set with sample S23 as the origin (x0, y0). The coordinates of sample S22 are (x(-1), y(-1)), the coordinates of sample S26 are (x3, y3), and the coordinates of sample S27 are (x4, y4). In this way, each sample of the waveform shown in FIG. 9 can be represented by x and y coordinates on the x and y axes.
[0065] The third straight line SL11 has a slope of (-d23) and passes through the origin, so the third straight line SL11 can be expressed by the following equation (5). The fourth straight line SL12 has a slope of d27 and passes through the coordinates (x3, y3), so the fourth straight line SL12 can be expressed by the following equation (6). y = (-d23) * x (5) y = d27 * x + ((-d27) * x3) (6)
[0066] The estimated minimum sample SminE, which is the intersection of the third line SL11 and the fourth line SL12, is calculated by the following equation (7): SmaxE=(d27*x3) / (d23+d27) (7)
[0067] The sample Se closest to the projection point PpE of the estimated minimum sample SminE projected onto the flat waveform can be calculated using equation (8) in the same manner as equation (4). d23 and d27 in equation (8) are absolute values. Here, sample S24 is calculated as sample Se. Se=(int)[(d27*FL) / (d23+d27)+0.5] ...(8)
[0068] 14 and 15 will be used to further explain the operation of the digital audio processing device 100 and the digital audio processing method executed by the digital audio processing device 100. The flowcharts shown in Figures 14 and 15 also show the processing that the digital audio processing program causes the central processing unit of a microcomputer, which will be described later, to execute.
[0069] 14, when an audio signal is input to the digital audio processing device 100 and processing is started, the maximum / minimum sample detection unit 11 detects maximum samples and minimum samples in step S31. The maximum / minimum sample correction unit 12 determines in step S32 whether there are consecutive samples with the same value as the maximum or minimum sample.
[0070] If successive samples have the same value as the sample value of the maximum sample in step S32 (YES), the maximum / minimum sample correction unit 12 assigns a maximum sample tag to samples other than the detected maximum sample in step S33. If successive samples have the same value as the sample value of the minimum sample in step S32 (YES), the maximum / minimum sample correction unit 12 assigns a minimum sample tag to samples other than the detected minimum sample in step S33. Then, the process proceeds to step S35.
[0071] If there are no consecutive samples with the same value as the maximum or minimum sample in step S32 (NO), the maximum / minimum sample corrector 12 assigns a maximum sample tag to the detected maximum sample and a minimum sample tag to the detected minimum sample in step S34. Then, the process proceeds to step S35.
[0072] FIG. 15 shows the specific processing of step S33. In FIG. 15 , the maximum / minimum sample correction unit 12 obtains, in step S331, the slope da of a line connecting the previous sample in a flat waveform having successive samples of the same value to the first sample in the flat waveform. The slope d3 shown in FIG. 12 and the slope d23 shown in FIG. 13 correspond to the slope da. In step S332, the maximum / minimum sample correction unit 12 obtains the slope db of a line connecting the last sample in the flat waveform to the sample immediately following the flat waveform. The slope d7 shown in FIG. 12 and the slope d27 shown in FIG. 13 correspond to the slope db. In step S333, the maximum / minimum sample correction unit 12 obtains the length FL of the flat waveform.
[0073] In step S334, the maximum / minimum sample correction unit 12 calculates the sample Se to which the maximum sample tag should be assigned and the sample Se to which the minimum sample tag should be assigned based on the calculation formula shown in the following formula (9): Se=(int)[(db*FL) / (da+db)+0.5] (9)
[0074] In step S335, the maximum / minimum sample corrector 12 assigns a maximum sample tag or a minimum sample tag to the sample Se. In this way, a maximum sample or a minimum sample in a flat waveform consisting of successive samples of the same value is corrected to a corrected maximum sample having a true maximum value or a corrected minimum sample having a true minimum value.
[0075] 14 , in step S35, the sample number detection unit 13 detects the number of samples (sample interval) between a sample assigned with a maximum sample tag and a sample assigned with a minimum sample tag. In step S36, the difference value calculation unit 14 calculates a difference value between adjacent samples. In step S37, the correction value calculation unit 15 calculates a correction value. In step S38, the addition / subtraction unit 16 adds or subtracts a correction value to or from samples near the sample assigned with the maximum sample tag and the sample assigned with the minimum sample tag.
[0076] In step S39, the digital audio processing device 100 determines whether the input of the audio signal has ended. If the input of the audio signal has not ended (NO), the processing from step S31 onwards is repeated. If the input of the audio signal has ended, the digital audio processing device 100 ends the processing.
[0077] The digital audio processing device 100 shown in Fig. 1 can be realized by a central processing unit of a microcomputer executing a digital audio processing program. In Fig. 16, a central processing unit (hereinafter referred to as CPU) 50, a main memory 55, and a storage medium 60 are connected by a bus. The storage medium 60 is any non-transitory storage medium such as a hard disk drive, an optical disk, or a semiconductor memory. The storage medium 60 stores a digital audio processing program. The digital audio processing program may be transmitted from an external server via a communication line such as the Internet and stored in the storage medium 60.
[0078] The CPU 50 loads the digital audio processing program stored in the storage medium 60 into the main memory 55. The CPU 50 executes the instructions written in the digital audio processing program loaded into the main memory 55, thereby performing the processes shown in Figures 14 and 15.
[0079] In the description of one or more embodiments, the maximum / minimum sample correction unit 12 performs a process of assigning tags to samples. However, when a first or second consecutive sample is present, the maximum or minimum sample detected by the maximum / minimum sample detection unit 11 and targeted by the maximum / minimum sample correction unit 12 is corrected by the maximum / minimum sample correction unit 12. This does not necessarily have to be a process using tags.
[0080] For example, in the maximum / minimum sample correction unit 12, if the maximum sample detected by the maximum / minimum sample detection unit 11 and the maximum sample in the maximum / minimum sample correction unit 12 are the same sample, the same sample may be overwritten on the maximum sample detected by the maximum / minimum sample detection unit 11, and if the maximum sample detected by the maximum / minimum sample detection unit 11 and the maximum sample in the maximum / minimum sample correction unit 12 are different samples, the different sample may be overwritten on the maximum sample detected by the maximum / minimum sample detection unit 11. The same applies to the minimum samples.
[0081] As described above, in the digital audio processing device, digital audio processing method, and digital audio processing program according to one or more embodiments, the digital audio signal to be processed includes a waveform in which multiple consecutive samples have the same value as a maximum sample or a minimum sample. According to the digital audio processing device, digital audio processing method, and digital audio processing program according to one or more embodiments, the maximum sample or minimum sample is corrected to a corrected maximum sample or corrected minimum sample that is closer to the true maximum sample or true minimum sample. Therefore, according to the digital audio processing device, digital audio processing method, and digital audio processing program according to one or more embodiments, it is possible to more accurately detect sample intervals and generate harmonic signals that are ideal for improving sound quality.
[0082] The present invention is not limited to one or more of the above-described embodiments, and various modifications can be made without departing from the spirit and scope of the present invention.
[0083] This application claims priority based on Japanese Patent Application No. 2024-150937, filed with the Japan Patent Office on September 2, 2024, the entire disclosure of which is incorporated herein by reference.
Claims
1. A maximum / minimum sample detection unit detects maximum and minimum samples in a series of samples constituting an input digital audio signal; and a maximum / minimum sample correction unit that, when there are two or more consecutive first consecutive samples having the same value as the maximum sample detected by the maximum / minimum sample detection unit, assigns a maximum sample tag from the first consecutive samples to a sample different from the maximum sample, when there are two or more consecutive samples having the same value as the maximum sample detected by the maximum / minimum sample detection unit, including the maximum sample, assigns a maximum sample tag to the maximum sample, when there are two or more consecutive samples having the same value as the maximum sample detected by the maximum / minimum sample detection unit, including the maximum sample, assigns a minimum sample tag to the minimum sample, when there are two or more consecutive samples having the same value as the minimum sample detected by the maximum / minimum sample detection unit, including the minimum sample, and assigns a minimum sample tag to the minimum sample, when there are two or more consecutive samples having the same value as the minimum sample detected by the maximum / minimum sample detection unit, including the minimum sample, A digital audio processing device comprising: a sample number detection unit that detects the number of samples between adjacent samples to which the maximum sample tag is assigned and adjacent samples to which the minimum sample tag is assigned; a difference value calculation unit that calculates a difference value between adjacent samples in the series of samples; a correction value calculation unit that calculates a correction value by multiplying the difference value calculated by the difference value calculation unit by a predetermined coefficient corresponding to the number of samples detected by the sample number detection unit; and an addition / subtraction unit that adds the correction value calculated by the correction value calculation unit to at least the sample immediately before and immediately after the sample to which the maximum sample tag is assigned in the series of samples, and subtracts the correction value calculated by the correction value calculation unit from at least the sample immediately before and immediately after the sample to which the minimum sample tag is assigned.
2. The digital audio processing device of claim 1, wherein the maximum / minimum sample correction unit: sets an estimated maximum sample at the intersection of a first line connecting the first sample in the first consecutive samples and the sample immediately preceding it with a second line connecting the last sample in the first consecutive samples and the sample immediately following it; assigns the maximum sample tag to a sample in the first consecutive samples that is closest to a projection point of the estimated maximum sample onto a flat waveform of the first consecutive samples; sets an estimated minimum sample at the intersection of a third line connecting the first sample in the second consecutive samples and the sample immediately preceding it with a fourth line connecting the last sample in the second consecutive samples and the sample immediately following it; and assigns the minimum sample tag to a sample in the second consecutive samples that is closest to a projection point of the estimated minimum sample onto a flat waveform of the second consecutive samples.
3. Detecting maximum and minimum samples in a series of samples constituting an input digital audio signal; when there are two or more consecutive first consecutive samples with the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag from the first consecutive samples to a sample different from the maximum sample; when there are two or more consecutive samples with the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag to the maximum sample; when there are two or more consecutive second consecutive samples with the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag from the second consecutive samples to a sample different from the minimum sample; when there are two or more consecutive samples with the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag to the minimum sample; detecting the number of adjacent samples between the sample to which the maximum sample tag is assigned and the sample to which the minimum sample tag is assigned; calculating the difference value between adjacent samples in the series of samples; A digital audio processing method that calculates a correction value by multiplying the calculated difference value by a predetermined coefficient corresponding to the number of detected samples, adds the correction value to at least the sample before and after the sample to which the maximum sample tag is assigned among the series of samples, and subtracts the correction value from at least the sample before and after the sample to which the minimum sample tag is assigned.
4. A computer includes the steps of: detecting a maximum sample and a minimum sample in a series of samples constituting an input digital audio signal; when there are two or more consecutive first consecutive samples having the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag from the first consecutive samples to a sample different from the maximum sample; when there are not two or more consecutive samples having the same value as the detected maximum sample, including the maximum sample, assigning a maximum sample tag to the maximum sample; when there are two or more consecutive second consecutive samples having the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag from the second consecutive samples to a sample different from the minimum sample; when there are not two or more consecutive samples having the same value as the detected minimum sample, including the minimum sample, assigning a minimum sample tag to the minimum sample; and detecting the number of adjacent samples between the sample to which the maximum sample tag is assigned and the sample to which the minimum sample tag is assigned. A digital audio processing program that executes the steps of: calculating a difference value between adjacent samples in the series of samples; calculating a correction value by multiplying the calculated difference value by a predetermined coefficient corresponding to the number of detected samples; and adding the correction value to at least the sample in the series of samples that is one before and one after the sample to which the maximum sample tag is assigned, and subtracting the correction value from at least the sample to which the minimum sample tag is assigned and one after the sample to which the minimum sample tag is assigned.
Citation Information
Patent Citations
Digital speech processor and computer program recording medium
JP2002189498A
Audio sigmal processor
JP2008112056A
Method and device for processing digital acoustic signal
JP2010020122A
Quantization bit number expanding method and quantization bit number expanding device
JP2011180479A