An audio noise cancellation method, storage medium, and device
By comparing and replacing audio waveform diagrams, the problem of noise removal in audio recording is solved, efficient audio optimization and noise removal are achieved, and processing costs are reduced.
Patent Information
- Application Number
- CN202111388288.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-11-22
AI Technical Summary
The prior art is difficult to effectively remove noise in audio recording, resulting in complex post-processing, wasting manpower and material resources, and affecting audio coherence.
By obtaining the array of comparison waveform diagrams and the waveform diagram of the audio to be detected, comparatively determine the target audio waveform diagram, and replace it according to the array of comparison waveform diagrams to obtain the audio that eliminates noise.
This method can easily and quickly optimize audio, remove noise, reduce costs, and improve audio coherence.
Smart Images

Figure CN114333875B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of audio processing, and particularly to an audio noise cancellation method, a storage medium, and a device. Background Art
[0002] In the existing audio recording, due to the complex on-site environment, there are many noises in the instrument sound part of the recorded audio. Post-processing requires cutting and re-recording the instrument sound part, which greatly wastes a lot of manpower and material resources and has a great impact on the audio coherence. Summary of the Invention
[0003] The technical problem to be solved by the present invention is: how to effectively optimize the audio and remove the noise in the audio.
[0004] To solve the above technical problem, the present invention provides one, which includes:
[0005] Obtain a control waveform diagram array and a waveform diagram of the audio to be detected;
[0006] Compare the waveform diagram of the audio to be detected with the control waveform diagram array to determine a target audio waveform diagram with noise in the waveform diagram of the audio to be detected;
[0007] Replace the target audio waveform diagram according to the control waveform diagram array to obtain an audio with noise removed.
[0008] In some embodiments, the obtaining of the control waveform diagram array includes:
[0009] Obtain a background audio waveform diagram of the site where the audio to be detected is located;
[0010] Obtain a note standard waveform diagram array, where the note standard waveform diagram array includes a plurality of unit standard waveform diagrams, and the unit standard waveform diagrams correspond to the notes one by one;
[0011] Superimpose the background audio waveform diagram and the note standard waveform diagram array to obtain the control waveform diagram array, where the control waveform diagram array includes a plurality of unit control waveform diagrams, and the unit control waveform diagrams correspond to the notes one by one.
[0012] In some embodiments, the obtaining of the control waveform diagram array includes:
[0013] Obtain a note standard waveform diagram array, and use the note standard waveform diagram array as the control waveform diagram array. The note standard waveform diagram array includes a plurality of unit standard waveform diagrams, the unit standard waveform diagrams are used as unit control waveform diagrams, and the unit standard waveform diagrams correspond to the notes one by one.
[0014] In some embodiments, before obtaining the waveform diagram of the audio to be detected, the following steps are further included:
[0015] Obtain the background audio and the initial audio at the scene where the audio to be detected is located;
[0016] Based on the background audio, remove the background noise from the initial audio, and use the initial audio with the background noise removed as the audio to be detected.
[0017] In some embodiments, comparing the waveform diagram of the audio to be detected with the array of reference waveform diagrams to determine the target audio waveform diagram with noise in the waveform diagram of the audio to be detected includes:
[0018] Based on the period of the unit standard waveform diagram, divide the waveform diagram of the audio to be detected into multiple unit wave objects;
[0019] Compare each unit wave object with the array of reference waveform diagrams respectively;
[0020] When the difference between the unit wave object and the unit reference waveform diagram in the array of reference waveform diagrams belongs to a preset range, determine the unit wave object as the target audio waveform diagram.
[0021] In some embodiments, after obtaining the array of note standard waveform diagrams, the method further includes: sorting the unit standard waveform diagrams according to the usage frequency of the notes.
[0022] In some embodiments, replacing the target audio waveform diagram according to the array of reference waveform diagrams to obtain an audio with noise eliminated includes:
[0023] Use the unit reference waveform diagram corresponding to the target audio waveform diagram to replace the target audio waveform diagram to obtain an audio with noise eliminated.
[0024] In some embodiments, multiple groups of the array of reference waveform diagrams are set, and different arrays of reference waveform diagrams correspond to different audio types.
[0025] In the second aspect of the present invention, a storage medium is provided, in which a computer program is stored, and when the computer program is executed by a processor, the audio noise elimination method described in any one of the above is implemented.
[0026] In the third aspect of the present invention, a device is provided, which includes a memory and a processor, and a computer program is stored in the memory, and when the computer program is executed by the processor, the audio noise elimination method described in any one of the above is implemented.
[0027] Compared with the prior art, one or more embodiments of the above solution may have the following advantages or beneficial effects:
[0028] By applying the audio noise cancellation method provided by the present invention, by obtaining the control waveform diagram array and the waveform diagram of the audio to be detected, comparing the waveform diagram of the audio to be detected with the control waveform diagram array, determining the target audio waveform diagram with noise in the waveform diagram of the audio to be detected, and replacing the target audio waveform diagram according to the control waveform diagram array to obtain the audio with noise removed. This method can conveniently and quickly optimize the audio effectively, remove the noise in the audio, and greatly reduce the cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The scope of the present disclosure can be better understood by reading the following detailed description of the exemplary embodiments in conjunction with the accompanying drawings. The accompanying drawings included are:
[0030] Figure 1 It shows a schematic flowchart of an audio noise cancellation method provided in Embodiment 1 of the present invention;
[0031] Figure 2 It shows a schematic flowchart of an audio noise cancellation method provided in Embodiment 2 of the present invention;
[0032] Figure 3 It shows a schematic flowchart of an audio noise cancellation method provided in Embodiment 3 of the present invention;
[0033] Figure 4 It shows a schematic diagram of the structure of a device provided in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] To make the objectives, technical solutions and advantages of the present invention clearer, the following will detail the implementation methods of the present invention in conjunction with the accompanying drawings and embodiments, so as to fully understand how the present invention uses technical means to solve technical problems and the implementation process of achieving technical effects and implement accordingly.
[0035] In the recording of existing audio, due to the complex on-site environment, there are many noises in the instrument sound part of the recorded audio. In the later processing, it is necessary to cut and re-record the instrument sound part, which greatly wastes a lot of manpower and material resources and has a great impact on the audio coherence.
[0036] In view of this, the present invention provides an audio noise cancellation method. By obtaining an array of reference waveform diagrams and the waveform diagram of the audio to be detected, comparing the waveform diagram of the audio to be detected with the array of reference waveform diagrams, determining the target audio waveform diagram with noise in the waveform diagram of the audio to be detected, and replacing the target audio waveform diagram according to the array of reference waveform diagrams, an audio with noise removed is obtained. This method can conveniently and quickly optimize the audio effectively, remove the noise in the audio, and greatly reduce the cost.
[0037] Example 1
[0038] See Figure 1 as shown in Figure 1 FIG. shows a schematic flow chart of an audio noise cancellation method provided by an embodiment of the present invention, which includes:
[0039] Step S101: Obtain an array of reference waveform diagrams and the waveform diagram of the audio to be detected;
[0040] Step S102: Compare the waveform diagram of the audio to be detected with the array of reference waveform diagrams to determine the target audio waveform diagram with noise in the waveform diagram of the audio to be detected;
[0041] Step S103: Replace the target audio waveform diagram according to the array of reference waveform diagrams to obtain an audio with noise removed.
[0042] In some embodiments, the array of reference waveform diagrams can be obtained by superimposing the background audio waveform diagram at the scene where the audio to be detected is located and the array of note standard waveform diagrams; in other embodiments, the array of reference waveform diagrams can also be obtained from the array of note standard waveform diagrams. Among them, the array of reference waveform diagrams can include unit reference waveform diagrams corresponding one by one to the notes.
[0043] In some embodiments, multiple groups of the array of reference waveform diagrams can also be set, and different arrays of reference waveform diagrams can correspond to different audio types. As an example, the audio type can correspond to the type of musical instrument that produces the audio.
[0044] In some embodiments, obtaining the array of reference waveform diagrams in step S101 can be to determine the corresponding array of reference waveform diagrams according to the audio type of the audio to be detected; obtaining the waveform diagram of the audio to be detected in step S101 can be to obtain the audio to be detected and convert the audio to be detected into its corresponding waveform diagram to obtain the waveform diagram of the audio to be detected.
[0045] In some embodiments, step S102 may specifically be to compare the waveform diagram of the audio to be detected with the unit reference waveform diagrams in the reference waveform diagram array respectively. When the difference between the waveform diagram of the audio to be detected and the unit reference waveform diagram belongs to a preset range, the target audio waveform diagram with noise in the waveform diagram of the audio to be detected is determined.
[0046] In some embodiments, step S103 may specifically be to replace the target audio waveform diagram according to the unit reference waveform diagram corresponding to the target audio waveform diagram in the reference waveform diagram array. Among them, the unit reference waveform diagram corresponding to the target audio waveform is the unit reference waveform diagram whose difference from the target audio waveform diagram is within the preset range.
[0047] In some embodiments, the target audio waveform diagram may further include a waveform start time and an end time. When replacing the target audio waveform diagram with the unit reference waveform diagram, the unit waveform diagram and the waveform diagrams adjacent to it before the start time and after the end time may also be spliced and smoothed to obtain the audio with noise removed and further improve the quality of the replaced audio.
[0048] The above is a method for eliminating audio noise provided by an embodiment of the present invention. By obtaining the reference waveform diagram array and the waveform diagram of the audio to be detected, comparing the waveform diagram of the audio to be detected with the reference waveform diagram array, determining the target audio waveform diagram with noise in the waveform diagram of the audio to be detected, and replacing the target audio waveform diagram according to the reference waveform diagram array, the audio with noise removed is obtained. This method can conveniently and quickly optimize the audio effectively, remove the noise in the audio, and greatly reduce the cost.
[0049] Example 2
[0050] See Figure 2 as shown in Figure 2 FIG. shows a flowchart of a method for eliminating audio noise provided by Embodiment 2 of the present invention, which may include:
[0051] Step S201: Obtain the background audio waveform diagram of the site where the audio to be detected is located;
[0052] Step S202: Obtain a musical note standard waveform diagram array, where the musical note standard waveform diagram array includes a plurality of unit standard waveform diagrams, and the unit standard waveform diagrams correspond to musical notes one by one;
[0053] Step S203: Sort the unit standard waveform diagrams according to the usage frequency of the musical notes;
[0054] Step S204: Superimpose the background audio waveform diagram and the musical note standard waveform diagram array to obtain a reference waveform diagram array, where the reference waveform diagram array includes a plurality of unit reference waveform diagrams, and the unit reference waveform diagrams correspond to musical notes one by one;
[0055] Step S205: Obtain the waveform diagram of the audio to be detected;
[0056] Step S206: Divide the waveform diagram of the audio to be detected into multiple unit wave objects based on the period of the unit standard waveform diagram;
[0057] Step S207: Compare each unit wave object with the array of reference waveform diagrams respectively;
[0058] Step S208: When the difference between the unit wave object and the unit reference waveform diagram in the array of reference waveform diagrams belongs to a preset range, determine the unit wave object as the target audio waveform diagram;
[0059] Step S209: Replace the target audio waveform diagram with the unit reference waveform diagram corresponding to the target audio waveform diagram to obtain the audio with noise removed.
[0060] In some embodiments, multiple groups of arrays of reference waveform diagrams can also be set, and different arrays of reference waveform diagrams can correspond to different audio types. As an example, the audio type can correspond to the type of musical instrument that generates the audio.
[0061] In some embodiments, the array of reference waveform diagrams can be obtained by superimposing multiple unit standard waveform diagrams sorted based on the usage frequency and the background audio waveform diagram. In some embodiments, multiple unit standard waveform diagrams can be sorted from high to low based on the frequency, so as to obtain multiple unit reference waveform diagrams sorted from high to low based on the frequency. Based on this, in step S207, each unit wave object is compared with the sorted unit reference waveform diagrams in turn, so that the target audio waveform diagram can be determined more quickly. It should be noted that in other embodiments, the unit standard waveform diagrams may not be sorted based on the usage frequency.
[0062] In the embodiments of the present invention, when the difference between the unit wave object and the unit reference waveform diagram in the array of reference waveform diagrams exceeds the preset range, the unit wave object will not be replaced.
[0063] In some embodiments, step S209 can perform fade-in and fade-out processing, and replace the target audio waveform diagram with the unit reference waveform diagram corresponding to the target audio waveform diagram.
[0064] In some embodiments, the target audio waveform diagram may further include a waveform start time and an end time. When replacing the target audio waveform diagram with the unit reference waveform diagram, the unit waveform diagram and the waveform diagrams adjacent to it before the start time and after the end time can also be spliced and smoothed. As an example, the smoothing process can be to calculate the average value of the adjacent waveforms at the splicing position to obtain the audio with noise removed and further improve the quality of the replaced audio.
[0065] The above is an audio noise cancellation method provided by the second embodiment of the present invention. By superimposing the background audio waveform diagram and the array of standard waveform diagrams of notes, an array of comparison waveform diagrams is obtained; based on the period of the unit standard waveform diagram in the standard waveform diagram of notes, the waveform diagram of the audio to be detected is divided into multiple unit wave objects, and each unit wave object is respectively compared with the array of comparison waveform diagrams. When the difference between the unit wave object and the unit comparison waveform diagram in the array of comparison waveform diagrams belongs to a preset range, the target audio waveform diagram is determined; the target audio waveform diagram is replaced with the unit comparison waveform diagram corresponding to the target audio waveform diagram, so as to obtain the audio with noise removed. This method can conveniently and quickly optimize the audio effectively, remove the noise in the audio, and greatly reduce the cost. In addition, multiple unit standard waveform diagrams can be sorted based on the usage frequency of the notes, and then multiple unit comparison waveform diagrams sorted based on the usage frequency are obtained, which is beneficial to more quickly determining the target audio waveform diagram and further improving the efficiency of audio optimization.
[0066] Example 3
[0067] See Figure 3 as shown in Figure 3 which shows a schematic flowchart of an audio noise cancellation method provided by the third embodiment of the present invention, which may include:
[0068] Step S301: Obtain an array of standard waveform diagrams of notes, and use the array of standard waveform diagrams of notes as the array of comparison waveform diagrams. The array of standard waveform diagrams of notes includes multiple unit standard waveform diagrams, and the unit standard waveform diagram serves as the unit comparison waveform diagram, and the unit standard waveform diagram corresponds to the note one by one;
[0069] Step S302: Obtain the background audio and the initial audio at the scene where the audio to be detected is located;
[0070] Step S303: Remove the background sound from the initial audio based on the background audio, and use the initial audio with the background sound removed as the audio to be detected;
[0071] Step S304: Obtain the waveform diagram of the audio to be detected;
[0072] Step S305: Divide the waveform diagram of the audio to be detected into multiple unit wave objects based on the period of the unit standard waveform diagram;
[0073] Step S306: Compare each unit wave object with the array of comparison waveform diagrams respectively;
[0074] Step S307: When the difference between the unit wave object and the unit comparison waveform diagram in the array of comparison waveform diagrams belongs to a preset range, determine the unit wave object as the target audio waveform diagram;
[0075] Step S308: Replace the target audio waveform diagram with the unit comparison waveform diagram corresponding to the target audio waveform diagram to obtain the audio with noise removed.
[0076] In some embodiments, there can be multiple groups of note standard waveform diagrams. Different groups of note standard waveform diagrams correspond to different audio types. Correspondingly, multiple groups of comparison waveform diagram arrays can also be obtained, and different comparison waveform diagram arrays can correspond to different audio types. As an example, the audio type can correspond to the type of musical instrument that produces the audio.
[0077] In some embodiments, step S301 can specifically be to obtain the note standard waveform diagram array corresponding to the audio type of the audio to be detected.
[0078] In some embodiments, step S303 can specifically be to smooth the background audio, remove the background sound in the initial audio based on the smoothed background audio, and use the initial audio with the background sound removed as the audio to be detected.
[0079] In some embodiments, the comparison waveform diagram array can be multiple unit standard waveform diagrams sorted based on the usage frequency. In some embodiments, multiple unit standard waveform diagrams can be sorted from high to low according to the frequency, so as to obtain multiple unit comparison waveform diagrams sorted from high to low in frequency. Based on this, in step S306, each unit wave object is sequentially compared with the sorted unit comparison waveform diagrams, so that the target audio waveform diagram can be determined more quickly. In other embodiments, the unit standard waveform diagrams may not be sorted based on the usage frequency.
[0080] In the embodiments of the present invention, when the difference between the unit wave object and the unit comparison waveform diagram in the comparison waveform diagram array exceeds the preset range, the unit wave object will not be replaced.
[0081] In some embodiments, step S308 can perform fade-in and fade-out processing, and replace the target audio waveform diagram with the unit comparison waveform diagram corresponding to the target audio waveform diagram.
[0082] In some embodiments, the target audio waveform diagram can further include a waveform start time and an end time. When replacing the target audio waveform diagram with the unit comparison waveform diagram, the unit waveform diagram and the waveform diagrams adjacent to the start time and after the end time can also be spliced and smoothed. As an example, the smoothing process can be to calculate the average value of the adjacent waveforms at the splicing position to obtain the audio with noise removed and further improve the quality of the replaced audio.
[0083] The above is an audio noise cancellation method provided by the third embodiment of the present invention. By obtaining the array of standard waveform diagrams of musical notes, the array of reference waveform diagrams is obtained; the background audio and the initial audio at the scene where the audio to be detected is located are obtained; the background sound in the initial audio is removed based on the background audio, and the initial audio with the background sound removed is used as the audio to be detected; the waveform diagram of the audio to be detected is obtained; based on the period of the unit standard waveform diagram in the standard waveform diagram of musical notes, the waveform diagram of the audio to be detected is divided into multiple unit wave objects, and each unit wave object is respectively compared with the array of reference waveform diagrams. When the difference between the unit wave object and the unit reference waveform diagram in the array of reference waveform diagrams belongs to a preset range, the target audio waveform diagram is determined; the target audio waveform diagram is replaced with the unit reference waveform diagram corresponding to the target audio waveform diagram, so as to obtain the audio with noise eliminated. This method can conveniently and quickly optimize the audio effectively, remove the noise in the audio, and greatly reduce the cost. In addition, the multiple unit standard waveform diagrams can be sorted based on the usage frequency of the musical notes, and then the multiple unit reference waveform diagrams sorted based on the usage frequency are obtained, which is beneficial to more quickly determining the target audio waveform diagram and further improving the efficiency of audio optimization.
[0084] On the other hand, the present invention also provides a storage medium in which a computer program is stored. When the computer program is executed by a processor, it can implement the audio noise cancellation method described in any one of the above embodiments 1 to 3.
[0085] The processes, functions, methods, and / or software described above can be recorded, stored, or fixed in one or more computer-readable storage media. The computer-readable storage media include program instructions, and the program instructions will be implemented by a computer so that the processor executes the program instructions. The storage medium may also separately include program instructions, data files, data structures, etc., or include a combination thereof. The storage medium or program instructions can be specifically designed and understood by those skilled in the computer software field, or the storage medium or instructions may be well-known and available to those skilled in the computer software field. Examples of computer-readable media include: magnetic media, such as hard disks, floppy disks, and magnetic tapes; optical media, such as CD-ROM discs and DVDs; magneto-optical media, such as optical discs; and hardware devices specifically configured to store and execute program instructions, such as read-only memory (ROM), random access memory (RAM), flash memory, etc. Examples of program instructions include machine code (e.g., code generated by a compiler) and files containing high-level code, and the high-level code can be executed by a computer by using an interpreter. The hardware devices described above can be configured to act as one or more software modules to execute the operations and methods described above, and vice versa. In addition, the computer-readable storage media can be distributed in a networked computer system and can store and execute computer-readable code or program instructions in a decentralized manner.
[0086] Another aspect of the present invention provides a device, as shown in Figure 4 shown Figure 4 FIG. shows a schematic structural diagram of a device provided by an embodiment of the present invention, which includes a memory 41 and a processor 42. A computer program is stored in the memory 41. When the computer program is executed by the processor 42, it can implement the audio noise cancellation method described in any one of Embodiments 1 to 3 above.
[0087] It should be noted that the device may include one or more processors 42 and a memory 41. The processor 42 and the memory 41 may be connected by a bus or other means. As a non-volatile computer-readable storage medium, the memory 41 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. By running the non-volatile software programs, instructions, and modules stored in the memory 41, the processor 42 executes various functional applications and data processing of the device, that is, implements the face image recognition method described above.
[0088] Although the embodiments disclosed in the present invention are as above, the content described is only an embodiment adopted for easy understanding of the present invention and is not intended to limit the present invention. Any person skilled in the art within the technical field to which the present invention pertains can make any modifications and changes in the form of implementation and details without departing from the spirit and scope disclosed by the present invention. However, the protection scope of the present invention shall still be subject to the scope defined by the appended claims.
Claims
1. An audio noise cancellation method, characterized in that, Including: Obtain an array of reference waveform diagrams and the waveform diagram of the audio to be detected; Compare the waveform diagram of the audio to be detected with the array of reference waveform diagrams to determine the target audio waveform diagram with noise in the waveform diagram of the audio to be detected; Replace the target audio waveform diagram according to the array of reference waveform diagrams to obtain audio with noise removed, wherein, the obtaining of the array of reference waveform diagrams includes: Obtain the background audio waveform diagram at the scene where the audio to be detected is located; Obtain an array of standard note waveform diagrams, the array of standard note waveform diagrams includes multiple unit standard waveform diagrams, and the unit standard waveform diagrams correspond to notes one by one; Superimpose the background audio waveform diagram and the array of standard note waveform diagrams to obtain the array of reference waveform diagrams, the array of reference waveform diagrams includes multiple unit reference waveform diagrams, and the unit reference waveform diagrams correspond to the notes one by one; After obtaining the array of standard note waveform diagrams, the method further includes: sorting the unit standard waveform diagrams according to the usage frequency of the notes, and the array of reference waveform diagrams is obtained by superimposing the sorted multiple unit standard waveform diagrams and the background audio waveform diagram based on the usage frequency.
2. The method according to claim 1, characterized in that Before obtaining the waveform diagram of the audio to be detected, it further includes: Obtain the background audio and the initial audio at the scene where the audio to be detected is located; Remove the background sound from the initial audio based on the background audio, and use the initial audio with the background sound removed as the audio to be detected.
3. The method according to claim 1 or 2, characterized in that, Comparing the waveform diagram of the audio to be detected with the array of reference waveform diagrams to determine the target audio waveform diagram with noise in the waveform diagram of the audio to be detected includes: Divide the waveform diagram of the audio to be detected into multiple unit wave objects based on the period of the unit standard waveform diagram; Compare each unit wave object with the array of reference waveform diagrams respectively; When the difference between the unit wave object and the unit reference waveform diagram in the array of reference waveform diagrams belongs to a preset range, determine that the unit wave object is the target audio waveform diagram.
4. The method according to claim 1 or 2, characterized in that, Replacing the target audio waveform diagram according to the array of reference waveform diagrams to obtain audio with noise removed includes: Replace the target audio waveform diagram with the corresponding unit reference waveform diagram of the target audio waveform diagram to obtain audio with noise removed.
5. The method according to claim 1, wherein Multiple groups of the array of reference waveform diagrams are set, and different arrays of reference waveform diagrams correspond to different audio types.
6. A storage medium, characterized in that, A computer program is stored in the storage medium, and when the computer program is executed by a processor, it implements the audio noise cancellation method according to any one of claims 1 to 5.
7. A device, characterized in that, Including a memory and a processor, a computer program is stored in the memory, and when the computer program is executed by the processor, it implements the audio noise cancellation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Audio processing method and device
CN105788610A
Audio adjustment method and device, and computer readable storage medium
CN111370024A