Snore recognition method, device and equipment and storage medium
By monitoring the audio signal and pillow pressure signal, combined with envelope analysis and environmental sound judgment, the existing deep learning algorithms have solved the complex and costly calculation problems in snoring recognition, and achieved efficient and accurate snoring recognition effect.
Patent Information
- Application Number
- CN202311764661.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-20
AI Technical Summary
The existing deep learning algorithms used for snoring recognition have complex calculations, high cost and long development cycles, which are not conducive to productization.
By monitoring the changes in the audio signal and the pillow pressure signal, drawing the envelope line, obtaining the number of envelopes and associated data, and combining the ambient sound to judge snoring, reducing the calculation amount and implementation difficulty.
It achieves the accuracy and efficiency of snore recognition, reduces storage consumption and development cycle, and is suitable for product-based applications.
Smart Images

Figure CN120167891A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of snoring recognition, and particularly to a snoring recognition method, device, equipment and storage medium. Background Art
[0002] Obstructive sleep apnea hypopnea syndrome (OSAHS) is a common and easily overlooked disease. It is mainly caused by sleep apnea hypopnea or apnea, which may cause daytime sleepiness and repeated apnea in patients. Usually, the most significant feature of this symptom is that snoring may occur during sleep. Therefore, snoring recognition during sleep can effectively detect possible obstructive sleep apnea hypopnea syndrome.
[0003] The prior art generally uses deep learning algorithms for snoring recognition. Comparative 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 to classify each audio segment into an audio slice containing snoring and an audio slice not containing snoring. Existing deep learning methods learn the features of snoring by learning a large number of different snoring sounds, so as to recognize snoring. However, the processing based on AI algorithms is complex, has a large amount of calculation, high cost, and a long development cycle, which is not conducive to productization. Summary of the Invention
[0004] In order to solve the above technical problems, the present invention provides a snoring recognition method, device, equipment and storage medium. Based on the audio signal and the pressure signal of the pillow, by monitoring the audio change and the pressure value change, snoring judgment is performed, and the amount of calculation is smaller than that of the deep learning method and is easy to implement.
[0005] The present invention adopts the following technical solutions:
[0006] In a first aspect, a snoring recognition method includes:
[0007] Obtain an audio signal within a preset time period;
[0008] Draw an envelope based on the audio signal and obtain the number of envelopes in the envelope; wherein, each envelope includes an ascending curve and a descending curve;
[0009] Obtain the associated data of the starting point, midpoint and ending point of each envelope; wherein, the midpoint is the point with the largest sound loudness value; the associated data includes sound loudness;
[0010] Perform snoring judgment on the audio signal within a preset time period based on the associated data of each envelope start point, midpoint, and end point; if the sound loudness at the start point, the sound loudness at the midpoint, and the sound loudness at the end point are all different, and the sound loudness at the midpoint is greater than or equal to the second preset loudness, it is determined that there is snoring in the audio signal within the preset time period.
[0011] Preferably, before drawing the envelope line based on the audio signal, it further includes:
[0012] Perform downsampling processing on the audio signal to obtain a downsampled audio signal.
[0013] Preferably, when drawing the envelope line based on the audio signal and obtaining the number of envelopes in the envelope line, it specifically includes:
[0014] Convert the audio signal into sound loudness data and draw an initial envelope line based on the sound loudness data;
[0015] Extract the extreme points of the sound loudness data to generate a preliminary array of extreme points;
[0016] Traverse the array of extreme points, mark three extreme points that satisfy the "V" shape, and obtain the associated data of the three extreme points; among them, the three extreme points are the start point, the lowest point, and the end point respectively;
[0017] Based on the preset sound loudness conditions and time conditions, perform removal operations on the extreme points that do not meet the conditions;
[0018] Obtain an optimized envelope line based on the extreme points after the removal operation;
[0019] Based on the optimized envelope line, obtain the number of envelopes.
[0020] Preferably, after obtaining the associated data of each envelope start point, midpoint, and end point, it further includes:
[0021] Obtain the sound loudness of the ambient sound;
[0022] When performing snoring judgment on the audio signal within a preset time period based on the associated data of each envelope start point, midpoint, and end point, it specifically includes:
[0023] Perform snoring judgment on the audio signal within a preset time period based on the associated data of each envelope start point, the associated data of the midpoint, the associated data of the end point, and the sound loudness of the ambient sound.
[0024] Preferably, when performing snoring judgment on the audio signal within a preset time period based on the associated data of each envelope start point, the associated data of the midpoint, the associated data of the end point, and the sound loudness of the ambient sound, it specifically includes:
[0025] Determine whether the envelope is a valid envelope based on the sound loudness of the ambient sound and the sound loudness at the midpoint of the envelope;
[0026] When it is a valid envelope, update the sound loudness at the start point and the end point of the envelope based on the sound loudness of the ambient sound;
[0027] Based on the updated sound loudness at the start point, the midpoint, the end point of the envelope and the sound loudness of the ambient sound, perform snoring judgment on the audio signal within a preset time period.
[0028] Preferably, the determining whether the envelope is a valid envelope based on the sound loudness of the ambient sound and the sound loudness at the midpoint of the envelope specifically includes:
[0029] When the sound loudness at the midpoint of the envelope is not greater than the sound loudness of the ambient sound, determine that the envelope is invalid;
[0030] When the sound loudness at the midpoint of the envelope is greater than the sound loudness of the ambient sound and the difference between the two is within the first preset loudness, determine that the envelope is invalid;
[0031] Otherwise, determine that the envelope is valid.
[0032] Preferably, the associated data further includes a time point; the updating the sound loudness at the start point and the end point of the envelope based on the sound loudness of the ambient sound specifically includes:
[0033] When the sound loudness at the start point of the envelope is less than the sound loudness VN of the ambient sound, find two adjacent points in the envelope; among them, the sound loudness EVnu of one point is greater than the sound loudness of the ambient sound, and the corresponding time point is recorded as ETnu; the sound loudness EVnd of the other point is less than the sound loudness of the ambient sound, and the corresponding time point is recorded as ETnd; use the intersection point of these two points as the new start point, and the time point of the new start point is ETns = ETnd+(ETnu - ETnd)*(VN - EVnd) / (EVnu - EVnd); update the sound loudness at the start point based on the time point of the new start point;
[0034] When the sound loudness at the start point of the envelope is greater than the sound loudness VN of the ambient sound, find two adjacent points in the envelope; among them,
[0035] the sound loudness EVnu of one point is greater than the sound loudness of the ambient sound, and the corresponding time point is recorded as ETnu; the sound loudness EVnd of the other point is less than the sound loudness of the ambient sound, and the corresponding time point is recorded as ETnd; use the intersection point of these two points as the new end point, and the time point of the new end point is ETne = ETnd-(ETnd - ETnu)*(VN - EVnd) / (EVnu - EVnd); update the sound loudness at the end point based on the time point of the new end point.
[0036] Preferably, the associated data further includes a time point; the method for determining snoring of an audio signal within a preset period based on the sound loudness of the updated envelope start point, the sound loudness of the midpoint, the sound loudness of the end point, and the sound loudness of the ambient sound specifically includes:
[0037] If the sound loudness of the start point, the sound loudness of the midpoint, and the sound loudness of the end point are all different, and the sound loudness of the midpoint and the sound loudness of the ambient sound are greater than or equal to a second preset loudness, and the time difference between the end point and the start point is within a first preset time range, it is determined that there is snoring in the audio signal within the preset period.
[0038] Preferably, after it is determined that there is snoring in the audio signal within the preset period, it further includes:
[0039] Obtain the pressure signal borne by the pillow used by the target object within the preset period;
[0040] Judge the amplitude of the pressure signal;
[0041] When the amplitude of the pressure signal exceeds a preset threshold within the preset period, it is recognized that there is snoring within the preset period.
[0042] Preferably, when the amplitude of the pressure signal exceeds a preset threshold within the preset period and it is recognized that there is snoring within the preset period, it specifically includes:
[0043] When the amplitude of the pressure signal exceeds a preset threshold within the preset period, mark the peak position corresponding to the audio signal at this time, and mark the number of times the amplitude exceeds the preset threshold;
[0044] When the number is greater than or equal to 1, obtain the time interval between the two times;
[0045] When the time interval is within a second preset time range, it is recognized that there is snoring within the preset period.
[0046] In a second aspect, a snoring recognition device includes:
[0047] An audio signal acquisition module, configured to acquire an audio signal within a preset period;
[0048] An envelope number acquisition module, configured to draw an envelope line based on the audio signal and acquire the number of envelopes in the envelope line; wherein, each envelope includes an ascending curve and a descending curve;
[0049] A sound loudness and time acquisition module, configured to acquire the associated data of the start point, the midpoint, and the end point of each envelope; wherein, the midpoint is the point with the largest sound loudness value; the associated data includes sound loudness;
[0050] A snoring judgment module, configured to judge whether there is snoring in an audio signal within a preset period based on the associated data of each envelope start point, midpoint, and end point; if the sound loudness at the start point, the sound loudness at the midpoint, and the sound loudness at the end point are all different, and the sound loudness at the midpoint is greater than or equal to a second preset loudness, it is determined that there is snoring in the audio signal within the preset period.
[0051] In a third aspect, a snoring prevention device control device includes:
[0052] a processor; and
[0053] a memory for storing executable instructions of the processor;
[0054] wherein, the processor is configured to execute the snoring recognition method by executing the executable instructions.
[0055] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the snoring recognition method according to any one of the above.
[0056] The present invention has the following beneficial effects:
[0057] (1) The present invention collects audio signals in real time, performs dimensionality reduction processing on the collected audio signals, can greatly reduce storage consumption and can retain most of the time-domain features;
[0058] (2) Based on preset sound loudness conditions and time conditions, the present invention performs removal operations on extreme points that do not meet the conditions, can eliminate interference clutter, exclude wavelet envelope interference, and can better determine the time nodes of the audio signal envelope in combination with ambient sound;
[0059] (3) The present invention judges whether there is snoring in an audio signal within a preset period based on the associated data of each envelope start point, the associated data of the midpoint, the associated data of the end point, and the sound loudness of the ambient sound. Through screening and misjudgment analysis, the preliminary recognition accuracy is greatly improved;
[0060] (4) When it is initially determined based on the audio signal that there is snoring, the present invention further judges the time interval of continuous snoring based on the pressure signal of the pillow, improving the recognition accuracy.
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for description in the embodiments. Obviously, the following described accompanying drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. Description of the Drawings
[0062] Figure 1Flow chart of the snoring recognition method based on audio signals according to an embodiment of the present invention;
[0063] Figure 2 Flow chart of the snoring recognition method based on audio signals and pressure signals according to an embodiment of the present invention;
[0064] Figure 3 Schematic diagram before and after dimensionality reduction of audio signals according to an embodiment of the present invention; wherein, (a) represents the original signal and (b) represents the signal after dimensionality reduction;
[0065] Figure 4 Schematic diagram of the envelope before and after optimization according to an embodiment of the present invention; wherein, (a) represents before optimization and (b) represents after optimization;
[0066] Figure 5 Envelope schematic diagram according to an embodiment of the present invention;
[0067] Figure 6 Ambient sound schematic diagram according to an embodiment of the present invention;
[0068] Figure 7 Envelope line schematic diagram drawn based on ambient sound according to an embodiment of the present invention;
[0069] Figure 8 Schematic diagram of the pressure signal borne by the pillow used by the target object after filtering processing according to an embodiment of the present invention;
[0070] Figure 9 Schematic diagram of the pillow used by the target object according to an embodiment of the present invention;
[0071] Figure 10 Structural block diagram of the snoring recognition device according to an embodiment of the present invention;
[0072] Figure 11 Hardware structure schematic diagram of the electronic device for executing the snoring recognition method according to an embodiment of the present invention. Detailed implementation manners
[0073] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention; obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0074] In the description of the present invention, it should be noted that the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
[0075] In the description of the present invention, it should be noted that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.
[0076] In the description of the present invention, it should be noted that unless otherwise clearly specified and defined, the step identifiers S101, S102, S103, etc. are only used for convenience of expression and do not represent the execution order, and the corresponding execution order can be adjusted.
[0077] See Figure 1 As shown, a snoring recognition method of the present invention includes:
[0078] S101, obtaining an audio signal within a preset time period;
[0079] S102, drawing an envelope line based on the audio signal and obtaining the number of envelopes in the envelope line; wherein, each envelope includes an ascending curve and a descending curve;
[0080] S103, obtaining the associated data of the starting point, midpoint and ending point of each envelope; wherein, the midpoint is the point with the maximum sound loudness value; the associated data includes sound loudness;
[0081] S104, performing snoring judgment on the audio signal within the preset time period based on the associated data of the starting point, midpoint and ending point of each envelope; if the sound loudness of the starting point, the sound loudness of the midpoint and the sound loudness of the ending point are all different, and the sound loudness of the midpoint is greater than or equal to a second preset loudness, it is determined that there is snoring in the audio signal within the preset time period.
[0082] The above S101 - S104 of the snoring recognition method in this embodiment can be implemented by a snoring prevention pillow device (the pillow used by the target object) and / or intelligent terminal devices, etc. As long as these devices have the function of collecting sound (such as a microphone, etc.) and / or have a processor function (such as a microcontroller), specifically, it can also be that one terminal is responsible for collection (such as the snoring prevention pillow is responsible for collection), and another terminal is responsible for processing (such as the mobile phone terminal is responsible for processing), or both collection and processing are implemented by one terminal. Specifically, this embodiment does not make any restrictions. Further, the intelligent terminal device can be a mobile phone, a tablet computer, a wearable device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. This embodiment does not make any restrictions on the specific type of the terminal device.
[0083] In this embodiment, in order to further improve the recognition accuracy, after initially judging that there is snoring based on the audio signal, it is further judged in combination with the pressure signal. Specifically, it further includes:
[0084] Obtain the pressure signal borne by the pillow used by the target object within a preset time period;
[0085] Judge the amplitude of the pressure signal;
[0086] When the amplitude of the pressure signal exceeds the preset threshold within the preset time period, it is recognized that there is snoring within this preset time period.
[0087] See Figure 2 As shown, the following will take the monitoring interval with a preset time period length of 3s to monitor the audio signal and the airbag pressure signal (the airbag pressure signal of the pillow used by the target object) as an example for illustration.
[0088] Step 1, select a monitoring interval with a length of 3s to monitor the audio signal and the airbag pressure signal, and the buffer interval is 1s (the duration of general snoring is about 1s - 2s, and the interval between consecutive snores is between 3 - 5s. Therefore, the monitoring interval for snoring is selected as 3s).
[0089] Step 2, perform dimensionality reduction processing on the audio signal, and store the collected audio signal with a reduced sampling rate. See Figure 3 As shown, using the audio signal after dimensionality reduction for subsequent processing can greatly reduce the storage consumption and can retain most of the time-domain features.
[0090] Specifically, for example, reducing the sampling rate to 314hz to extract the audio signal means extracting once every 314 points.
[0091] Step 3: Draw the envelope of the dimension-reduced audio signal, record the ambient sound, and preliminarily determine whether it is snoring. The specific steps are as follows.
[0092] (1) The audio sampling rate is 16K. The original data volume of 3s of audio is 48K. Take the original audio data at fixed intervals, reduce the dimension to 1K, and finally process it into sound loudness values (DB).
[0093] (2) Extract the extreme points of the 1K sound loudness data to form a preliminary extreme point array.
[0094] (3) Traverse the extreme point array and mark three extreme points that satisfy the "V" shape. The starting point of the "V" shape is denoted as Pns, the corresponding sound loudness is denoted as Vns, the corresponding time point is denoted as Tns, the lowest point is denoted as Pnm, the corresponding sound loudness is denoted as Vnm, the corresponding time point is denoted as Tnm, the ending point is denoted as Pne, the corresponding sound loudness is denoted as Vne, and the corresponding time point is denoted as Tne.
[0095] (4) When the following conditions are met, remove the lowest point of the "V" shape until there are no more points that meet the following conditions:
[0096] a) When (Tne - Tns) < 400ms, remove the lowest point of this "V" shape;
[0097] b) When 400ms ≤ (Tne - Tns) < 1000ms and (Vne - Vnm) ≤ 18db and (Vns - Vnm) ≤
[0098] 18db, remove the lowest point of this "V" shape;
[0099] c) When 1000ms ≤ (Tne - Tns) < 1400ms and (Vne - Vnm) ≤ 15db and (Vns - Vnm) ≤
[0100] 15db, remove the lowest point of this "V" shape;
[0101] d) When 1400ms ≤ (Tne - Tns) < 1800ms and (Vne - Vnm) ≤ 12db and (Vns - Vnm) ≤
[0102] 12db, remove the lowest point of this "V" shape;
[0103] e) When 1800ms ≤ (Tne - Tns) < 2200ms and (Vne - Vnm) ≤ 9db and (Vns - Vnm) ≤
[0104] 9db, remove the lowest point of this "V" shape;
[0105] f) When 2200 ms ≤ (Tne - Tns) < 2600 ms, (Vne - Vnm) ≤ 7 dB, and (Vns - Vnm) ≤
[0106] 7 dB, remove the lowest point of the "V" shape;
[0107] g) When 2600 ms ≤ (Tne - Tns) < 3000 ms, (Vne - Vnm) ≤ 5 dB, and (Vns - Vnm) ≤
[0108] 5 dB, remove the lowest point of the "V" shape.
[0109] For the schematic diagrams of the envelope curves before and after optimization, see Figure 4 as shown. The purpose of this operation is to remove interference clutter, eliminate wavelet envelope interference, and better determine the time nodes of the sound signal envelope in combination with the ambient sound.
[0110] (5) After obtaining the envelope points (the envelope points are the points that make up the envelope curve) and the envelope curve of the 3 - second audio data through step (4), traverse the envelope points. The total number of envelopes is denoted as n. Mark the starting point, mid - point, and ending point of each envelope (a continuous rise or continuous fall can be regarded as the same segment, and an envelope that contains only one rising curve and one falling curve can be regarded as an envelope. See Figure 5 as shown). The sound loudness corresponding to the starting point is denoted as EVns, the corresponding time point is denoted as ETns, the sound loudness corresponding to the mid - point is denoted as EVnm, the corresponding time point is denoted as ETnm, the sound loudness corresponding to the ending point is denoted as EVne, and the corresponding time point is denoted as Etne.
[0111] (6) Denote the loudness value of the current sleep ambient sound as VN. The determination method of the VN value is as follows: in the current 3 - second audio, if the number of envelopes contained is less than or equal to 2, and the fluctuation of the loudness value of the envelopes does not exceed 0.8 dB, then it can be considered that there is no other sound in this 3 - second period, which belongs to the sleep ambient sound. Take the average loudness value of this 3 - second audio as the VN value. The judgment formula is denoted as n ≤ 2, (EVnm - EVns) ≤ 0.8 dB, and (EVnm - EVne) ≤ 0.8 dB.
[0112] See Figure 6 as shown. The dashed line is the loudness VN of the ambient sound. See Figure 7 as shown. The dashed line is the determined ambient sound VN.
[0113] By recording the ambient sound, the audio signal can be segmented, and further determine the number of envelopes, the starting and ending points, and the amplitude.
[0114] (7) If the loudness value of the sleep ambient sound is not obtained, continue to obtain it without making snoring recognition judgment, and repeat the previous step (6).
[0115] (8) If the loudness value of the sleep environment sound has been obtained, then based on the loudness of the ambient sound, further narrow the starting point, midpoint, and ending point of the envelope, and process as follows.
[0116] When EVnm ≤ VN, this envelope is invalid;
[0117] When EVnm > VN and (EVnm - VN) ≤ 1 db, this envelope is invalid;
[0118] When EVnm > VN and (EVnm - VN) > 1 db, this envelope is valid, and the number of valid envelopes is recorded as EN.
[0119] (9) If EN = 0, update VN and repeat the previous step (8).
[0120] (10) If EN ≠ 0, traverse all envelopes and recalculate the starting point and ending point of the envelope based on the VN value, and process as follows.
[0121] a) When EVns < VN, it indicates that there is an intersection between the ambient sound and the rising part of this envelope. Find two adjacent points in this envelope, one point is larger than VN, the corresponding sound loudness is recorded as EVnu, the corresponding time point is recorded as ETnu, one is smaller than VN, the corresponding sound loudness is recorded as EVnd, the corresponding time point is recorded as ETnd, and the intersection of the two adjacent points is used as the new starting point, and the time point ETns = ETnd + (ETnu - ETnd) * (VN - EVnd) / (EVnu - EVnd);
[0122] b) When EVns > VN, it indicates that there is an intersection between the ambient sound and the falling part of this envelope. Find two adjacent points in this envelope, one point is larger than VN, the corresponding sound loudness is recorded as EVnu, the corresponding time point is recorded as ETnu, one is smaller than VN, the corresponding sound loudness is recorded as EVnd, the corresponding time point is recorded as ETnd, and the intersection of the two adjacent points is used as the new ending point, and the time point ETne = ETnd - (ETnd - ETnu) * (VN - EVnd) / (EVnu - EVnd).
[0123] (11) Traverse the valid envelopes. Meeting certain conditions can determine whether it is snoring, as follows.
[0124] When EVns = EVnm, the starting point and the midpoint are the same, indicating that the collected sound is very loud at the beginning and then becomes smaller, and it is judged as interference sound, CN = 1;
[0125] When EVne = EVnm, the midpoint and the ending point are the same, indicating that there is still the second half of the collected sound, and the envelope is incomplete. More sound needs to be collected for judgment, LN = 1;
[0126] When EVns≠EVnm, EVne≠EVnm, (EVnm - VN)≥Th, and S1≤(ETne - ETns)≤S2, it indicates that the collected sound is suspected to be snoring, and HN = 1; Th is taken as 5db. Generally, the snoring sound is at least 5db louder than the ambient sound. S1 is taken as 500ms, and S2 is taken as 1200s. Generally, the duration of a single snoring sound is between 0.5s and 1.2s.
[0127] (12) Finally confirm whether there is snoring by judging the values of CN, LN, and HN.
[0128] a) When CN = 0, LN = 0, and HN = 1, it is considered that there is snoring in the current 3 - second audio; otherwise, there is no snoring, or there is interference sound, or the envelope is incomplete.
[0129] b) When CN = 0, LN = 0, and HN = 0, it is considered that there is no other sound in the current 3 seconds, which belongs to the sleep ambient sound, and the average loudness value of this 3 - second audio is used to update the VN value.
[0130] c) When CN = 0, LN = 0, and HN = 2 appear regularly in succession, it is considered that the snoring of this snorer may have a situation containing two envelopes, and it can be self - learned to determine that there is snoring in this 3 - second audio.
[0131] The above - mentioned method for extracting audio features judges whether it is snoring by drawing and optimizing the envelope line, and conducts misjudgment analysis through the characteristics of the snoring envelope and the periodicity of snoring, reducing the misjudgment rate.
[0132] Step 4, perform S - G filtering on the airbag pressure signal within the preset time period length. S - G filtering is fully called Savitzky - Golay filtering, and its function is data smoothing processing. The effect is shown in Figure 8 as shown.
[0133] The deformation of the pillow caused by snoring is generally greater than that during normal breathing. Calculate the air pressure amplitude at this time, and judge whether the amplitude of the airbag pressure signal exceeds the threshold. If it exceeds, proceed to the next step; otherwise, return to continue monitoring the signal.
[0134] Step 5, mark the peak position of the audio at this time, record it as Tnum, num = num + 1, and continue to monitor the signal. This step records the time point with the largest db value in 3s as the moment when snoring occurs, so as to calculate the interval between two snoring sounds later. Here, continuing to monitor is to detect whether there is snoring in the next 3 - second segment, calculate whether the interval between two snoring sounds meets the threshold. If it meets, both of these two times are determined to be snoring. Previously, it was determined to be suspected snoring, and here it is re - determined, and then num is cleared.
[0135] Step 6, when num > 1, calculate r = Tnum1 - Tnum2, and determine whether threshold1 < r < threshold2 holds. If it holds, it is determined as snoring, set num to 0, and continue to monitor the sound signal. Here, Tnum2 represents the previous peak position, and Tnum1 represents the next peak position.
[0136] See Figure 9 As shown, it is a schematic diagram of the pillow used by the target object in this embodiment, including a pillow body 901, an air pump box 903, and an air tube 902 disposed between the pillow body 901 and the air pump box 903. One or more airbags are disposed inside the pillow body 901. The air pump box 903 is used to inflate, deflate, or maintain pressure in the airbag. The pillow may further include a pressure acquisition module for acquiring the air pressure value in the airbag, i.e., the pressure signal.
[0137] See Figure 10 As shown, this embodiment also discloses a snoring recognition device, including:
[0138] An audio signal acquisition module 1001 for acquiring an audio signal within a preset time period;
[0139] An envelope number acquisition module 1002 for drawing an envelope line based on the audio signal and acquiring the number of envelopes in the envelope line; wherein each envelope includes an ascending curve and a descending curve;
[0140] A sound loudness acquisition module 1003 for acquiring associated data of the starting point, midpoint, and ending point of each envelope; wherein the midpoint is the point with the maximum sound loudness value; the associated data includes sound loudness;
[0141] A snoring judgment module 1004 for judging whether there is snoring in the audio signal within a preset time period based on the associated data of the starting point, midpoint, and ending point of each envelope; if the sound loudness at the starting point, the sound loudness at the midpoint, and the sound loudness at the ending point are all different, and the sound loudness at the midpoint is greater than or equal to the second preset loudness, it is judged that there is snoring in the audio signal within the preset time period.
[0142] Other specific implementations of a snoring recognition device are the same as those of a snoring recognition method, and will not be repeated in this embodiment.
[0143] See Figure 11 As shown is a schematic hardware structure diagram of an electronic device 110 for the snoring recognition method provided in this embodiment. As Figure 11 shown, the electronic device 110 includes:
[0144] One or more processors 1101 and a memory 1102, Figure 11 Taking one processor 1101 as an example.
[0145] The processor 1101 and the memory 1102 can be connected by a bus or other means. Figure 11 Take the connection through the bus as an example.
[0146] As a non-volatile computer-readable storage medium, the memory 1102 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 recognition method in the embodiments of the present application. By running the non-volatile software programs, instructions, and modules stored in the memory 1102, the processor 1101 executes various functional applications of the terminal device or the server and completes data processing, that is, implements the snoring recognition method in the above method embodiments.
[0147] The memory 1102 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the snoring recognition device, etc. In addition, the memory 1102 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 1102 can optionally include a memory remotely set relative to the processor 1101, and these remote memories can be connected to the snoring recognition device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0148] The one or more modules are stored in the memory 1102 and, when executed by the one or more processors 1101, execute the snoring recognition method in any of the above method embodiments. For example, execute the Figure 1 method steps S101 to S104 described above to implement Figure 10 the functions of the modules 1001-1004 in
[0149] The above product can execute the method provided in the embodiments of the present application and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the method provided in the embodiments of the present application.
[0150] The electronic device in the embodiments of the present application exists in various forms, including but not limited to:
[0151] (1) Mobile communication devices: These devices are characterized by having mobile communication functions and mainly aim to provide voice and data communication. Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones, etc.
[0152] (2) Ultra-mobile personal computer devices: This type of device belongs to the category of personal computers, has computing and processing functions, and generally also has the feature of mobile Internet access. Such terminals include: PDA, MID, UMPC devices, etc., such as iPad.
[0153] (3) Servers: Devices that provide computing services. The composition of a server includes a microcontroller, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but due to the need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc.
[0154] (4) Other electronic devices with data interaction functions.
[0155] The embodiments of the present application provide a non-volatile computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, which are executed by one or more microcontrollers. For example Figure 11 a processor 1101 in Figure 1 can enable the above one or more microcontrollers to execute the snoring recognition method in any of the above method embodiments. For example, execute the method steps 101 to step S104 described above to implement Figure 11 the functions of modules 1001-1004 in
[0156] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0157] Through the description of the above embodiments, those of ordinary skill in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course also by hardware. Those of ordinary skill in the art can understand that all or part of the processes of implementing the above embodiment methods can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. Among them, the storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0158] The above are only the preferred specific embodiments of the present invention; however, the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution of the present invention and its improved concept, making equivalent substitutions or changes, shall be covered by the protection scope of the present invention.
Claims
1. A snoring recognition method, characterized in that, Including: Obtain the audio signal within a preset time period; Draw an envelope based on the audio signal, and obtain the number of envelopes in the envelope; wherein, each envelope includes an ascending curve and a descending curve; Obtain the associated data of the starting point, midpoint and ending point of each envelope; wherein, the midpoint is the point with the maximum sound loudness value; the associated data includes sound loudness; Judge snoring of the audio signal within the preset time period based on the associated data of the starting point, midpoint and ending point of each envelope; if the sound loudness of the starting point, the sound loudness of the midpoint and the sound loudness of the ending point are all different, and the sound loudness of the midpoint is greater than or equal to the second preset loudness, it is judged that there is snoring in the audio signal within the preset time period.
2. The snoring recognition method according to claim 1, characterized in that, Before drawing the envelope based on the audio signal, it further includes: Perform downsampling processing on the audio signal to obtain a downsampled audio signal.
3. The snoring recognition method according to claim 1, characterized in that, The drawing of the envelope based on the audio signal and obtaining the number of envelopes in the envelope specifically includes: Convert the audio signal into sound loudness data, and draw an initial envelope based on the sound loudness data; Extract the extreme points of the sound loudness data to generate a preliminary extreme point array; Traverse the extreme point array, mark three extreme points that satisfy the "V" shape, and obtain the associated data of the three extreme points; wherein, the three extreme points are the starting point, the lowest point and the ending point respectively; Based on the preset sound loudness condition and time condition, perform removal operation on the extreme points that do not meet the conditions; Obtain an optimized envelope based on the extreme points after the removal operation; Based on the optimized envelope, obtain the number of envelopes.
4. The snoring recognition method according to claim 1, characterized in that, After obtaining the associated data of the starting point, midpoint and ending point of each envelope, it further includes: Obtain the sound loudness of the ambient sound; The judging of snoring of the audio signal within the preset time period based on the associated data of the starting point, midpoint and ending point of each envelope specifically includes: Judge snoring of the audio signal within the preset time period based on the associated data of the starting point of each envelope, the associated data of the midpoint, the associated data of the ending point and the sound loudness of the ambient sound.
5. The snoring recognition method according to claim 4, characterized in that, The judging of snoring of the audio signal within the preset time period based on the associated data of the starting point of each envelope, the associated data of the midpoint, the associated data of the ending point and the sound loudness of the ambient sound specifically includes: Judge whether the envelope is a valid envelope based on the sound loudness of the ambient sound and the sound loudness of the envelope midpoint; When it is a valid envelope, update the sound loudness of the starting point and the ending point of the envelope based on the sound loudness of the ambient sound; Judge snoring of the audio signal within the preset time period based on the updated sound loudness of the starting point of the envelope, the sound loudness of the midpoint, the sound loudness of the ending point and the sound loudness of the ambient sound.
6. The snoring recognition method according to claim 5, characterized in that, The judging of whether the envelope is a valid envelope based on the sound loudness of the ambient sound and the sound loudness of the envelope midpoint specifically includes: When the sound loudness of the envelope midpoint is not greater than the sound loudness of the ambient sound, judge that the envelope is invalid; When the sound loudness of the envelope midpoint is greater than the sound loudness of the ambient sound and the difference between the two is within the first preset loudness, judge that the envelope is invalid; Otherwise, judge that the envelope is valid.
7. The snoring recognition method according to claim 5, characterized in that, The associated data further includes a time point; updating the sound loudness of the starting point and the ending point of the envelope based on the sound loudness of the ambient sound specifically includes: When the sound loudness of the starting point of the envelope is less than the sound loudness VN of the ambient sound, find two adjacent points in the envelope; among them, the sound loudness EVnu of one point is greater than the sound loudness of the ambient sound, and the corresponding time point is denoted as ETnu; the sound loudness EVnd of the other point is less than the sound loudness of the ambient sound, and the corresponding time point is denoted as ETnd; use the intersection point of these two points as the new starting point, and the time point of the new starting point is ETns = ETnd + (ETnu - ETnd) * (VN - EVnd) / (EVnu - EVnd); update the sound loudness of the starting point based on the time point of the new starting point; When the sound loudness of the starting point of the envelope is greater than the sound loudness VN of the ambient sound, find two adjacent points in the envelope; among them, the sound loudness EVnu of one point is greater than the sound loudness of the ambient sound, and the corresponding time point is denoted as ETnu; the sound loudness EVnd of the other point is less than the sound loudness of the ambient sound, and the corresponding time point is denoted as ETnd; use the intersection point of these two points as the new ending point, and the time point of the new ending point is ETne = ETnd - (ETnd - ETnu) * (VN - EVnd) / (EVnu - EVnd); update the sound loudness of the ending point based on the time point of the new ending point.
8. The snoring recognition method according to claim 5, characterized in that, The associated data further includes a time point; performing snore judgment on the audio signal within a preset period based on the updated sound loudness of the starting point of the envelope, the sound loudness of the midpoint, the sound loudness of the ending point, and the sound loudness of the ambient sound, specifically including: If the sound loudness of the starting point, the sound loudness of the midpoint, and the sound loudness of the ending point are all different, and the sound loudness of the midpoint and the sound loudness of the ambient sound are greater than or equal to the second preset loudness, and the time difference between the ending point and the starting point is within the first preset time range, it is determined that there is a snore in the audio signal within the preset period.
9. The snoring recognition method according to claim 1, wherein, After determining that there is a snore in the audio signal within the preset period, it further includes: Obtaining the pressure signal borne by the pillow used by the target object within the preset period; Judging the amplitude of the pressure signal; When the amplitude of the pressure signal exceeds the preset threshold within the preset period, it is recognized that there is a snore within the preset period.
10. The snoring recognition method according to claim 9, wherein, The step of when the amplitude of the pressure signal exceeds the preset threshold within the preset period and recognizing that there is a snore within the preset period specifically includes: When the amplitude of the pressure signal exceeds the preset threshold within the preset period, mark the peak position corresponding to the audio signal at this time, and mark the number of times the amplitude exceeds the preset threshold; When the number is greater than or equal to 1, obtain the time interval between the two times; When the time interval is within the second preset time range, it is recognized that there is a snore within the preset period.
11. A snoring recognition device, wherein, It includes: An audio signal acquisition module for acquiring the audio signal within the preset period; An envelope number acquisition module for drawing an envelope line based on the audio signal and acquiring the number of envelopes in the envelope line; wherein, each envelope includes an ascending curve and a descending curve; A sound loudness and time acquisition module, configured to acquire associated data of each envelope start point, midpoint, and end point; wherein, the midpoint is the point with the maximum sound loudness value; the associated data includes sound loudness. A snore judgment module, configured to judge whether there is a snore in an audio signal within a preset period based on the associated data of each envelope start point, midpoint, and end point; if the sound loudness at the start point, the sound loudness at the midpoint, and the sound loudness at the end point are all different, and the sound loudness at the midpoint is greater than or equal to a second preset loudness, it is judged that there is a snore in the audio signal within the preset period.
12. A device control device for anti-snoring, wherein, Comprising: A processor; And A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the method according to any one of claims 1 to 10 by executing the executable instructions.
13. A computer-readable storage medium, on which a computer program is stored, wherein, When the computer program is executed by the processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Snore monitoring method and system based on deep learning algorithm and corresponding electric bed control method and system
CN113599052A
Cited By
Snore monitoring method and device for sleep apnea pathology identification
CN120570572A