An indoor positioning method based on electrical appliance ultrasonic signals
By collecting and processing ultrasonic signals from household appliances, and combining machine learning models and post-processing methods, the problem of balancing equipment deployment costs and positioning accuracy was solved, achieving high-precision indoor positioning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2022-10-28
- Publication Date
- 2026-06-23
AI Technical Summary
How to strike a balance between equipment deployment costs and positioning accuracy? Existing indoor positioning systems struggle to effectively utilize the ultrasonic noise from household appliances as opportunistic signals for high-precision positioning.
The ultrasonic signals of electrical appliances are collected using a microphone and sound card. A fingerprint database is established through filtering and feature extraction. The fingerprint database is then matched and identified using a machine learning model. A random forest classifier and post-processing methods are used to ensure the reliability of the matching results, thereby enabling indoor positioning of the ultrasonic signals of electrical appliances.
Without requiring additional infrastructure or fingerprint data updates, it improves positioning accuracy, reduces drift errors, and achieves sub-meter level positioning accuracy and high recall rate.
Smart Images

Figure CN115754904B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of indoor positioning system (IPS) technology, and in particular to an indoor positioning method based on ultrasonic signals from electrical appliances. Background Technology
[0002] Indoor Positioning Systems (IPS) are a critical infrastructure for enabling location-based services (LBS) such as indoor navigation and geofencing. Achieving a balance between equipment deployment costs and positioning accuracy is one of the main challenges in current indoor positioning research.
[0003] Many household appliances emit unique ultrasonic noises during operation, which can be used as a novel Signal of Opportunity (SOP) for indoor positioning systems. This signal offers advantages such as widespread availability, high stability, non-intrusiveness, and no privacy breaches. This invention provides an indoor positioning method based on the ultrasonic signals of electrical appliances. This method eliminates the need for deploying additional infrastructure or frequently updating fingerprint data, balancing the dual requirements of device deployment cost and positioning accuracy. Summary of the Invention
[0004] To improve the positioning capabilities of existing positioning systems in complex indoor environments, this invention provides an indoor positioning method based on ultrasonic signals from electrical appliances. This method utilizes the ultrasonic noise emitted by indoor electrical appliances as an opportunity signal, thereby further improving indoor positioning accuracy while taking into account equipment deployment costs.
[0005] The technical solution adopted by this invention to solve its technical problem is:
[0006] An indoor positioning method based on ultrasonic signals from electrical appliances, the method comprising the following steps:
[0007] Step 1, Preparation stage: Prepare a microphone without special noise reduction processing and a sound card that can perform ultrasonic sampling for subsequent acquisition of electrical appliance sound;
[0008] Step 2, Offline Training Phase: Use the microphone and sound card device from Step 1 to collect sound data from multiple electrical appliances in the environment, filter and extract features to create a fingerprint database, and record the location of the corresponding electrical appliances.
[0009] Step 3, Online Identification Stage: Based on the sound data collected during the user's actual movement, a classification or template matching method is used to match the fingerprint database established in Step 2 to determine whether the user's current location is near a specific appliance; at the same time, the reliability of the above matching results needs to be judged. If it is reliable, it can be used as the user's final location result.
[0010] Furthermore, in step 2, the steps for establishing the fingerprint database are as follows:
[0011] Step 2-1: Using the sound acquisition device described in Step 1, approach multiple electrical appliances in the environment and remain stationary to collect sound data. Then, filter out white noise to obtain x. i (t), this signal is called "raw sound data";
[0012] Step 2-2: Perform high-pass filtering on the raw sound data obtained in step 2-1. The processed signal is called the "ultrasonic signal".
[0013] Step 2-3: Perform a short-time Fourier transform on the ultrasound signal obtained in step 2-2 to obtain the "frequency characteristics":
[0014]
[0015] In the formula, x(τ) is the ultrasonic signal, h(τ-t) is the analysis window function, T is the number of points of frequency feature in the time dimension, and F is the number of points of frequency feature in the frequency dimension.
[0016] Furthermore, in step 3, the classification or template matching method employs a machine learning model, and the fingerprint information matching steps are as follows:
[0017] Step 3-1, use the M electrical appliances APP1, APP2, ... APP obtained in Step 2 M Using the frequency features as the training set, a machine learning model is trained as a classifier.
[0018] Step 3-2, for the frequency feature A obtained in step 2-3 F×T The analysis was performed, and each time point t was analyzed. i eigenvectors A[:,t i The data is fed into a trained machine learning model for classification, resulting in a one-dimensional vector V.
[0019]
[0020] Among them, v i =ML(A[:,t i ]), v i ∈{N / A,APP1,APP2,…APP M};
[0021] In the formula, ML represents the classification process using a machine learning model, and t i Let v represent the i-th time point. i The classification results are as follows: N / A represents no electrical appliances, and APP1, APP2, ... represent different electrical appliances.
[0022] Step 3-3: Based on the actual situation, set two states, 0 and 1. State 0 indicates that there are currently no appliances, and state 1 indicates that there are currently appliances. Set three positive integer parameters, namely the starting matching length λ. s Acceptable number of consecutive outliers λ o The shortest matching length λ e This is used in the subsequent matching process;
[0023] Steps 3-4, based on v at each time point i The system sequentially determines whether the matching result is reliable. The initial state is set to 0 by default, meaning there are no electrical appliances at this stage. When the first v appears... i =a, a∈{APP1, APP2,…APP M Let time be T1, and when there exists a continuous λ s The same judgment v i When = a, then transition to state 1. At this point, it is assumed that there may be electrical appliances in this stage; the recording time is T1+λs-1.
[0024] Steps 3-5: When in state 1, from T1+λ s Continue judging vi from the beginning, when the first v appears. i When ≠a, let the time be T2. If n consecutive outliers v appear after T2, i ≠a and n≥λ o If the condition is met, the current judgment is terminated; otherwise, T2 is cleared and the judgment continues. The time when consecutive abnormal values occur is recorded from T2 to T2+n+1. At this time, the length of the entire state 1 is L = T2-T1.
[0025] Steps 3-6, if length L ≥ λ e If the duration of an electrical appliance's existence is considered longer than the shortest matching length, then the determination is considered reliable, and the determination is accepted. All classification results within that length are then considered valid. Set to v i =a; otherwise, the judgment is not accepted and is recorded as a misjudgment, and all classification results within that length are recorded. Set to v i =N / A;
[0026] Step 3-7: Repeat steps 3-4 to 3-6 until the end. At this point, the updated vector V can be used as the final localization result.
[0027] Alternatively, in step 3-1, the model training steps are as follows:
[0028] Step 3-1-1: Select the type of machine learning model, including support vector machine, random forest or convolutional neural network, and design the hyperparameters required for the model.
[0029] Step 3-1-2, for the M electrical appliances APP1, APP2, ... APP obtained in step 2 M The data is divided into training and validation sets based on frequency characteristics. The model is then trained and iterated to optimize it. The optimal model structure and hyperparameters are selected to obtain the final test model.
[0030] The model is trained and iterated to optimize it, and the optimal hyperparameters and loss function are selected to obtain the final test model.
[0031] The beneficial effects of this invention are mainly reflected in the following aspects: Firstly, the ultrasonic signal from an electrical appliance, as a novel opportunity signal, requires no additional infrastructure or extensive fingerprint collection and updating work compared to other positioning signals. Secondly, the post-processing of the matching results ensures a high recall rate even with 100% recognition accuracy. This opportunity signal can serve as a closed-loop detector and positioning anchor point, and when combined with other positioning systems, it greatly reduces drift errors and improves positioning accuracy. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the overall process of the present invention.
[0033] Figure 2 This is a sample of the original sound data for some electrical appliances.
[0034] Figure 3 This is a comparison of the confusion matrix of the random forest matching results before and after post-processing.
[0035] Figure 4 This is a schematic diagram showing the distribution of electrical anchor points in the experimental site and the movement paths of the experimental personnel.
[0036] Figure 5 A comparison of the results of the Pedestrian Dead Reckoning (PDR) positioning method and the PDR+ultrasound positioning method. Detailed Implementation
[0037] The present invention will now be further described with reference to the accompanying drawings.
[0038] Reference Figures 1-5 An indoor positioning method based on ultrasonic signals from electrical appliances includes the following steps:
[0039] Step 1, Preparation stage: Prepare a microphone without special noise reduction processing and a sound card that can perform ultrasonic sampling for subsequent acquisition of electrical appliance sound;
[0040] Step 2, Offline Training Phase: Use the microphone and sound card device from Step 1 to collect sound data from multiple electrical appliances in the environment, filter and extract features to create a fingerprint database, and record the location of the corresponding electrical appliances.
[0041] In step 2, the steps for establishing the fingerprint database are as follows:
[0042] Step 2-1, refer to Figure 2 Using the sound acquisition device described in step 1, sound data is collected by placing it near multiple electrical appliances in the environment while keeping them stationary. White noise is then filtered out to obtain x. i (t), this signal is called "raw sound data";
[0043] Step 2-2: Perform high-pass filtering on the raw sound data obtained in step 2-1. The processed signal is called the "ultrasonic signal".
[0044] Step 2-3: Perform a short-time Fourier transform on the ultrasound signal obtained in step 2-2 to obtain the "frequency characteristics":
[0045]
[0046] In the formula, x(τ) is the ultrasonic signal, h(τ-t) is the analysis window function, T is the number of points of the frequency feature in the time dimension, and F is the number of points of the frequency feature in the frequency dimension.
[0047] Here, the window function used is the Hamming window, with a window length of 1024 points, a window overlap of 256 points, and frequency points generated from the cutoff frequency to the highest original sound data frequency with a 500-point logarithmic spacing.
[0048] Step 3, Online Identification Stage. Based on the sound data collected during the user's actual movement, classification or template matching methods such as machine learning models are used to match the data with the templates in the fingerprint database established in Step 2 to determine whether the user's current location is near a specific appliance. At the same time, the reliability of the matching results needs to be determined. If the results are reliable, they can be used as the final location result for the user.
[0049] In step 3, the fingerprint information matching steps are as follows:
[0050] Step 3-1, use the M electrical appliances APP1, APP2, ... APP obtained in Step 2 M Using the frequency features as the training set, a machine learning model is trained as a classifier.
[0051] In step 3-1, the steps for training the machine learning model are as follows:
[0052] Step 3-1-1: Select the model type, including but not limited to support vector machine, random forest or convolutional neural network, and preliminarily design the hyperparameters required for the model;
[0053] Random Forest (RF) is chosen as the classification model here;
[0054] Step 3-1-2, for the M electrical appliances APP1, APP2, ... APP obtained in step 2 M The data is divided according to the frequency characteristics, and used as training set and validation set respectively. The model is trained and iterated and optimized to select the optimal model structure and hyperparameters to obtain the final test model.
[0055] After optimization, the forest hyperparameters are set as follows: forest size is set to the number of trees N=100, and tree depth is set to 20.
[0056] Step 3-2, for the frequency feature A obtained in step 2-3 F×T The analysis was performed, and each time point t was analyzed. i eigenvectors A[:,t i The data is fed into a trained random forest model for classification, resulting in a one-dimensional vector V:
[0057]
[0058] Among them, v i =ML(A[:,t i ]), v i ∈{N / A,APP1,APP2,…APP M};
[0059] In the formula, ML represents the classification process using a random forest model, and t i Let v represent the i-th time point. i The classification results are as follows: N / A represents no electrical appliances, and APP1, APP2, ... represent different electrical appliances.
[0060] Step 3-3: Based on the actual situation, set two states (0 and 1) and three parameters, including the initial matching length λ. s Acceptable number of consecutive outliers λ o The shortest matching length λ e Here, λ is set. s =62,λ o =3,λ e =375, initial matching result referenced Figure 3 ;
[0061] Steps 3-4, based on v at each time point i The reliability of the matching result is determined sequentially. The initial state is set to 0, meaning there are no electrical appliances in this stage; when the first v appears... i =a, a∈{APP i APP2, ...APP M Let time be T1. When there are 62 consecutive identical judgments v i When =a, then transition to state 1. At this point, it is assumed that there may be electrical appliances in this stage; the recording time is T1+61.
[0062] Steps 3-5: When in state 1, continue judging v starting from time T1+62. i When the first v appears i When ≠a, let the time be T2. If n consecutive outliers v appear after T2, i If ≠a and n≥3, then terminate this judgment; otherwise, clear T2 and continue the judgment. Record the time when consecutive outliers occur from T2 to T2+n+1. At this time, the length of the entire state 1 is L=T2-T1.
[0063] Steps 3-6: If the length L ≥ 375, meaning the appliance's existence time is greater than the shortest matching length, then the judgment is considered reliable, and this judgment is accepted. All classification results within this length are then processed. Set to v i =a; otherwise, the judgment is not accepted and is recorded as a misjudgment, and all classification results within that length are recorded. Set to v i =N / A;
[0064] Step 3-7: Repeat steps 3-4 to 3-6 until the end. The updated vector V is then used as the final localization result.
[0065] The indoor positioning method based on ultrasonic signals from electrical appliances proposed in this example, compared to other methods, requires no additional infrastructure installation, eliminates the need for extensive fingerprint collection and updating, and improves the accuracy of the indoor positioning system by updating the matching results through a post-processing method, while limiting equipment deployment costs. Furthermore, the method proposed in this patent can be combined with other indoor positioning technologies to further enhance performance. This example demonstrates the deployment and testing of positioning effects in a real office setting. The experimental site was located on the fifth floor of the Laosheng Instrument Building on the Yuquan Campus of Zhejiang University. The tester started from a known location and walked five laps along a designated route, covering a total distance of 621.58 meters. Eleven electrical appliance anchor points were set (one router, one printer, one server, four different desk lamps, one air conditioner, one air purifier, one computer, and no electrical appliances), including a white noise signal from a no-electrical-electrode environment. The distribution of the electrical appliance anchor points and the experimental personnel's movement path are shown in the diagram below. Figure 4As shown. The sound acquisition equipment used was a DOUBLE XO microphone and a YAMAHA Steinberg UR12 sound card.
[0066] from Figure 3 It can be seen that after using the matching result post-processing method, the ultrasound localization method can achieve a recall rate of 79.66% with 100% accuracy.
[0067] Figure 5 This image illustrates the localization results of using PDR alone versus combining it with ultrasound localization. The left image shows the result of PDR alone, and the right image shows the result of PDR + ultrasound localization. Figure 5 It can be seen that the angular deviation generated by using PDR positioning alone at the turning point is easy to accumulate after a long distance; while the original PDR result on the right, after combining with the ultrasonic positioning method, can be corrected at the anchor point, and the performance is greatly improved. The positioning accuracy is 95.43% higher than the original PDR system, reaching sub-meter accuracy, with an average position error of 0.76m.
[0068] The above embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Although the invention has been described in detail with reference to the embodiments, those skilled in the art should understand that various combinations, modifications, or equivalent substitutions of the technical solutions of the invention do not depart from the spirit and scope of the invention and should be covered within the scope of the claims of the invention.
Claims
1. An indoor positioning method based on electrical ultrasonic signals, characterized in that, The method includes the following steps: Step 1, Preparation stage: Prepare a microphone without special noise reduction processing and a sound card that can perform ultrasonic sampling for subsequent acquisition of electrical appliance sound; Step 2, Offline Training Phase: Use the microphone and sound card device from Step 1 to collect sound data from multiple electrical appliances in the environment, filter and extract features to create a fingerprint database, and record the location of the corresponding electrical appliances. Step 3, Online Identification Stage: Based on the sound data collected during the user's actual movement, a classification or template matching method is used to match the fingerprint database established in Step 2 to determine whether the user's current location is near a specific appliance; at the same time, the reliability of the above matching results needs to be judged, and if reliable, it is taken as the final location result of the user. In step 3, the classification or template matching method employs a machine learning model, and the fingerprint information matching steps are as follows: Step 3-1, use the M electrical appliances obtained in Step 2 Using the frequency features as the training set, a machine learning model is trained as a classifier. Step 3-2, analyze the frequency features obtained in step 2-3. The analysis will be performed at each time point. eigenvectors The data is fed into a trained machine learning model for classification to obtain a one-dimensional vector. : ; in, ; In the formula, ML represents the classification process using a machine learning model. Indicates the first At a certain point in time, For the classification results, where This indicates that there are no electrical appliances. Indicates different electrical appliances; Step 3-3: Based on the actual situation, set two states, 0 and 1. State 0 indicates that there are currently no appliances, and state 1 indicates that there are currently appliances. Set three positive integer parameters, which are the starting matching length. Acceptable number of consecutive outliers Shortest matching length This is used in the subsequent matching process; Steps 3-4, based on each time point The system sequentially determines whether the matching result is reliable. The initial state is set to 0 by default, meaning there are no electrical appliances in this stage. When the first... Time, record this moment as When there is a continuous Same judgment If the time is not specified, the process transitions to state 1, at which point it is assumed that electrical appliances may be present in that stage; the recording time is... ; Steps 3-5, when in state 1, from Continue to make judgments from the moment on. When the first one appears Time, record this moment as ,like Then n consecutive outliers appeared and If yes, then terminate this judgment; otherwise, clear. Continue the assessment and record the time when consecutive outliers occur. to The length of the entire state 1 at this time ; Steps 3-6, if the length If the duration of an electrical appliance's existence is considered longer than the shortest matching length, then the determination is considered reliable, and the determination is accepted. All classification results within that length are then considered valid. Set as Conversely, if the condition is not met, the judgment is rejected and recorded as a misjudgment, and all classification results within that length are recorded. Set as ; Step 3-7: Repeat steps 3-4 to 3-6 until the end. At this point, the updated vector... As the final positioning result.
2. The indoor positioning method based on electrical ultrasonic signals as described in claim 1, characterized in that, In step 2, the steps for establishing the fingerprint database are as follows: Step 2-1: Using the sound acquisition device described in Step 1, approach multiple electrical appliances in the environment and remain stationary to collect sound data. Then, filter out white noise to obtain... This signal is called "raw sound data"; Step 2-2: Perform high-pass filtering on the raw sound data obtained in step 2-1. The processed signal is called "ultrasonic signal". Step 2-3: Perform a short-time Fourier transform on the ultrasound signal obtained in step 2-2 to obtain the "frequency characteristics": ; In the formula, It is an ultrasound signal. The analysis window function is defined as follows: T represents the number of points of the frequency feature in the time dimension, and F represents the number of points of the frequency feature in the frequency dimension.
3. The indoor positioning method based on electrical ultrasonic signals as described in claim 1, characterized in that, In step 3-1, the model training steps are as follows: Step 3-1-1: Select the type of machine learning model, including support vector machine, random forest or convolutional neural network, and design the model structure and various hyperparameters in the preliminary stage; Step 3-1-2, for the M electrical appliances obtained in step 2 The data is divided into training and validation sets based on frequency characteristics. The model is then trained and iterated to optimize it. The optimal model structure and hyperparameters are selected to obtain the final test model.