A snoring sound detection method and apparatus

CN116570239BActive Publication Date: 2026-10-20ZHANGZHOU SOLEX SMART HOME CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310401878.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2026-10-20
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

现有的深度学习方法处理复杂且计算量大

Benefits of technology

[0058](1)本发明首先计算出音频信号的频段响度均值的比值,在频段响度均值的比值大于设定阈值时,进一步获得频率-响度峰值轨迹,并获取极大值个数以及极大值所属分布窗口;基于极大值个数以及极大值所属分布窗口,识别出音频信号是否为鼾声,计算方法简单易实现;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116570239B_ABST
    Figure CN116570239B_ABST
Patent Text Reader

Abstract

The application provides a snoring sound detection method and device, the method comprising: obtaining an audio signal to be detected; dividing the audio signal into two frequency bands; obtaining the average loudness of the two frequency bands respectively, calculating the ratio of the average loudness of the two frequency bands; if the ratio is greater than a set threshold, performing spectral transformation on the audio signal to obtain a spectrum signal, and dividing the spectrum signal into frequency bands with a preset frequency value as a window; taking the average value of each window to obtain a frequency-loudness peak value trajectory; obtaining the number of maximum values and the distribution window of the maximum values based on the frequency-loudness peak value trajectory; judging whether the number of maximum values and the distribution window of the maximum values meet the snoring sound classification rule, and if so, identifying that the audio signal includes snoring sound. The application has simple processing, small calculation amount compared with the deep learning method, and high detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of snoring detection technology, and in particular to a snoring detection method and apparatus. Background Technology

[0002] Obstructive sleep apnea-hypopnea syndrome (OSAHS) is a common condition that is easily overlooked. It is primarily caused by apnea-hypopnea or apnea during sleep, which can lead to daytime sleepiness and recurrent apnea. A prominent characteristic is often snoring during sleep; therefore, snoring detection during sleep can effectively identify potential OSAHS.

[0003] Existing technologies generally employ deep learning algorithms for snoring detection. Reference document 1, "A Snoring Monitoring Method and System Based on Deep Learning Algorithm and Corresponding Electric Bed Control Method and System" (application number 202110803746.6), discloses using a pre-trained deep learning model for deep feature extraction and classification, categorizing each audio segment into audio slices containing snoring and those not containing snoring. Existing deep learning methods are complex and computationally intensive. Currently, there are also techniques for detecting audio signals using Fourier transform, such as reference document 2, application number 201510586206.1, which discloses a high-resolution audio frequency measurement method based on FFT. However, when using the measurement method in reference document 2, if the number of sampling points during Fourier transform is insufficient, the calculated spectral peak may fall precisely between two sampling points. This leads to a significant deviation between the results obtained from the fast Fourier transform and the actual values. Furthermore, the spectrum obtained using traditional Fourier transform is not accurate enough in identifying the frequency and amplitude of adjacent spectra when the frequency resolution is low. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a snoring detection method and apparatus that analyzes spectral signals, requiring less computation and being easier to implement compared to deep learning methods.

[0005] The present invention adopts the following technical solution:

[0006] Firstly, a snoring detection method includes:

[0007] Acquire the audio signal to be detected;

[0008] The audio signal is divided into two frequency bands; the mean loudness of the two frequency bands is obtained respectively, and the ratio of the mean loudness of the two frequency bands is calculated.

[0009] If the ratio is greater than a set threshold, the audio signal is subjected to spectral transformation to obtain a spectral signal, and the frequency band is divided into windows with a preset frequency value; the average value of each divided window is taken to obtain the frequency-loudness peak trajectory.

[0010] The number of maxima and the distribution window to which the maxima belong are obtained based on the frequency-loudness peak trajectory.

[0011] Determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, identify that the audio signal includes snoring.

[0012] Preferably, it determines whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, it identifies that the audio signal includes snoring, specifically including:

[0013] If the number of maxima is 1, determine whether the distribution window to which the maxima belongs is located in the low-frequency part. If so, identify that the audio signal includes snoring; the frequency of the low-frequency part is less than the first frequency value.

[0014] If there are 2 maxima, determine the distribution window to which the maxima belong, and determine whether one of the maxima is located in the low-frequency part and whether the other maxima is located in the mid-frequency part or the high-frequency part. If so, identify that the audio signal includes snoring. The frequency of the mid-frequency part is between the first frequency value and the second frequency value, and the frequency of the high-frequency part is greater than the second frequency value.

[0015] If the number of maxima is 3, determine whether the distribution window to which the maxima belong is located in the low-frequency part, the mid-frequency part, and the high-frequency part respectively. If so, identify that the audio signal includes snoring.

[0016] Preferably, after obtaining the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory, the method further includes peak correction when the number of maxima equals 2, specifically including:

[0017] If the first maximum value is located in the first frequency band, and the frequency loudness ratio of the first frequency band to the adjacent second frequency band is between [0.75, 1.25], the distribution window to which the first maximum value belongs is corrected to the second frequency band; wherein the frequency of the second frequency band is greater than the frequency of the first frequency band.

[0018] Preferably, after obtaining the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory, the method further includes peak correction when the number of maxima equals 2, specifically including:

[0019] If the first maximum value is located in the third frequency band, and the frequency loudness ratio of the third frequency band to the adjacent second frequency band is between [0.75, 1.25], then the distribution window to which the third maximum value belongs is corrected to the second frequency band; wherein the frequency of the third frequency band is greater than the frequency of the second frequency band.

[0020] Preferably, the audio signal is divided into two frequency bands of equal frequency, specifically including:

[0021] Perform a short-time Fourier transform on the audio signal to divide the transformed frequency band into two frequency bands of equal frequency.

[0022] Preferably, if the ratio is greater than a set threshold, a spectral transformation is performed on the audio signal to obtain a spectral signal, specifically including:

[0023] If the ratio is greater than a set threshold, a fast Fourier transform is performed on the audio signal to obtain the spectral signal.

[0024] Preferably, before performing a short-time Fourier transform on the audio signal, the method further includes:

[0025] The audio signal to be detected is pre-emphasized and / or noise-reduced.

[0026] Preferably, the pre-emphasis processing specifically includes:

[0027] The audio signal to be detected is pre-emphasized using a first-order filter.

[0028] Preferably, the noise reduction process specifically includes:

[0029] Perform a short-time Fourier transform on a pre-stored or input noisy audio signal;

[0030] The mean and standard deviation of the noise audio signal at different frequencies were calculated.

[0031] Perform a short-time Fourier transform on the audio signal to be detected;

[0032] Thresholds are calculated based on statistical information about noise;

[0033] The mask signal is determined by comparing the value of the audio signal to be detected after performing a short-time Fourier transform with a threshold.

[0034] The mask signal is smoothed in both frequency and time using a second filter;

[0035] The mask signal is superimposed onto the audio signal after a short-time Fourier transform, and then inverted to form the audio signal.

[0036] Secondly, a snoring detection device includes:

[0037] The audio signal acquisition module is configured to acquire the audio signal to be detected;

[0038] The loudness mean ratio calculation module is configured to divide the audio signal into two frequency bands of equal frequency; obtain the mean loudness of the two frequency bands respectively, and calculate the ratio of the mean loudness of the two frequency bands;

[0039] The peak trajectory acquisition module is configured to determine whether the ratio is greater than 2. If it is greater, it performs a spectral transformation on the audio signal to obtain a spectral signal and divides the frequency band into a window with a preset frequency value. It then takes the average value of each window to obtain the frequency-loudness peak trajectory.

[0040] The distribution window acquisition module is configured to acquire the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory.

[0041] The snoring recognition module is configured to determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, it identifies that the audio signal includes snoring.

[0042] Thirdly, an electronic device includes:

[0043] At least one microcontroller; and,

[0044] A memory communicatively connected to the at least one microcontroller; wherein,

[0045] The memory stores instructions that can be executed by the at least one microcontroller, the instructions being executed by the at least one microcontroller to enable the at least one microcontroller to perform:

[0046] Acquire the audio signal to be detected;

[0047] The audio signal is divided into two frequency bands of equal frequency; the mean loudness of the two frequency bands is obtained respectively, and the ratio of the mean loudness of the two frequency bands is calculated.

[0048] If the ratio is greater than a set threshold, the audio signal is subjected to spectral transformation to obtain a spectral signal, and the frequency band is divided into windows with a preset frequency value; the average value of each divided window is taken to obtain the frequency-loudness peak trajectory.

[0049] The number of maxima and the distribution window to which the maxima belong are obtained based on the frequency-loudness peak trajectory.

[0050] Determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, identify that the audio signal includes snoring.

[0051] Fourthly, a non-volatile computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions for causing a computer to perform:

[0052] Acquire the audio signal to be detected;

[0053] The audio signal is divided into two frequency bands of equal frequency; the mean loudness of the two frequency bands is obtained respectively, and the ratio of the mean loudness of the two frequency bands is calculated.

[0054] If the ratio is greater than a set threshold, the audio signal is subjected to spectral transformation to obtain a spectral signal, and the frequency band is divided into windows with a preset frequency value; the average value of each divided window is taken to obtain the frequency-loudness peak trajectory.

[0055] The number of maxima and the distribution window to which the maxima belong are obtained based on the frequency-loudness peak trajectory.

[0056] Determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, identify that the audio signal includes snoring.

[0057] The present invention has the following beneficial effects:

[0058] (1) The present invention first calculates the ratio of the average loudness of the frequency band of the audio signal. When the ratio of the average loudness of the frequency band is greater than a set threshold, the frequency-loudness peak trajectory is further obtained, and the number of maxima and the distribution window to which the maxima belong are obtained. Based on the number of maxima and the distribution window to which the maxima belong, the audio signal is identified as snoring. The calculation method is simple and easy to implement.

[0059] (2) The present invention performs peak correction when the number of maxima is equal to 2. Specifically, it performs correction when the ratio of the frequency loudness of the left and right frequency bands is within a preset range, so as to obtain a more accurate recognition result.

[0060] (3) Before comparing the average loudness of the frequency bands, the present invention performs pre-emphasis processing and / or noise reduction processing on the audio signal, which can effectively suppress the influence of low-frequency noise.

[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Attached Figure Description

[0062] Figure 1 This is a flowchart of a snoring detection method according to an embodiment of the present invention;

[0063] Figure 2 This is a detailed flowchart of the snoring detection method according to an embodiment of the present invention;

[0064] Figure 3 These are the spectrum diagrams before and after pre-emphasis processing in an embodiment of the present invention; where (a) represents before processing and (b) represents after processing.

[0065] Figure 4 These are the spectrum diagrams before and after noise reduction processing in an embodiment of the present invention; where (a) represents before processing and (b) represents after processing.

[0066] Figure 5 This is a schematic diagram of the distribution of four types of snoring sounds according to an embodiment of the present invention;

[0067] Figure 6 This is a schematic diagram of the spectrum of partial snoring / non-snoring sounds according to an embodiment of the present invention; wherein, (a) represents the spectrum of partial snoring sounds. Figure 1 (b) represents the spectrum of partial snoring. Figure 2 (c) represents the spectrum of non-snoring sounds. Figure 1 (d) represents the spectrum of non-snoring sounds. Figure 2 (e) represents the spectrum of non-snoring sounds. Figure 3 ;

[0068] Figure 7 These are schematic diagrams of the spectrum before and after segmentation according to an embodiment of the present invention; wherein, (a) represents the spectrum before segmentation; and (b) represents the schematic diagram after segmentation.

[0069] Figure 8 This is a schematic diagram of peak correction according to an embodiment of the present invention;

[0070] Figure 9 This is a schematic diagram of the Class A frequency domain and peak trajectory according to an embodiment of the present invention;

[0071] Figure 10 This is a schematic diagram of the Class B frequency domain and peak trajectory according to an embodiment of the present invention;

[0072] Figure 11 This is a schematic diagram of the Class C frequency domain and peak trajectory according to an embodiment of the present invention;

[0073] Figure 12 This is a schematic diagram of the Class D frequency domain and peak trajectory according to an embodiment of the present invention;

[0074] Figure 13 This is a structural block diagram of the snoring detection device according to an embodiment of the present invention;

[0075] Figure 14 This is a schematic diagram of the hardware structure of an electronic device that performs a snoring detection method according to an embodiment of the present invention. Detailed Implementation

[0076] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0077] In the description of this invention, it should be noted that the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0078] In the description of this invention, it should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0079] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the step identifiers S101, S102, S103, etc. are used only for convenience of description and do not indicate the execution order. The corresponding execution order can be adjusted.

[0080] See Figure 1 and Figure 2 As shown, this snoring detection method includes:

[0081] S101, acquire the audio signal to be detected;

[0082] S102, Divide the audio signal into two frequency bands of equal frequency; Obtain the average loudness of the two frequency bands respectively, and calculate the ratio of the average loudness of the two frequency bands;

[0083] S103, if the ratio is greater than a set threshold, perform a spectral transformation on the audio signal to obtain a spectral signal, and divide the frequency band into windows with a preset frequency value; take the average value of each divided window to obtain the frequency-loudness peak trajectory.

[0084] S104, based on the frequency-loudness peak trajectory, obtain the number of maxima and the distribution window to which the maxima belong;

[0085] S105, determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, identify that the audio signal includes snoring.

[0086] The above-described S101 to S105 steps of the snoring detection method in this embodiment can be implemented using an anti-snoring pillow device and / or a smart terminal device, as long as these devices have sound acquisition capabilities (such as a microphone) and / or processor capabilities (such as a microcontroller). Specifically, one terminal can be responsible for acquisition (e.g., the anti-snoring pillow is responsible for acquisition), and another terminal can be responsible for processing (e.g., a mobile phone terminal is responsible for processing), or both acquisition and processing can be performed by a single terminal. This embodiment does not impose any specific limitations. Furthermore, the smart terminal device can be a mobile phone, tablet computer, wearable device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. This embodiment does not impose any limitations on the specific type of terminal device.

[0087] In this embodiment, after S101, the method further includes: pre-emphasis processing and / or noise reduction processing of the audio signal to be detected.

[0088] Specifically, in order to enhance the high-frequency components in the signal, the acquired audio signal to be processed is pre-emphasized using a first-order filter. The filter used in this embodiment is as follows:

[0089] X(z) = X(z) - 0.98X(Z-1)

[0090] Where X(z) represents the z-th sampling point of the input signal, and X(Z-1) represents the (z-1)-th sampling point of the input signal.

[0091] See the spectrograms before and after pre-emphasis processing. Figure 3 As shown, (a) represents the spectrum before processing, and (b) represents the spectrum after processing.

[0092] Furthermore, in this embodiment, noise reduction processing is performed after pre-emphasis processing.

[0093] Specifically, it involves short-time Fourier processing of the original noise audio segment, calculating the thresholds for the mean and standard deviation at the frequency to determine the masking operation for the audio signal.

[0094] Noise reduction processing requires two inputs: one is the audio signal to be processed, and the other is the noise audio signal (the audio signal emitted by the machine that recorded the audio signal).

[0095] The specific processing steps are as follows:

[0096] (1) Perform STFT (Fast Fourier Transform) calculation on the noisy audio signal segment;

[0097] (2) The mean and standard deviation at frequency are calculated by using the STFT of the noise;

[0098] (3) Perform STFT calculation on the audio signal to be detected;

[0099] (4) Calculate the threshold based on the statistical information of the noise (and the expected sensitivity of the algorithm);

[0100] (5) The mask signal is determined by comparing the STFT value of the audio signal to be detected with a threshold.

[0101] (6) Use filters to smooth the mask signal in terms of frequency and time;

[0102] (7) The mask signal is superimposed onto the STFT of the audio signal to be detected and inverted into an audio signal.

[0103] Specifically, the threshold calculation process is as follows.

[0104] The parameters for Shift are: 2048 points in the FFT window; 2048 frames per second (l); 512 frames per second (m); and the Hanning window is selected as the window function.

[0105] Let the noise audio signal be noise, with length lens_noise. Perform Strft transformation on noise, denoted as noise_stft, which is a two-dimensional matrix in the format [1025, Nframes1].

[0106] Let the audio signal to be processed be signal, and its length be lens_signal. Perform a Strft transformation on signal, denoted as signal_stft, which is a two-dimensional matrix in the format [1025, Nframes2].

[0107] Nframes1 = lens_snore - l / m

[0108] Nframes2 = lens_signal - l / m

[0109]

[0110]

[0111] It is a one-dimensional matrix of length 1025, in the format (1025, 1).

[0112] Noise_thresh=Mean_noise+Std_noise*k

[0113] Wherein, k represents the discrete coefficient away from the audio; k is selected to be 1.5; Noise_thresh is a one-dimensional matrix with a length of 1025, in the format of (1025, 1); Mean_noise represents the average value of the noise signal; Std_noise represents the standard deviation of the noise signal. Thresh is obtained by repeatedly stacking Noise_thresh Nframes2 times in the column direction, with the format of (1025, Nframes2), and the threshold is Thresh.

[0114] Further, the process of determining the mask signal is as follows.

[0115] Smoothing filter Smooth_filter = [1 / 3, 2 / 3, 1, 2 / 3, 1 / 3] * [0.2, 0.4, 0.6, 0.8, 1, 0.8, 0.6, 0.4, 0.2].T

[0116] Compare Thresh and signal_stft, set to 1 when signal_stft < Thresh, otherwise set to 0, to obtain a matrix sig_mask with the format of (1025, Nframes2), and convolve Smooth_filter and sig_mask to obtain the mask signal Mask_sign.

[0117] See Figure 4 which shows the spectrograms before and after the noise reduction processing of this embodiment; wherein, (a) represents the spectrogram before processing, (b) represents the spectrogram after processing. It can be seen from the comparison diagram that the noise reduction processing can effectively suppress the influence of low-frequency noise.

[0118] In this embodiment, in S102, dividing the audio signal into two frequency bands with equal frequencies specifically includes:

[0119] Performing short-time Fourier transform on the audio signal, and dividing the transformed frequency band into two frequency bands with equal frequencies.

[0120] In S102, the parameter requirements for the short-time Fourier transform are:

[0121] (1) The number of points of the fft window is 2048;

[0122] (2) The frame length is 2048;

[0123] (3) The frame shift is 512;

[0124] (4) The hanning window is selected as the window function.

[0125] See Figure 5 which shows the schematic diagram of four types of snore distribution according to the present invention.

[0126] Snoring is mainly divided into four categories, and the classification rules are as follows:

[0127] Type A: Low-frequency monosyllabic snoring.

[0128] Type B: Features both low and mid-frequency sound.

[0129] Type C: Features both low and high frequencies.

[0130] Type D: Triple tone with low, mid and high frequencies.

[0131] In this embodiment, the low frequency indicates a frequency less than 350 Hz (first frequency value); the mid frequency indicates a frequency greater than 350 Hz and less than 850 Hz (second frequency value); and the high frequency indicates a frequency greater than 850 Hz.

[0132] Since snoring sounds are mainly distributed in the low-frequency range, comparing the frequency band proportions can filter out some non-snoring sounds.

[0133] The principle is as follows:

[0134] as follows Figure 6 Figures (a) to (e) show the spectrum of snoring and some non-snoring sounds, where (a) represents the spectrum of some snoring sounds. Figure 1 (b) represents the spectrum of partial snoring. Figure 2 (c) represents the spectrum of some non-snoring sounds (such as human voices, music, etc.). Figure 1 (d) represents the spectrum of some non-snoring sounds (such as human voices, music, etc.). Figure 2 (e) represents the spectrum of some non-snoring sounds (such as human voices, music, etc.). Figure 3 The frequency of snoring signals is mostly located in the range [0, 1000 Hz]. Calculate the average loudness mean1 in the [0, 1000 Hz] interval and the average loudness mean2 in the [1000 Hz, 2000 Hz] interval. Calculate the ratio of the average loudness of the two frequency bands, as follows:

[0135] ratio = mean1 / mean2.

[0136] If ratio >= 2, then the signal is judged as a suspected snoring signal and further judgment is made;

[0137] If ratio < 2, then the signal is determined to be a non-snoring signal.

[0138] In this embodiment S103, if the ratio is greater than 2, a spectral transformation is performed on the audio signal to obtain a spectral signal, specifically including:

[0139] If the ratio is greater than 2, perform a fast Fourier transform on the audio signal to obtain the spectral signal.

[0140] For details, see Figure 7 As shown, the frequency bands are divided with a window length of 200Hz. The x-axis is plotted as Freq0, Freq1, Freq2, Freq3, Freq4, Freq5….Freq13, and the y-axis is plotted as the average loudness of each frequency band.

[0141] Freq0 represents 0 Hz, and the corresponding loudness is Am0;

[0142] Freq1 represents (0, 200 Hz), and the corresponding loudness is Am1;

[0143] Freq2 represents (200, 400 Hz), and the corresponding loudness is Am2;

[0144] Freq3 represents (400, 600 Hz), and the corresponding loudness is Am3;

[0145] Freq4 represents (600, 800 Hz), and the corresponding loudness is Am4;

[0146] Freq5 represents (800, 1000 Hz), and the corresponding loudness is Am5;

[0147] Freq6 represents (1000, 1200 Hz), and the corresponding loudness is Am6;

[0148] Freq7 represents (1200, 1400 Hz), and the corresponding loudness is Am7;

[0149] Freq8 represents (1400, 1600 Hz), and the corresponding loudness is Am8;

[0150] Freq9 represents (1600, 1800 Hz), and the corresponding loudness is Am9;

[0151] Freq10 represents (1800, 2000 Hz), and the corresponding loudness is Am10;

[0152] Freq11 represents (2000, 2200 Hz), and the corresponding loudness is Am11;

[0153] Freq12 represents (2200, 2400 Hz), and the corresponding loudness is Am12;

[0154] Freq13 represents (2400, 2600 Hz), and the corresponding loudness is Am13.

[0155] Figure 7 In the image, (a) represents the original audio signal spectrum, and (b) represents the image obtained after frequency band segmentation, i.e., the frequency-loudness peak trajectory.

[0156] In this embodiment, after obtaining the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory, peak correction is also performed when the number of maxima equals 2, specifically including:

[0157] If the first maximum value is located in the third frequency band, and the frequency loudness ratio of the third frequency band to the adjacent second frequency band is between [0.75, 1.25], then the distribution window to which the third maximum value belongs is corrected to the second frequency band; wherein the frequency of the third frequency band is greater than the frequency of the second frequency band.

[0158] Peak correction means that when the peak trajectory has some acceptable data error, it is corrected to the data that the peak matching template recognizes.

[0159] Including the following conditions:

[0160] When the peak trajectory length is 2, either (1) or (2) is satisfied.

[0161] (1) The first extreme point is Freq1. The ratio of the average loudness of the Freq1 and Freq2 frequency bands is between [0.75, 1.25]. The frequency band loudness ratio refers to the ratio of the average loudness of each frequency band.

[0162] (2) The first extreme point is Freq3, and the average loudness ratio of the Freq3 and Freq2 frequency bands is between [0.75, 1.25].

[0163] The first extreme value (maximum value) is corrected to Freq2.

[0164] See Figure 8 As shown, (1) represents the loudness ratio r = Am1 / Am2 of (Freq1, Am1) and (Freq2, Am2). When r∈[0.75,1.25], the first extreme point in the peak trajectory is corrected to Freq2.

[0165] Similarly, (2) represents the cases of (Freq3,Am3) and (Freq2,Am2). When the first extreme point is 3 or 1 and the loudness of the 2-band frequency is within an acceptable error range, it is considered that the noise data of (0, 200HZ] or [400HZ, 600HZ] affects the change of the peak point.

[0166] See Figure 5As explained above, Class A snoring is characterized by a peak at the low frequency (300 Hz); Class B snoring is characterized by a peak before the low frequency (300 Hz) and a second peak in the mid-frequency range (300-850 Hz); Class C snoring is characterized by a peak before the low frequency (300 Hz) and a second peak in the high-frequency range (after 850 Hz); and Class D snoring is characterized by a peak before the low frequency (300 Hz), a second peak in the mid-frequency range (300-850 Hz), and a third peak in the high-frequency range (after 850 Hz).

[0167] One peak value: (corresponding to Category A in snoring classification)

[0168] The first maximum value is at [Freq2], indicating significant performance in the [200, 400 Hz] frequency band.

[0169] Two peak values: (corresponding to categories B / C in snoring classification)

[0170] The first maximum value is in [Freq2], indicating a significant performance in the [200, 400 Hz] frequency band. The second maximum value is one of [Freq4, Freq7, Freq8, Freq9, Freq10, Freq11], indicating a distribution in [600, 800 Hz] or beyond 1200 Hz.

[0171] The reason Freq3 is not included is because it is the result after peak correction.

[0172] The reason it is after 1200Hz is based on actual observation and statistics, which are basically after 1200Hz.

[0173] The number of peaks is 3: (corresponding to Category D in the snoring classification)

[0174] The first maximum value is at [Freq2], indicating significant performance in the [200, 400Hz] frequency band;

[0175] The second maximum value is one of [Freq3,Freq4], indicating that it has a distribution in [600, 800 Hz].

[0176] The third maximum value is one of [Freq7.Freq8.Freq9.Freq10.Freq11], indicating that there is a distribution after 1200 Hz.

[0177] Based on the above analysis, the snoring classification rules of this embodiment can be derived as follows.

[0178] (1) The number of peaks is 1, the location of the extreme point is Freq2, and x represents the extreme point. See [link to relevant documentation] Figure 9 As shown.

[0179] (2) The number of peaks is 2. Does the trajectory distribution meet the following condition: the first maximum value is in [Freq2] and the second maximum value is one of [Freq4,Freq7,Freq8,Freq9,Freq10,Freq11]?

[0180] See Figure 10 As shown, there are 2 peak points located at (Freq2, Freq4), which are identified as snoring.

[0181] See Figure 11 As shown, there are 2 peak points located at (Freq2, Freq10), which are identified as snoring.

[0182] (3) The number of peaks is 3. Does the distribution conform to ([Freq2][Freq3.Freq4][Freq7.Freq8.Freq9.Freq10.Freq11])).

[0183] See Figure 12 As shown, there are 3 extreme points, located at (Freq2,Freq4,Freq10), which are identified as snoring.

[0184] See Figure 13 As shown, this embodiment also discloses a snoring detection device, including:

[0185] The audio signal acquisition module 1301 is configured to acquire the audio signal to be detected;

[0186] The loudness mean ratio calculation module 1302 is configured to divide the audio signal into two frequency bands of equal frequency; obtain the mean loudness of the two frequency bands respectively; and calculate the ratio of the mean loudness of the two frequency bands.

[0187] The peak trajectory acquisition module 1303 is configured to determine whether the ratio is greater than 2. If it is greater, it performs a spectral transformation on the audio signal to obtain a spectral signal and divides the frequency band into a window with a preset frequency value. It then takes the average value of each window to obtain the frequency-loudness peak trajectory.

[0188] The distribution window acquisition module 1304 is configured to acquire the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory.

[0189] The snoring recognition module 1305 is configured to determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, it identifies that the audio signal includes snoring.

[0190] Other specific implementations of a snoring detection device and the same snoring detection method will not be described again in this embodiment.

[0191] This application's snoring detection method and device are based on the study of the spectral characteristics of audio sampling signals after Fourier transform to the frequency domain. The input is an audio signal. First, the original sound segment is denoised. Then, the frequency bands N1 and N2 are divided and short-time Fourier transform is performed. The loudness mean values ​​within frequency bands N1 and N2 are calculated and compared to obtain a ratio. If the ratio is less than 2, the signal is filtered out and identified as non-snoring. If it is greater than 2, the judgment continues. Then, a fast Fourier transform is performed on the entire audio signal segment to shift the time domain information to the frequency domain. The spectral signal is divided into a portion [0 Hz: 2600 Hz] with 200 Hz as a window. The average value of each window is taken, starting with 0 (0-200 Hz is smoothed, so (0, 0) represents the sound intensity of 0 Hz). The 13 average values ​​are arranged in frequency order to form a signal of length 14. The maximum value of this signal is calculated to form a frequency-loudness peak trajectory. The peak trajectory is matched and judged with a preset template. If it passes the match, it is judged as snoring. If it fails the match, it is judged as non-snoring.

[0192] See Figure 14 The diagram shown is a hardware structure diagram of the electronic device 600 for the snoring detection method provided in this embodiment. Figure 13 As shown, the electronic device 140 includes:

[0193] One or more microcontrollers 1401 and memory 1402, Figure 14 Take a microcontroller 1401 as an example.

[0194] The microcontroller 1401 and the memory 1402 can be connected via a bus or other means. Figure 14 Taking the example of a connection between China and Israel via a bus.

[0195] The memory 1402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the snoring detection method in the embodiments of this application. The microcontroller 1401 executes various functional applications of the terminal device or server and completes data processing by running the non-volatile software programs, instructions, and modules stored in the memory 1402, thereby implementing the snoring detection method of the above-described method embodiments.

[0196] The memory 1402 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the snoring detection device, etc. Furthermore, the memory 1402 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 1402 may optionally include memory remotely configured relative to the microcontroller 1401, and these remote memories may be connected to the snoring detection device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0197] The one or more modules are stored in the memory 1402. When executed by the one or more microcontrollers 1401, they perform the snoring detection method in any of the above method embodiments, for example, the method described above. Figure 1 Steps 101 to S105 of the method are implemented. Figure 13 The functions of modules 1301-1305 in the document.

[0198] The above-described product can perform the methods provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for performing the methods. Technical details not described in detail in this embodiment can be found in the methods provided in the embodiments of this application.

[0199] The electronic devices described in this application exist in various forms, including but not limited to:

[0200] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.

[0201] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.

[0202] (3) Server: A device that provides computing services. The components of a server include a microcontroller, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0203] (4) Other electronic devices with data interaction functions.

[0204] This application provides a non-volatile computer-readable storage medium storing computer-executable instructions that are executed by one or more microcontrollers, for example... Figure 14 One of the microcontrollers 1401 enables the above-described one or more microcontrollers to execute the snoring detection method in any of the above method embodiments, for example, to perform the above-described... Figure 1 Steps 101 to S105 of the method are implemented. Figure 13 The functions of modules 1301-1302 in the document.

[0205] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0206] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software and a general-purpose hardware platform, or of course, using hardware. Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0207] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concepts, should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting snoring, characterized in that, include: Acquire the audio signal to be detected; The audio signal is divided into two frequency bands; Obtain the mean loudness of the two frequency bands respectively, and calculate the ratio of the mean loudness of the two frequency bands; If the ratio is greater than a set threshold, the audio signal is subjected to spectral transformation to obtain a spectral signal, and the frequency band is divided into windows with a preset frequency value; the average value of each divided window is taken to obtain the frequency-loudness peak trajectory. The number of maxima and the distribution window to which the maxima belong are obtained based on the frequency-loudness peak trajectory. Determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, identify that the audio signal includes snoring. After obtaining the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory, peak correction is also performed when the number of maxima equals 2, specifically including: If the first maximum value is located in the first frequency band, and the frequency loudness ratio of the first frequency band to the adjacent second frequency band is between [0.75, 1.25], then the distribution window to which the first maximum value belongs is corrected to the second frequency band; wherein the frequency of the second frequency band is greater than the frequency of the first frequency band; or, If the first maximum value is located in the third frequency band, and the frequency loudness ratio of the third frequency band to the adjacent second frequency band is between [0.75, 1.25], the distribution window to which the first maximum value belongs is corrected to the second frequency band; wherein, the frequency of the third frequency band is greater than the frequency of the second frequency band.

2. The snoring detection method according to claim 1, characterized in that, Determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, identify that the audio signal includes snoring, specifically including: If the number of maxima is 1, determine whether the distribution window to which the maxima belongs is located in the low-frequency part. If so, identify that the audio signal includes snoring; the frequency of the low-frequency part is less than the first frequency value. If there are 2 maxima, determine the distribution window to which the maxima belong, and determine whether one of the maxima is located in the low-frequency part and whether the other maxima is located in the mid-frequency part or the high-frequency part. If so, identify that the audio signal includes snoring. The frequency of the mid-frequency part is between the first frequency value and the second frequency value, and the frequency of the high-frequency part is greater than the second frequency value. If the number of maxima is 3, determine whether the distribution window to which the maxima belong is located in the low-frequency part, the mid-frequency part, and the high-frequency part respectively. If so, identify that the audio signal includes snoring.

3. The snoring detection method according to claim 1, characterized in that, Dividing an audio signal into two frequency bands of equal frequency specifically includes: Perform a short-time Fourier transform on the audio signal to divide the transformed frequency band into two frequency bands of equal frequency.

4. The snoring detection method according to claim 1, characterized in that, If the ratio is greater than a set threshold, a spectral transformation is performed on the audio signal to obtain a spectral signal, specifically including: If the ratio is greater than a set threshold, a fast Fourier transform is performed on the audio signal to obtain the spectral signal.

5. The snoring detection method according to claim 3, characterized in that, Before performing a short-time Fourier transform on the audio signal, the following steps are also included: The audio signal to be detected is pre-emphasized and / or noise-reduced.

6. The snoring detection method according to claim 5, characterized in that, The pre-emphasis processing specifically includes: The audio signal to be detected is pre-emphasized using a first-order filter.

7. The snoring detection method according to claim 5 or 6, characterized in that, The noise reduction process specifically includes: Perform a short-time Fourier transform on a pre-stored or input noisy audio signal; The mean and standard deviation of the noise audio signal at different frequencies were calculated. Perform a short-time Fourier transform on the audio signal to be detected; Thresholds are calculated based on statistical information about the noise. The mask signal is determined by comparing the value of the audio signal to be detected after performing a short-time Fourier transform with a threshold. The mask signal is smoothed in both frequency and time using a second filter; The mask signal is superimposed onto the audio signal after a short-time Fourier transform, and then inverted to form the audio signal.

8. A snoring detection device, characterized in that, include: The audio signal acquisition module is configured to acquire the audio signal to be detected; The loudness mean ratio calculation module is configured to divide the audio signal into two frequency bands of equal frequency; obtain the mean loudness of the two frequency bands respectively, and calculate the ratio of the mean loudness of the two frequency bands; The peak trajectory acquisition module is configured to determine whether the ratio is greater than 2. If it is greater, it performs a spectral transformation on the audio signal to obtain a spectral signal and divides the frequency band into a window with a preset frequency value. It then takes the average value of each window to obtain the frequency-loudness peak trajectory. The distribution window acquisition module is configured to acquire the number of maxima and the distribution window to which the maxima belong based on the frequency-loudness peak trajectory; and to perform peak correction when the number of maxima equals 2, specifically including: if the first maximum is located in the first frequency band, and the frequency-band loudness ratio of the first frequency band to the adjacent second frequency band is between [0.75, 1.25], then the distribution window to which the first maximum belongs is corrected to the second frequency band; wherein the frequency of the second frequency band is greater than the frequency of the first frequency band; or, if the first maximum is located in the third frequency band, and the frequency-band loudness ratio of the third frequency band to the adjacent second frequency band is between [0.75, 1.25], then the distribution window to which the first maximum belongs is corrected to the second frequency band; wherein the frequency of the third frequency band is greater than the frequency of the second frequency band. The snoring recognition module is configured to determine whether the number of maxima and the distribution window to which the maxima belong conform to the snoring classification rules. If so, it identifies that the audio signal includes snoring.

Citation Information

Patent Citations

  • Method for high-resolution audio frequency measurement based on FFT (Fast Fourier Transform)

    CN105307095A

  • Snore monitoring method and system based on deep learning algorithm and corresponding electric bed control method and system

    CN113599052A

  • Autonomously updated abnormal sound detection algorithm without negative sample

    CN112735474A

  • Control system and method based on sleep perception

    CN113448438A

  • Respiratory sound analysis device, respiratory sound analysis method, computer program and recording medium

    WO2015145763A1