Noise reduction method for audio data

By intelligently identifying the environment type and generating reverse sound wave data, combined with prompt audio data, the problem of headphone noise reduction function filtering traffic warning sounds in outdoor environments is solved, and the effect of improving traffic safety is achieved based on high-quality audio experience.

CN119653287AInactive Publication Date: 2025-03-18SHENZHEN JIANGMENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411571248.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-03-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The noise reduction function of the headphones may filter out traffic warning sounds in outdoor environments, such as the sound of the vehicle's whistle, which will prevent users from paying attention to potential dangers in time and increase the risk of traffic accidents.

Method used

By obtaining location data, intelligently identify the type of environment the user is in, including indoor and outdoor environments. If the whistle audio data is detected outdoors, reverse sound wave data is generated opposite to the noise data phase, and the initial audio data, reverse sound wave data and pre-stored prompt audio data are combined to generate target audio data and sent to the headphone device to provide noise reduction and traffic prompts.

Benefits of technology

While ensuring that users enjoy high-quality audio experience, they automatically identify and process traffic warning sounds, improve users' alertness to the surrounding environment, thereby significantly improving traffic safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653287A_ABST
    Figure CN119653287A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of sound processing, and provides a noise reduction method for audio data, and the method comprises the steps: obtaining initial audio data, noise data and positioning data; determining the environment type of the user according to the positioning data; if the user is in the outdoor environment and whistling audio data exist in the noise data, generating reverse sound wave data corresponding to the noise data; obtaining pre-stored prompt audio data, and combining the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; and sending the first target audio data to the earphone equipment. A user can enjoy clear and clean audios in different environments and keep alertness to the surrounding traffic environment at the same time, so that the risk of accidents is reduced. In conclusion, the invention not only provides a high-quality audio noise reduction effect, but also effectively improves the traffic safety of the user through the intelligent prompt function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of sound processing, and in particular relates to a method for reducing noise of audio data. Background Art

[0002] With the continuous advancement of headphone technology, active noise reduction (ANC) technology has been widely used in various headphone devices. This technology captures environmental noise and generates sound waves with opposite phases to cancel the noise, thereby providing users with a quieter listening environment. However, this noise reduction technology may bring safety risks in certain situations, especially when users are in traffic environments.

[0003] In outdoor environments, especially when walking, cycling or driving, users' perception of the surrounding sounds is very important. Traffic warning sounds, such as vehicle horns, are important signals to ensure the safety of pedestrians and cyclists. If the noise reduction function of the headphones filters out these warning sounds, users may not notice potential dangers in time, which may lead to traffic accidents.

[0004] At present, although some headphone manufacturers have realized this problem and tried to solve it by adding a transparent mode for ambient sound, this method is usually switched manually and the user needs to actively operate to turn it on, so it cannot completely solve the problem in actual use, especially when the user needs to focus on other activities.

[0005] Therefore, there is an urgent need for an intelligent noise reduction method that can automatically identify and process traffic warning sounds while ensuring that users enjoy a high-quality audio experience, prompting users to pay attention to the environment, thereby improving traffic safety. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a method for reducing noise of audio data to solve the technical problem that the noise reduction function of the earphone filters out the warning sound.

[0007] A first aspect of an embodiment of the present invention provides a method for reducing noise of audio data, the method for reducing noise of audio data comprising:

[0008] The method for reducing noise of audio data is applied to an audio system, the audio system includes a headphone device and a mobile terminal, and the method for reducing noise of audio data includes:

[0009] Obtaining initial audio data, noise data and positioning data;

[0010] Determine the type of environment in which the user is located according to the positioning data; the type of environment includes indoor environment and outdoor environment, and the outdoor environment includes walking environment, cycling environment and driving environment;

[0011] If the environment is outdoor and there is whistle audio data in the noise data, then reverse sound wave data corresponding to the noise data is generated; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data;

[0012] Acquire pre-stored prompt audio data, combine the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment;

[0013] The first target audio data is sent to the headphone device.

[0014] Further, after the step of determining the type of environment in which the user is located according to the positioning data, the method further includes:

[0015] If it is in an indoor environment, generating reverse sound wave data corresponding to the noise data;

[0016] Combining the initial audio data with the reverse sound wave data to obtain second target audio data;

[0017] The second target audio data is sent to the headphone device.

[0018] Furthermore, the step of determining the type of environment in which the user is located according to the positioning data includes:

[0019] If the positioning data is in a non-road area and the moving distance per unit time is less than a first threshold, it is determined that the environment type where the user is located is an indoor environment;

[0020] If the positioning data is in a non-road area and the moving distance within a unit time is not less than a first threshold, it is determined that the environment type where the user is located is a walking environment;

[0021] If the positioning data is in a road area and the moving distance per unit time is between a first threshold and a second threshold, it is determined that the environment type in which the user is located is a cycling environment;

[0022] If the positioning data is in a road area and the moving distance per unit time is greater than a second threshold, it is determined that the environment type in which the user is located is a driving environment.

[0023] Furthermore, if the environment is outdoor and there is whistle audio data in the noise data, the step of generating reverse sound wave data corresponding to the noise data includes:

[0024] If in an outdoor environment, identifying energy spike points in the noise data;

[0025] Taking the energy sudden increase point as the center, extracting an audio segment of a fixed length from the noise data;

[0026] Calculating audio features of the audio clip; the audio features include main frequency, spectral feature points of multiple frequency bands, spectral bandwidth and spectral flatness;

[0027] Based on the audio features, construct an audio feature vector;

[0028] Obtain multiple preset whistle audio standard vectors;

[0029] Calculating the distance between the audio feature vector and the whistle audio standard vector;

[0030] If the minimum distance is less than a preset value, it is determined that there is whistle audio data in the noise data;

[0031] Generate reverse sound wave data corresponding to the noise data.

[0032] Furthermore, the step of obtaining a plurality of preset whistle audio standard vectors includes:

[0033] Matching a plurality of preset whistle vectors corresponding to the environment type;

[0034] The multiple preset whistle vectors are used as the whistle audio standard vectors.

[0035] Furthermore, if the environment is outdoor, the step of identifying the energy surge point in the noise data includes:

[0036] Extracting the median energy in the noise data;

[0037] The data points that exceed twice the median energy are regarded as the energy surge points.

[0038] Furthermore, the step of calculating the audio features of the audio clip includes:

[0039] Performing a fast Fourier transform on the audio clip to obtain a frequency spectrum in a complex form;

[0040] The frequency corresponding to the maximum value in the modulus of the spectrum is taken as the main frequency;

[0041] Calculating the spectrum flatness by using a geometric mean and an arithmetic mean;

[0042] Based on the complex spectrum, spectrum feature points of multiple frequency bands are calculated.

[0043] Furthermore, the step of calculating the spectrum feature points of multiple frequency bands based on the complex spectrum includes:

[0044] Dividing the complex spectrum into multiple frequency bands to obtain complex spectrum corresponding to each of the multiple frequency bands;

[0045] Substituting the complex spectra corresponding to the multiple frequency bands into the following function to obtain the frequency spectrum feature points of the multiple frequency bands;

[0046]

[0047] Among them, SC multi Indicates the spectrum feature points of multiple frequency bands, [f1, f2] indicates the first frequency band range, [f3, f4] indicates the second frequency band range, f1, f2, f3 and f4 indicate the end points of the frequency bands, N indicates the length of the frequency band, F s represents the sampling frequency, |X[k]| represents the complex spectrum, FFT(x[n]) represents the spectrum obtained after the sub-audio segment is subjected to the fast Fourier transform, |FFT(x[n])| represents the complex spectrum, x[n] represents the sub-audio segment, k represents the frequency index, Re(FFT(x[n])) represents the real part of FFT(x[n]), and Im(FFT(x[n])) represents the imaginary part of FFT(x[n]).

[0048] A second aspect of an embodiment of the present invention provides a device for reducing noise of audio data, including:

[0049] An acquisition unit, used for acquiring initial audio data, noise data and positioning data;

[0050] A determination unit, configured to determine the type of environment in which the user is located according to the positioning data; the type of environment includes an indoor environment and an outdoor environment, and the outdoor environment includes a walking environment, a cycling environment, and a driving environment;

[0051] A generating unit, for generating reverse sound wave data corresponding to the noise data if the environment is outdoor and there is whistle audio data in the noise data; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data;

[0052] A combining unit is used to obtain pre-stored prompt audio data, and combine the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment;

[0053] A sending unit is used to send the first target audio data to the headphone device.

[0054] A third aspect of an embodiment of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the audio data noise reduction method described in the first aspect when executing the computer program.

[0055] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for denoising audio data described in the first aspect are implemented.

[0056] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: by acquiring positioning data, the system can accurately identify the type of environment in which the user is currently located, including indoor environment and outdoor environment (walking environment, cycling environment and driving environment). This intelligent environment perception capability enables the system to dynamically adjust the audio processing strategy according to different environmental requirements to ensure that users can get the best audio experience and safety tips in different scenarios. When it is detected that the user is in an outdoor environment, the system will further analyze the noise data, especially identify the traffic warning sound (such as the sound of a whistle). Once the whistle audio data is detected, the system generates reverse sound wave data with a phase opposite to the noise data, effectively offsetting the noise, thereby greatly reducing the interference of traffic noise on the user's auditory experience. In addition to the noise reduction processing, the system also obtains the pre-stored prompt audio data, combines it with the initial audio data and the reverse sound wave data, and generates the first target audio data. The prompt audio data is used to remind the user to pay attention to the surrounding traffic environment, ensuring that the user is always alert to the surrounding environment while enjoying high-quality audio, thereby improving traffic safety. The processed first target audio data is sent to the headphone device, and the user can seamlessly receive a clear and high-quality audio stream while obtaining the necessary traffic safety tips. The whole process is smooth and natural, and will not interrupt the user's audio experience. The present invention significantly improves the user's audio experience and traffic safety by combining efficient noise reduction technology with intelligent prompt function. Users can enjoy clear and clean audio in different environments, while remaining alert to the surrounding traffic environment and reducing the risk of accidents. In summary, the present invention not only provides high-quality audio noise reduction effects, but also effectively improves the user's traffic safety through the intelligent prompt function. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0058] Figure 1 A schematic flow chart of a method for reducing noise of audio data provided by the present invention is shown;

[0059] Figure 2 A schematic diagram of a noise reduction device for audio data provided by an embodiment of the present invention is shown;

[0060] Figure 3 A schematic diagram of a terminal device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0061] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0062] The embodiment of the present invention provides a method for reducing noise of audio data to solve the technical problem that the noise reduction function of the earphone filters out the warning sound.

[0063] First, the present invention provides a method for reducing the noise of audio data. The method for reducing the noise of audio data is applied to an audio system. The audio system includes a headphone device and a mobile terminal. Since the computing power of the headphone device is relatively limited, it is necessary to process the original audio data and noise data through the mobile terminal, and then send the processed target audio data to the headphone device for playback to achieve noise reduction and prompting effects.

[0064] See also Figure 1 , Figure 1 FIG. 4 is a schematic flow chart of a method for reducing noise of audio data provided by the present invention. Figure 1 As shown, the method for reducing noise of audio data may include the following steps:

[0065] Step 101: Acquire initial audio data, noise data and positioning data;

[0066] Initial audio data refers to the audio data that the user is currently listening to (such as music or podcasts). Noise data refers to environmental audio data, which is collected by the headset microphone or mobile terminal microphone. Positioning data is obtained by GPS in the mobile terminal and other means to determine the user's geographic location and mobility status.

[0067] Step 102: determining the type of environment in which the user is located according to the positioning data; the type of environment includes indoor environment and outdoor environment, and the outdoor environment includes walking environment, cycling environment and driving environment;

[0068] The acquired positioning data is used to analyze and determine the user's current environment type. If the user is outdoors, the system will further subdivide the user's specific activity status, such as walking, cycling, or driving. This information is very important for subsequent processing of audio data and generating prompt sounds, because different environments and activity states have different requirements for noise processing and safety prompts. Among them, the specific logic for determining the type of environment the user is in is as follows:

[0069] Specifically, step 102 specifically includes steps 1021 to 1024:

[0070] Step 1021: If the positioning data is in a non-road area and the moving distance per unit time is less than a first threshold, it is determined that the environment type where the user is located is an indoor environment;

[0071] The system first checks the user's location data to determine whether the user is in a non-road area (such as a building or a park). If the user is in these non-road areas and the user's movement distance per unit time (such as one minute) is less than a predetermined first threshold (such as within a few meters), the system will consider the user's activity range to be very limited, usually because the user is in an indoor environment (such as a room or a building).

[0072] Step 1022: If the positioning data is in a non-road area and the moving distance within a unit time is not less than a first threshold, it is determined that the environment type where the user is located is a walking environment;

[0073] Also in the non-road area, if the user's moving distance per unit time exceeds the first threshold, the system will determine that the user is walking in the non-road area. This may mean that the user is walking in a park, a community, or walking in a building. In this case, the moving distance is relatively long but still in the non-road area, so it is considered a walking environment.

[0074] Step 1023: If the positioning data is in a road area, and the moving distance per unit time is between a first threshold and a second threshold, determining that the environment type in which the user is located is a cycling environment;

[0075] When the positioning data shows that the user is in a road area (such as a street or road), if the user's moving distance per unit time is between the first threshold and the second threshold (for example, a few hundred meters to a few kilometers), the system will determine that the user may be riding a bicycle. Because the speed of riding a bicycle is usually between walking and driving, the moving distance can be used to infer that the user's mode of transportation is riding a bicycle.

[0076] Step 1024: If the positioning data is in a road area and the moving distance per unit time is greater than a second threshold, it is determined that the environment type in which the user is located is a driving environment.

[0077] If the user is in a road area and the moving distance per unit time exceeds the second threshold (e.g., several kilometers), the system will determine that the user is driving a vehicle. This is because on the road, only driving can achieve such a high moving distance. Therefore, the system recognizes this situation as a driving environment.

[0078] As an optional embodiment of the present invention, since it is in an indoor environment, there is no need to process the whistle noise, so after step 102, it also includes: if it is in an indoor environment, generating reverse sound wave data corresponding to the noise data; combining the initial audio data and the reverse sound wave data to obtain second target audio data; sending the second target audio data to the headphone device.

[0079] Step 103: If the environment is outdoor and there is whistle audio data in the noise data, then generate reverse sound wave data corresponding to the noise data; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data;

[0080] If the system detects that the user is in an outdoor environment and identifies traffic warning sounds (such as car horns) from the noise data, the system will generate sound wave data with the opposite phase to the noise. This reverse sound wave data can reduce or eliminate the original noise through phase cancellation technology, thereby reducing its interference to the user.

[0081] The recognition logic for the whistle audio data is as follows:

[0082] Specifically, step 103 specifically includes steps 1031 to 1038:

[0083] Step 1031: If the environment is outdoor, identifying energy spike points in the noise data;

[0084] After confirming that the user is in an outdoor environment, the system analyzes the noise data to look for energy spikes, which are moments when the energy in the noise data rises significantly, usually caused by sudden noises such as car horns.

[0085] Specifically, step 1031 specifically includes: extracting the energy median in the noise data, and taking data points that are more than twice the energy median as energy spike points.

[0086] Step 1032: extracting an audio segment of a fixed length from the noise data with the energy sudden increase point as the center;

[0087] Once the energy spike is identified, the system extracts a fixed-length audio segment from the noise data centered on the spike, which includes the possible whistle sound and the background noise before and after it.

[0088] Step 1033: Calculate the audio features of the audio clip; the audio features include a main frequency, spectral feature points of multiple frequency bands, spectral bandwidth, and spectral flatness;

[0089] Audio features include but are not limited to main frequency, spectral feature points of multiple frequency bands, spectral bandwidth and spectral flatness. The calculation process of audio features is as follows:

[0090] Specifically, step 1033 specifically includes steps A1 to A4:

[0091] Step A1: performing fast Fourier transform on the audio clip to obtain a complex frequency spectrum;

[0092] Fast Fourier Transform (FFT) is an efficient algorithm for converting time domain signals into frequency domain signals. An audio clip is represented as a waveform that changes over time in the time domain, which can be converted into a spectrum in the frequency domain through FFT. The spectrum is in the form of complex numbers, and each complex number contains the amplitude (modulus) and phase information of the frequency component.

[0093] Step A2: taking the frequency corresponding to the maximum value in the modulus of the spectrum as the main frequency;

[0094] In the resulting complex spectrum, each frequency component has an amplitude value (modulus). By finding the maximum of these amplitude values, the most significant frequency component in the audio clip, i.e., the dominant frequency, can be determined. This is because the dominant frequency is usually the dominant frequency component in the audio signal.

[0095] Step A3: Calculate the spectrum flatness by using the geometric mean and the arithmetic mean;

[0096] Spectral flatness is a measure used to describe the smoothness or complexity of a spectrum. The steps to calculate spectral flatness are as follows:

[0097] Geometric mean: First, the geometric mean of the spectrum amplitude is calculated, which reflects the overall level of the spectrum amplitude.

[0098] Arithmetic mean: The arithmetic mean of the spectrum amplitudes is then calculated, which reflects the average level of the spectrum amplitudes.

[0099] Spectral flatness: The ratio of the geometric mean to the arithmetic mean is taken as the spectrum flatness. The closer the spectrum flatness value is to 1, the flatter the spectrum is and the more uniform the frequency components are; the closer the value is to 0, the more one or several frequency components dominate the spectrum.

[0100] Step A4: Based on the complex spectrum, calculate the spectrum feature points of multiple frequency bands.

[0101] The spectral feature point refers to the center position of the energy distribution in the spectrum. By calculating the centroid of the spectrum in different frequency bands, the energy distribution of the spectrum in different frequency ranges can be captured. The entire spectrum is divided into multiple sub-bands, and each sub-band can be selected according to the specific application scenario and signal characteristics. Common selection methods include equal-width band division or Mel frequency scale division.

[0102] Specifically, step A4 includes the following steps:

[0103] Dividing the complex spectrum into multiple frequency bands to obtain complex spectrum corresponding to each of the multiple frequency bands;

[0104] Substituting the complex spectra corresponding to the multiple frequency bands into the following function to obtain the frequency spectrum feature points of the multiple frequency bands;

[0105]

[0106] Among them, SC multi Indicates the spectrum feature points of multiple frequency bands, [f1, f2] indicates the first frequency band range, [f3, f4] indicates the second frequency band range, f1, f2, f3 and f4 indicate the end points of the frequency bands, N indicates the length of the frequency band, F s represents the sampling frequency, |X[k]| represents the complex spectrum, FFT(x[n]) represents the spectrum obtained after the sub-audio segment is subjected to the fast Fourier transform, |FFT(x[n])| represents the complex spectrum, x[n] represents the sub-audio segment, k represents the frequency index, Re(FFT(x[n])) represents the real part of FFT(x[n]), and Im(FFT(x[n])) represents the imaginary part of FFT(x[n]).

[0107] In the above function, the spectral feature points of each sub-band are calculated independently. In this way, multiple feature values ​​can be obtained, each of which represents the center of frequency energy distribution in the band. The spectral feature points of all sub-bands are combined into a multidimensional vector. This vector can more comprehensively describe the spectral characteristics of the signal. Through multidimensional feature points, the energy concentration position of the audio signal in different frequency bands can be captured. Through multidimensional feature points, the characteristics of different sound sources in each frequency band can be identified to improve the classification effect.

[0108] Used to calculate the frequency value of the frequency component, Multiplying the complex spectrum is equivalent to calculating the contribution of each frequency component to the overall spectrum. Multiply it with its complex spectrum, and then sum all these products to get the weighted sum of frequency values. This weighted sum represents the overall distribution of frequency values ​​in the spectrum. Normalize the weighted sum of frequency values ​​to get an average value. This average value is the spectrum feature point. The spectrum feature point can effectively reflect the distribution of frequency components. If the high-frequency components are large and strong, the spectrum feature points will tend to high frequencies; if the low-frequency components are large and strong, the spectrum feature points will tend to low frequencies.

[0109] In this embodiment, a complex spectrum is obtained by performing a fast Fourier transform on the audio clip. Then, the frequency corresponding to the maximum value in the modulus of the spectrum is taken as the main frequency. This process can quickly and accurately determine the dominant frequency components of the audio clip, ensuring the reliability and accuracy of the audio features. The calculation of the spectrum flatness is achieved by the geometric mean and the arithmetic mean. This calculation method can effectively describe the smoothness of the spectrum and help distinguish different types of sound signals. High spectrum flatness usually corresponds to a more uniform spectrum distribution, while low spectrum flatness indicates that there are sharp peaks in the spectrum. This feature is of great significance for the classification and recognition of audio signals. Based on the complex spectrum, the spectrum feature points of multiple frequency bands are calculated. This process can capture the energy distribution characteristics of the audio signal in different frequency bands, providing rich feature information for subsequent audio analysis and processing. The calculation of multi-band feature points enables the system to comprehensively and meticulously analyze the spectrum characteristics of the audio clip, and improve the comprehensiveness and accuracy of audio feature extraction. The use of fast Fourier transform greatly improves the speed and efficiency of spectrum analysis. Fast Fourier transform can complete complex spectrum calculations in a short time, which is suitable for real-time audio processing scenarios. This advantage enables the technical solution to provide timely and accurate audio feature extraction in practical applications. In summary, the technical solution uses fast Fourier transform to perform spectrum analysis on audio clips, accurately extract the main frequency, spectrum flatness and multi-band spectrum feature points of the audio signal, and significantly improves the accuracy and efficiency of audio feature extraction.

[0110] Step 1034: constructing an audio feature vector based on the audio feature;

[0111] The audio features calculated above are combined according to the fixed element positions to form an audio feature vector. This is a multi-dimensional vector, where each dimension corresponds to an audio feature. The system can use this vector to characterize the characteristics of the audio clip.

[0112] Step 1035: Obtain a plurality of preset whistle audio standard vectors;

[0113] The whistle audio standard vector is a feature vector calculated based on the sample whistle data. The calculation method is the same as step 1034 and will not be repeated here.

[0114] Specifically, step 1035 specifically includes: matching multiple preset whistle vectors corresponding to the environment type, and using the multiple preset whistle vectors as the whistle audio standard vectors.

[0115] In order to improve the pertinence of the whistle audio standard vector to different environment types, this embodiment generates different whistle audio standard vectors for different environment types to adapt to the differences in whistle audio in different environment types.

[0116] It is understandable that there are certain differences in the proportion of non-motor vehicle horn sounds and motor vehicle horn sounds in different environment types, which leads to differences in horn audio. Therefore, it is necessary to pre-generate corresponding horn audio standard vectors for different environment types.

[0117] Step 1036: Calculate the distance between the audio feature vector and the whistle audio standard vector;

[0118] The feature vector of the extracted audio segment is compared with the preset whistle audio standard vector, and the distance between them is calculated (for example, using the Euclidean distance or other suitable measurement methods). This distance reflects the similarity between the audio segment and the standard whistle sound.

[0119] Step 1037: If the minimum distance is less than a preset value, determining that there is whistle audio data in the noise data;

[0120] If the minimum distance between the feature vector of an audio clip and a standard whistle audio vector is less than a preset threshold, the system will consider that there is a whistle in the audio clip. This preset value is an empirical value used to distinguish whistles from other noises.

[0121] Step 1038: Generate reverse sound wave data corresponding to the noise data.

[0122] The method for generating reverse acoustic wave data is a traditional technology and will not be described in detail here.

[0123] In this embodiment, the system first identifies the energy surge point in the noise data, extracts audio clips of fixed length based on this point, and calculates the audio features of these clips. This method ensures that the captured audio clip contains potential whistle sounds, thereby improving the accuracy of recognition. By calculating audio features (main frequency, spectral feature points, spectral bandwidth and spectral flatness) and constructing audio feature vectors, the system can fully describe the characteristics of the audio clip. This multi-dimensional feature analysis allows the system to distinguish different types of noise more accurately. The system compares the extracted audio feature vector with multiple preset whistle audio standard vectors, and by calculating the distance between them, it can quickly and accurately determine whether there is whistle audio data in the noise data. When the minimum distance between the audio feature vector and the whistle audio standard vector is less than a preset value, the system determines that there is whistle audio in the noise data. This distance calculation method effectively improves the accuracy of whistle audio recognition and reduces the possibility of misidentification. After identifying the whistle audio, the system generates corresponding reverse sound wave data. The reverse sound wave can offset or weaken the whistle sound in the noise, thereby significantly reducing environmental noise.

[0124] Step 104: obtaining pre-stored prompt audio data, combining the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment;

[0125] The system calls the pre-stored prompt audio data. Then, the initial audio data (the audio the user is listening to), the reverse sound wave data (for noise reduction), and the prompt audio data (for reminding the user to pay attention to traffic conditions) are mixed to generate a new audio data, namely the first target audio data. This audio data can not only retain the content the user is listening to, but also effectively reduce noise and remind the user to pay attention to the surrounding environment when necessary.

[0126] Step 105: Send the first target audio data to the headphone device.

[0127] The generated first target audio data will be sent to the user's headphone device. The user can continue to enjoy the original audio content through the headphones while obtaining noise reduction effects and necessary traffic reminders, thereby improving the user's traffic safety and hearing experience.

[0128] In this embodiment, by acquiring positioning data, the system can accurately identify the type of environment in which the user is currently located, including indoor environments and outdoor environments (walking environments, cycling environments, and driving environments). This intelligent environment perception capability enables the system to dynamically adjust the audio processing strategy according to different environmental requirements to ensure that users can get the best audio experience and safety tips in different scenarios. When it is detected that the user is in an outdoor environment, the system will further analyze the noise data, especially identify traffic warning sounds (such as whistles). Once the whistle audio data is detected, the system generates reverse sound wave data with a phase opposite to the noise data, effectively offsetting the noise, thereby greatly reducing the interference of traffic noise on the user's auditory experience. In addition to noise reduction processing, the system also obtains pre-stored prompt audio data, combines it with the initial audio data and reverse sound wave data, and generates the first target audio data. The prompt audio data is used to remind the user to pay attention to the surrounding traffic environment, ensuring that the user is always alert to the surrounding environment while enjoying high-quality audio, thereby improving traffic safety. The processed first target audio data is sent to the headphone device, and the user can seamlessly receive a clear and high-quality audio stream while obtaining necessary traffic safety tips. The whole process is smooth and natural, and will not interrupt the user's audio experience. The present invention significantly improves the user's audio experience and traffic safety by combining efficient noise reduction technology with intelligent prompt function. Users can enjoy clear and clean audio in different environments, while remaining alert to the surrounding traffic environment and reducing the risk of accidents. In summary, the present invention not only provides high-quality audio noise reduction effects, but also effectively improves the user's traffic safety through the intelligent prompt function.

[0129] like Figure 2 The present invention provides a noise reduction device for audio data, see Figure 2 , Figure 2 A schematic diagram of a noise reduction device for audio data provided by the present invention is shown. Figure 2 The noise reduction device of an audio data shown comprises:

[0130] An acquisition unit 21, used to acquire initial audio data, noise data and positioning data;

[0131] A determination unit 22, configured to determine the type of environment in which the user is located according to the positioning data; the type of environment includes an indoor environment and an outdoor environment, and the outdoor environment includes a walking environment, a cycling environment, and a driving environment;

[0132] A generating unit 23 is used to generate reverse sound wave data corresponding to the noise data if the environment is outdoor and there is whistle audio data in the noise data; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data;

[0133] The combining unit 24 is used to obtain pre-stored prompt audio data, and combine the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment;

[0134] The sending unit 25 is configured to send the first target audio data to the headphone device.

[0135] The present invention provides a noise reduction device for audio data. By acquiring positioning data, the system can accurately identify the type of environment in which the user is currently located, including indoor environment and outdoor environment (walking environment, cycling environment and driving environment). This intelligent environment perception capability enables the system to dynamically adjust the audio processing strategy according to different environmental requirements to ensure that the user can get the best audio experience and safety prompts in different scenarios. When the user is detected in an outdoor environment, the system will further analyze the noise data, especially identify the traffic warning sound (such as a whistle sound). Once the whistle audio data is detected, the system generates reverse sound wave data with a phase opposite to the noise data, effectively offsetting the noise, thereby greatly reducing the interference of traffic noise on the user's auditory experience. In addition to the noise reduction processing, the system also obtains the pre-stored prompt audio data, combines it with the initial audio data and the reverse sound wave data, and generates the first target audio data. The prompt audio data is used to remind the user to pay attention to the surrounding traffic environment, ensuring that the user is always alert to the surrounding environment while enjoying high-quality audio, thereby improving traffic safety. The processed first target audio data is sent to the headphone device, and the user can seamlessly receive a clear and high-quality audio stream while obtaining the necessary traffic safety prompts. The whole process is smooth and natural, and will not interrupt the user's audio experience. The present invention significantly improves the user's audio experience and traffic safety by combining efficient noise reduction technology with intelligent prompt function. Users can enjoy clear and clean audio in different environments, while remaining alert to the surrounding traffic environment and reducing the risk of accidents. In summary, the present invention not only provides high-quality audio noise reduction effects, but also effectively improves the user's traffic safety through the intelligent prompt function.

[0136] Figure 3 Schematic diagram of a terminal device provided by an embodiment of the present invention. Figure 3 As shown, a terminal device 3 of this embodiment includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a noise reduction program for audio data. When the processor 30 executes the computer program 32, the steps in each of the above-mentioned embodiments of the noise reduction method for audio data are implemented, such as Figure 1Alternatively, when the processor 30 executes the computer program 32, the functions of each unit in the above-mentioned device embodiments are realized, for example, Figure 2 Function of the unit shown.

[0137] Exemplarily, the computer program 32 may be divided into one or more units, which are stored in the memory 31 and executed by the processor 30 to complete the present invention. The one or more units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 32 in the terminal device 3. For example, the computer program 32 may be divided into the following specific functions of each unit:

[0138] An acquisition unit, used for acquiring initial audio data, noise data and positioning data;

[0139] A determination unit, configured to determine the type of environment in which the user is located according to the positioning data; the type of environment includes an indoor environment and an outdoor environment, and the outdoor environment includes a walking environment, a cycling environment, and a driving environment;

[0140] A generating unit, for generating reverse sound wave data corresponding to the noise data if the environment is outdoor and there is whistle audio data in the noise data; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data;

[0141] A combining unit is used to obtain pre-stored prompt audio data, and combine the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment;

[0142] A sending unit is used to send the first target audio data to the headphone device.

[0143] The terminal device includes but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of a terminal device 3 and does not constitute a limitation on the terminal device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0144] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0145] The memory 31 may be an internal storage unit of the terminal device 3, such as a hard disk or memory of the terminal device 3. The memory 31 may also be an external storage device of the terminal device 3, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 3. Further, the memory 31 may also include both an internal storage unit and an external storage device of the terminal device 3. The memory 31 is used to store the computer program and other programs and data required by the roaming control device. The memory 31 may also be used to temporarily store data that has been output or is to be output.

[0146] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0147] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0148] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0149] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0150] An embodiment of the present invention provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0151] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera device / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0152] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0153] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0154] In the embodiments provided by the present invention, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed over multiple network units.

[0156] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0157] It should also be understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0158] As used in the present specification and the appended claims, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to monitoring, depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is monitored" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is monitored" or "in response to monitoring [described condition or event]", depending on the context.

[0159] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0160] References to "one embodiment" or "some embodiments" etc. described in the present specification mean that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0161] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A method for reducing noise of audio data, characterized in that: The method for reducing noise of audio data is applied to an audio system, wherein the audio system includes an earphone device and a mobile terminal, and the method for reducing noise of audio data includes: Obtaining initial audio data, noise data and positioning data; Determine the type of environment in which the user is located according to the positioning data; the type of environment includes indoor environment and outdoor environment, and the outdoor environment includes walking environment, cycling environment and driving environment; If the environment is outdoor and there is whistle audio data in the noise data, then reverse sound wave data corresponding to the noise data is generated; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data; Acquire pre-stored prompt audio data, combine the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment; The first target audio data is sent to the headphone device.

2. The method for reducing noise of audio data according to claim 1, characterized in that: After the step of determining the type of environment in which the user is located according to the positioning data, the method further includes: If it is in an indoor environment, generating reverse sound wave data corresponding to the noise data; Combining the initial audio data with the reverse sound wave data to obtain second target audio data; The second target audio data is sent to the headphone device.

3. The method for reducing noise of audio data according to claim 1, wherein: The step of determining the type of environment in which the user is located according to the positioning data comprises: If the positioning data is in a non-road area and the moving distance per unit time is less than a first threshold, it is determined that the environment type where the user is located is an indoor environment; If the positioning data is in a non-road area and the moving distance within a unit time is not less than a first threshold, it is determined that the environment type where the user is located is a walking environment; If the positioning data is in a road area and the moving distance per unit time is between a first threshold and a second threshold, it is determined that the environment type in which the user is located is a cycling environment; If the positioning data is in a road area and the moving distance per unit time is greater than a second threshold, it is determined that the environment type in which the user is located is a driving environment.

4. The method for reducing noise of audio data according to claim 1, wherein: If the environment is outdoor and there is whistle audio data in the noise data, the step of generating reverse sound wave data corresponding to the noise data includes: If in an outdoor environment, identifying energy spike points in the noise data; Taking the energy sudden increase point as the center, extracting an audio segment of a fixed length from the noise data; Calculating audio features of the audio clip; the audio features include main frequency, spectral feature points of multiple frequency bands, spectral bandwidth and spectral flatness; Based on the audio features, construct an audio feature vector; Obtain multiple preset whistle audio standard vectors; Calculating the distance between the audio feature vector and the whistle audio standard vector; If the minimum distance is less than a preset value, it is determined that there is whistle audio data in the noise data; Generate reverse sound wave data corresponding to the noise data.

5. The method for reducing noise of audio data according to claim 4, characterized in that: The step of obtaining a plurality of preset whistle audio standard vectors comprises: Matching a plurality of preset whistle vectors corresponding to the environment type; The multiple preset whistle vectors are used as the whistle audio standard vectors.

6. The method for reducing noise of audio data according to claim 4, characterized in that: If the environment is outdoor, the step of identifying the energy surge point in the noise data includes: Extracting the median energy in the noise data; The data points that exceed twice the median energy are regarded as the energy surge points.

7. The method for reducing noise of audio data according to claim 4, characterized in that: The step of calculating the audio features of the audio clip comprises: Performing a fast Fourier transform on the audio clip to obtain a frequency spectrum in a complex form; The frequency corresponding to the maximum value in the modulus of the spectrum is taken as the main frequency; Calculating the spectrum flatness by using a geometric mean and an arithmetic mean; Based on the complex spectrum, spectrum feature points of multiple frequency bands are calculated.

8. The method for reducing noise of audio data according to claim 7, characterized in that: The step of calculating the frequency spectrum feature points of multiple frequency bands based on the complex frequency spectrum comprises: Dividing the complex spectrum into multiple frequency bands to obtain complex spectrum corresponding to each of the multiple frequency bands; Substituting the complex spectra corresponding to the multiple frequency bands into the following function to obtain the frequency spectrum feature points of the multiple frequency bands; Among them, SC multi Indicates the spectrum feature points of multiple frequency bands, [f1, f2] indicates the first frequency band range, [f3, f4] indicates the second frequency band range, f1, f2, f3 and f4 indicate the end points of the frequency bands, N indicates the length of the frequency band, F s represents the sampling frequency, |X[k]| represents the complex spectrum, FFT(x[n]) represents the spectrum obtained after the sub-audio segment is subjected to the fast Fourier transform, |FFT(x[n])| represents the complex spectrum, x[n] represents the sub-audio segment, k represents the frequency index, Re(FFT(x[n])) represents the real part of FFT(x[n]), and Im(FFT(x[n])) represents the imaginary part of FFT(x[n]).

9. A noise reduction device for audio data, characterized in that: The audio data noise reduction device comprises: An acquisition unit, used for acquiring initial audio data, noise data and positioning data; A determination unit, configured to determine the type of environment in which the user is located according to the positioning data; the type of environment includes an indoor environment and an outdoor environment, and the outdoor environment includes a walking environment, a cycling environment, and a driving environment; A generating unit, for generating reverse sound wave data corresponding to the noise data if the environment is outdoor and there is whistle audio data in the noise data; the reverse sound wave data refers to sound wave data with a phase opposite to that of the noise data; A combining unit is used to obtain pre-stored prompt audio data, and combine the initial audio data, the reverse sound wave data and the prompt audio data to obtain first target audio data; the prompt audio data is used to prompt the user to pay attention to the traffic environment; A sending unit is used to send the first target audio data to a headphone device.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps in the method for reducing noise of audio data according to any one of claims 1 to 8 are implemented.