CN111134637B - Signal processing method, signal processing device, electronic equipment and storage medium - Google Patents

Signal processing method, signal processing device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111134637B
CN111134637B CN201911243477.1A CN201911243477A CN111134637B CN 111134637 B CN111134637 B CN 111134637B CN 201911243477 A CN201911243477 A CN 201911243477A CN 111134637 B CN111134637 B CN 111134637B
Authority
CN
China
Prior art keywords
sampling
amplitude
frequency
value
vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911243477.1A
Other languages
Chinese (zh)
Other versions
CN111134637A (en
Inventor
邱文彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lumi United Technology Co Ltd
Original Assignee
Lumi United Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lumi United Technology Co Ltd filed Critical Lumi United Technology Co Ltd
Priority to CN201911243477.1A priority Critical patent/CN111134637B/en
Publication of CN111134637A publication Critical patent/CN111134637A/en
Application granted granted Critical
Publication of CN111134637B publication Critical patent/CN111134637B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/02Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
    • A61B5/0205Simultaneously evaluating both cardiovascular conditions and different types of body conditions, e.g. heart and respiratory condition
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/02Detecting, measuring or recording pulse, heart rate, blood pressure or blood flow; Combined pulse/heart-rate/blood pressure determination; Evaluating a cardiovascular condition not otherwise provided for, e.g. using combinations of techniques provided for in this group with electrocardiography or electroauscultation; Heart catheters for measuring blood pressure
    • A61B5/024Detecting, measuring or recording pulse rate or heart rate
    • A61B5/02416Detecting, measuring or recording pulse rate or heart rate using photoplethysmograph signals, e.g. generated by infrared radiation
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/08Detecting, measuring or recording devices for evaluating the respiratory organs
    • A61B5/0816Measuring devices for examining respiratory frequency
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/24Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
    • A61B5/316Modalities, i.e. specific diagnostic methods
    • A61B5/318Heart-related electrical modalities, e.g. electrocardiography [ECG]
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/48Other medical applications
    • A61B5/4806Sleep evaluation
    • A61B5/4815Sleep quality
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/72Signal processing specially adapted for physiological signals or for diagnostic purposes
    • A61B5/7235Details of waveform analysis

Abstract

The embodiment of the application discloses a signal processing method and device, electronic equipment and a storage medium. The method comprises the following steps: sampling an original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment, and storing the time domain sampling value into a sampling sequence; taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value; acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; and obtaining frequency amplitudes corresponding to all frequencies in the preset frequency interval according to the amplitude vector, and extracting the frequency of the maximum value of the frequency amplitudes. The frequency characteristics of the signals are extracted through iterative operation, and the operation amount is reduced, so that the signals can be detected in real time and processed, and detection with higher precision is realized.

Description

Signal processing method, signal processing device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of signal processing technologies, and in particular, to a signal processing method and apparatus, an electronic device, and a storage medium.
Background
With the development of science and technology, the living standard of people is improved, and the attention of people to health is higher and higher. The health state of people can be monitored by detecting vital sign parameters such as the respiratory rate and the heart rate of a human body, wherein the vital sign parameters such as the respiratory rate and the heart rate of the human body have important significance for sleep quality monitoring, respiratory disease prevention and diagnosis, cardiovascular disease prevention and diagnosis and the like.
However, when detecting vital sign parameters of a human body, real-time detection is difficult to realize.
Disclosure of Invention
The embodiment of the application provides a signal processing method and device, an electronic device and a storage medium, so as to solve the above problems.
In a first aspect, an embodiment of the present application provides a signal processing method, where the method includes: sampling an original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment, and storing the time domain sampling value into a sampling sequence, wherein the preset frequency interval is the frequency range of a target signal; taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value; acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; and obtaining the frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector, and extracting the frequency of the maximum value of the frequency amplitude.
In a second aspect, an embodiment of the present application provides a signal processing apparatus, including: the sampling module is used for sampling an original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment and storing the time domain sampling value into a sampling sequence, wherein the preset frequency range interval is the frequency range of a target signal; the intermediate value acquisition module is used for subtracting the time domain sampling values at the head and the tail of the sampling sequence to obtain an intermediate value; the vector acquisition module is used for acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; the iteration module is used for calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; and the signal acquisition module is used for acquiring the frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector and extracting the frequency of the maximum value of the frequency amplitude.
In a third aspect, embodiments of the present application provide an electronic device, which includes one or more processors, a memory, and a computer program stored in the memory and executable on the processors, and when executed by the processors, the computer program implements the method applied to the electronic device as described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
According to the signal processing method, the signal processing device, the electronic equipment and the storage medium, an original signal is sampled, a time domain sampling value of a preset frequency interval at the current sampling moment is obtained and stored in a sampling sequence; taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value; acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; and obtaining frequency amplitudes corresponding to all frequencies in the preset frequency interval according to the amplitude vector, and extracting the frequency of the maximum value of the frequency amplitudes. The frequency characteristics of the signals are extracted through iterative operation, the operation amount is reduced, and therefore the signals can be detected in real time and processed, and detection with higher precision is achieved.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 shows a flowchart of a signal processing method according to an embodiment of the present application.
Fig. 2 shows a flowchart of a signal processing method according to another embodiment of the present application.
Fig. 3 is a diagram illustrating a sample sequence storing time-domain sample values according to an embodiment of the present application.
FIG. 4 is a diagram illustrating a storage trigonometric function table according to an embodiment of the present application.
Fig. 5 shows a flowchart of step S240 in the signal processing method provided on the basis of the embodiment provided in fig. 2.
Fig. 6 shows a flowchart of a signal processing method according to another embodiment of the present application.
Fig. 7 is a functional block diagram of a signal processing apparatus according to an embodiment of the present application.
Fig. 8 shows a block diagram of an electronic device for executing a signal processing method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
With the development of science and technology, the living standard of people is improved, and the attention of people to the health is higher and higher. Generally, the health state of people can be monitored by detecting vital sign parameters such as the respiratory rate and the heart rate of a human body, wherein the vital sign parameters such as the respiratory rate and the heart rate of the human body have important significance on sleep quality monitoring, respiratory disease prevention and diagnosis, cardiovascular disease prevention and diagnosis and the like.
In detecting vital parameters such as respiratory rate or heart rate of a human body, there are various methods, such as Electrocardiogram (ECG), photoplethysmogram (PPG), ballistocardiogram (BCG), etc., which can detect respiratory rate or heart rate of a human body. When vital sign signals such as the respiratory rate or the heart rate of a human body are detected, the original signals need to be acquired, and after the original signals are processed and analyzed, vital sign information can be extracted from the original signals. Generally, when an original signal is processed and analyzed, the original signal needs to be filtered, and vital sign information can be extracted through time-frequency conversion.
Therefore, the inventor proposes a signal processing method in the embodiment of the present application, which samples an original signal, obtains a time domain sampling value of a preset frequency interval at a current sampling time, and stores the time domain sampling value into a sampling sequence, where the preset frequency interval is a frequency range of a target signal; taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value; acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; therefore, a large number of calculation processes are simplified into iterative operation, frequency amplitudes corresponding to all frequencies in the preset frequency interval are obtained according to the amplitude vectors, and the frequency of the maximum value of the frequency amplitudes is extracted. The frequency characteristics of the signals are extracted through iterative operation, the operation amount is reduced, and therefore the signals can be detected in real time and processed, and detection with higher precision is achieved.
The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Any continuous periodic function, i.e., the original signal, that satisfies the condition in di Li He can be represented by an infinite series of sine and cosine functions, for example, the original signal can be represented by an infinite series of sine and cosine functions as:
Figure BDA0002306885550000031
wherein, a n cosnω 0 t+b n sinnω 0 t is an nth harmonic, a 0 Is a constant term, ω 0 Is the angular frequency of the original signal, a n And b n Is x c Fourier coefficients of (t). According to the Fourier series, if the initial time of the input original signal and the sine and cosine function is determined, the integral of the product of the original signal and the trigonometric function in any period is kept unchanged, thereby obtaining a n And b n Comprises the following steps:
Figure BDA0002306885550000041
wherein N is 1 ω 0 ~N 2 ω 0 Is the frequency, t 0 Is the initial time. At a calculation frequency of N 1 ω 0 ~N 2 ω 0 The magnitude of the trigonometric function, the available vector
Figure BDA0002306885550000042
Denotes the start of the input sequence as t 0 Three of hourThe angle function amplitude is calculated by the following expression:
Figure BDA0002306885550000043
after the original signal is acquired, discretizing the original signal, wherein if a sampling period is T, a period of the original signal is NT, where N is an integer, and a calculation expression of a trigonometric function coefficient of a discrete signal sequence is as follows:
Figure BDA0002306885550000044
in the above formula, x (k) represents x c (kT) if the original signal x is to be extracted c (t) medium frequency N 1 ω 0 ~N 2 ω 0 The trigonometric function amplitude, at the start time of the input sequence is 0,
Figure BDA0002306885550000046
representing an output vector, i.e. a trigonometric function magnitude>
Figure BDA0002306885550000045
The discrete calculation expression of (a) is: />
Figure BDA0002306885550000051
If the N values obtained by discretizing the original signal are expressed in a vector mode
Figure BDA0002306885550000052
As an input, the output vector->
Figure BDA0002306885550000053
Can be represented as a matrix A 0 And input>
Figure BDA0002306885550000054
Means of multiplication i.e.>
Figure BDA0002306885550000055
Wherein, the matrix A 0 For the encoder, a matrix is obtained by expanding the value of k in the above formula from 0 to N-1. The representation is as follows:
Figure BDA0002306885550000056
by analysis and deduction, an output vector at the k +1 moment is obtained
Figure BDA0002306885550000057
And time k>
Figure BDA0002306885550000058
The following relationship exists between:
Figure BDA0002306885550000059
wherein the content of the first and second substances,
Figure BDA00023068855500000510
is the output vector at the instant k +1, i.e. the magnitude of the trigonometric function at the instant k +1>
Figure BDA0002306885550000061
And x (k + N) -x (k) is the value of the original signal corresponding to the time k + N and the value of the original signal corresponding to the time k, and is the trigonometric function amplitude of the output vector at the time k. The matrix represents a sine function and a cosine function of each frequency corresponding to the moment k, wherein the relation between the amplitude of the trigonometric function at the moment k +1 and the amplitude of the trigonometric function at the moment k is an iterative formula, and the signal can be processed based on the iterative formula. The physical quantities in the expressions used in the following description may be referred to one another. Referring to fig. 1, an embodiment of the present application provides a signal processing method, which can perform signal processing based on the above iterative formula. The method may be applied to an electronic device,the method can comprise the following steps:
step S110: sampling the original signal, acquiring a time domain sampling value of a formula preset frequency interval at the current sampling moment, and storing the time domain sampling value into a sampling sequence.
Before sampling the raw signal, the raw signal needs to be acquired, and the raw signal may be acquired by a sensor or an electronic device having a sensor for acquiring the raw signal. The sensor can be an acceleration sensor, a pressure sensor, a displacement sensor, or a sensor which equivalently converts physical quantities on the basis of acceleration, pressure and displacement, such as one or more of a static charge sensitive sensor, an inflatable micro-motion sensor, an optical fiber sensor and the like.
As an embodiment, when acquiring the raw signal, the sensor or the electronic device having the sensor may be brought into contact with a human body to obtain the raw signal. As another embodiment, a non-contact sensor may be used, and when a human body enters the detection range of the sensor, a raw signal may be acquired.
The electronic device may acquire raw signals collected by the sensor. After an original signal is acquired, the original signal can be sampled, so that a plurality of sampling values can be acquired, the sampling values are converted into a preset frequency interval, and a time domain sampling value of the current sampling value moment is acquired, wherein the time domain sampling value is the time domain sampling value of the preset frequency interval, and the preset frequency interval can be a designated frequency range or a frequency range in which the original signal needs to be subjected to time-frequency conversion. For example, if the processed original signal is a respiration signal, the predetermined frequency interval may be 0.1Hz to 1Hz, and if the processed original signal is a heart rate signal, the predetermined frequency interval may be 0.8Hz to 3Hz.
Specifically, the sampling of the original signal may be to determine a sampling interval for sampling the original signal, sample the original signal when the sampling interval is the time interval with the previous sampling time, convert the sampling value into a preset frequency interval, obtain a time domain sampling value at the current sampling time, and store the time domain sampling value at the current sampling time into a sampling sequence according to the sequence of the sampling times after obtaining the time domain sampling value. Wherein, when sampling the original signal, the sampling theorem needs to be satisfied.
The sampling sequence is the first-in first-out sequence that is used for depositing the time domain sample value of default quantity, works as when depositing the time domain sample value of default quantity in the sampling sequence, continue to when the sampling sequence deposits the sample value, will all time domain sample values in the sampling sequence are in order shift forward one bit, and will first time domain sample value in the sampling sequence shifts out the sampling sequence, will time domain sample value is as the last time domain sample value of sampling sequence is deposited the sampling sequence.
After the time domain sampling values are stored in the sampling sequence, the time domain sampling values in the sampling sequence need to be operated, and an iterative formula, namely a relation between an amplitude vector at the current moment and an amplitude vector at the previous moment, is deduced through calculation, wherein the amplitude vector corresponds to sine amplitude values and cosine amplitude values corresponding to a plurality of frequencies of the time domain sampling values at each sampling moment. So that each data point can be operated in real time according to the iterative formula. So that the corresponding term in the iterative formula can be obtained to realize iterative computation.
Step S120: and obtaining a middle value by taking the difference of the time domain sampling values at the head and the tail of the sampling sequence.
And sampling the original signal, and storing the time domain sampling value of the preset frequency interval at the current sampling moment into a sampling sequence, wherein the sampling sequence comprises a plurality of time domain sampling values. The number of the time domain sampling values in the sampling sequence is limited, so that the time domain sampling values at the head and the tail of the sampling sequence can be obtained, and the time domain sampling values at the head and the tail of the sampling sequence are subjected to difference to obtain an intermediate value. For use in subsequent steps.
Step S130: and acquiring sine and cosine vectors corresponding to a plurality of frequencies of the time domain sampling value in the preset frequency interval at the previous sampling moment.
The time domain sampling values in the sampling sequence belong to a preset frequency interval, sine and cosine vectors corresponding to a plurality of frequencies of the time domain sampling values at the previous sampling time in the preset frequency interval can be obtained, wherein the sine and cosine vectors can be expressed by sine functions and cosine functions related to the sampling time, each frequency corresponds to one sine function and one cosine function, and the sine and cosine vectors are composed of the sine and cosine functions corresponding to the plurality of frequencies at the previous sampling time in the preset frequency interval.
Step S140: and calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment.
After the intermediate value, the sine and cosine vector and the amplitude vector of the previous sampling moment are obtained, the intermediate value, the sine and cosine vector and the amplitude vector of the previous sampling moment can be substituted into the iterative formula, the iterative formula is that the amplitude vector of the current sampling moment is equal to the amplitude vector of the previous sampling moment plus the product of the sine and cosine vector and the intermediate value, wherein the amplitude vector is the sine amplitude and the cosine amplitude corresponding to a plurality of frequencies of the time domain sampling value of the current sampling moment. Therefore, the obtained sine and cosine vectors, and the amplitude vectors at the middle and previous sampling moments are substituted into the iterative formula, so that the amplitude vector at the current sampling moment can be obtained. When calculating the amplitude vector of the next sampling moment, the amplitude vector of the current moment is the amplitude vector of the previous sampling moment, so that after the amplitude vector of one sampling moment is solved, the amplitude vectors of all sampling moments can be solved.
For example, if the magnitude vector of the current sampling time is a, the magnitude vector of the previous sampling time is B, the middle value is C, and the sine and cosine vector is D, the iterative formula may be represented as a = B + C × D. When the amplitude vector of the next sampling moment is calculated, the amplitude vector of the current sampling moment is used as the amplitude vector B of the previous sampling moment, so that the amplitude vector of each sampling moment can be calculated.
Step S150: and obtaining the frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector, and extracting the frequency of the maximum value of the frequency amplitude.
The amplitude vector is a sine amplitude and a cosine amplitude corresponding to a plurality of frequencies of the time domain sampling value at the current sampling time, and after the amplitude vector is obtained, the frequency can be extracted according to the sine amplitude and the cosine amplitude. As an embodiment, a corresponding frequency amplitude may be calculated according to the sine amplitude and the cosine amplitude, and a frequency corresponding to a maximum value of the frequency amplitude may be extracted.
As another embodiment, the corresponding differentiated frequency amplitude may be calculated according to the sine amplitude and the cosine amplitude, and the frequency corresponding to the maximum value of the differentiated frequency amplitude may be extracted.
The signal processing method provided by the embodiment of the application samples an original signal, acquires a time domain sampling value of a preset frequency interval at the current sampling moment, and stores the time domain sampling value into a sampling sequence; taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value; acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; and obtaining frequency amplitudes corresponding to all frequencies in the preset frequency interval according to the amplitude vector, and extracting the frequency of the maximum value of the frequency amplitudes. The frequency characteristics of the signals are extracted through iterative operation, and the operation amount is reduced, so that the signals can be detected in real time and processed, and high-precision detection is realized.
Referring to fig. 2, another embodiment of the present application provides a signal processing method, which focuses on the process of performing iterative computation on the basis of the previous embodiment, and the method may include:
step S210: sampling the original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment, and storing the time domain sampling value into a sampling sequence.
Step S210 may refer to corresponding parts of the foregoing embodiments, and will not be described herein again.
Step S220: the method comprises the steps of obtaining a first time domain sampling value in a sampling sequence, obtaining a last time domain sampling value in the sampling sequence, and obtaining a middle value by making a difference between the last time domain sampling value and the first time domain sampling value.
A plurality of time-domain sample values are stored in the sample sequence, and referring to fig. 3, a schematic diagram of the sample sequence storing the time-domain sample values is shown. In fig. 3, the first time-domain sample value is represented as x [ k ], the last time-domain sample value is represented as x [ k + N-1], when the intermediate value is obtained, the first time-domain sample value, i.e., x [ k ], and the last time-domain sample value, i.e., x [ k + N-1, in the sample sequence can be obtained, and the intermediate value can be obtained by subtracting the last time-domain sample value from the first time-domain sample value.
Step S230: and acquiring a trigonometric function expression corresponding to the sine and cosine vector at the previous sampling moment, and searching the trigonometric function table according to the trigonometric function expression to obtain the numerical value of the sine and cosine vector.
According to the derived iterative formula, it is further required to obtain a sine and cosine vector of a previous sampling moment, where the sine and cosine vector may be a sine function and a cosine function associated with the sampling moment, and the trigonometric function is expressed as a preset sine function and a preset cosine function of each frequency associated with the sampling moment.
For example, if the current sampling time is k +1, then the previous sampling time is k, and the trigonometric function expression corresponding to the sine and cosine vector of the previous sampling time k may be:
Figure BDA0002306885550000091
after the trigonometric function expression corresponding to the sine and cosine vector at the previous sampling moment is obtained, the values of the sine function and the cosine function in the trigonometric function expression corresponding to the sine and cosine vector can be obtained according to the trigonometric function table, so that the numerical value of the sine and cosine vector can be obtained.
Specifically, an array may be given for storing a trigonometric function table, and a corresponding position pointing to the array is set for each frequency, specifically, referring to fig. 4, a schematic diagram of storing the trigonometric function table is shown, in fig. 4, data [0 ]]Therein store
Figure BDA0002306885550000092
Value of (1), data [ 1]]Therein store>
Figure BDA0002306885550000093
Value of (2), data [2 ]]Therein store>
Figure BDA0002306885550000094
By analogy, data [ N-1]]Therein store>
Figure BDA0002306885550000095
The value of (c). The sine function and the cosine function are periodic functions, and the corresponding values of the trigonometric function also have periodicity, so that when a trigonometric function table is searched, a formula can be used for searching the trigonometric function table
Figure BDA0002306885550000101
And formula>
Figure BDA0002306885550000102
And looking up a table to obtain the value of any trigonometric function.
Step S240: and obtaining the amplitude vector of the previous sampling moment.
According to the derived iterative formula, namely the formula:
Figure BDA0002306885550000103
from the iterative formula, if the current sampling time is k +1, it is necessary to obtain the amplitude vector of the previous sampling time, i.e. the sampling time is k
Figure BDA0002306885550000104
The amplitude vector of the previous sampling moment is the sine amplitude and the cosine amplitude corresponding to a plurality of frequencies of the time domain sampling value of the previous sampling moment. However, there is no previous sampling instant at the initial sampling instant, and the magnitude vector at the previous sampling instant may be set to a preset value. If there is a previous oneAt a sampling time, the magnitude vector of the previous sampling time needs to be obtained. Referring to fig. 5, obtaining the magnitude vector of the previous sampling time may further include the following steps:
step S241: the magnitude vector of the previous sampling instant is stored.
In the iterative formula, after the amplitude vector of the current sampling moment is calculated through the iterative formula and the amplitude vector of the next sampling moment is calculated, the calculated amplitude vector of the current sampling moment is used as the amplitude vector of the previous sampling moment corresponding to the next sampling moment. Therefore, each magnitude vector calculated by the iterative formula can be stored. Then for the current sampling instant, if there is a magnitude vector for the previous sampling instant, the magnitude vector for the previous sampling instant is stored. If the current sampling time is the initial sampling time and there is no previous sampling time, the step may not be executed.
Step S242: judging whether the amplitude vector of the previous sampling moment is stored or not; if yes, go to step S243; if not, go to step S244.
When the amplitude vector of the previous sampling time is obtained, it may be determined whether the amplitude vector of the previous sampling time is stored, and if the amplitude vector of the previous sampling time is stored, it indicates that the previous sampling time exists, so that step S243 may be performed. If the magnitude vector of the previous sampling time is not stored, it indicates that there is no previous sampling time, so step S244 may be performed.
As an embodiment, the magnitude vector calculated by the iterative formula may be stored in association with the sampling time, and when determining whether the magnitude vector of the previous sampling time is stored, it may be determined whether the previous time of the current sampling time is present by sampling, if so, step S243 may be executed, and if not, step S244 may be executed.
As another embodiment, a prompt message may be generated when the magnitude vector calculated by the iterative formula is stored. Because the time-domain sampling values in the sampling sequence need to be processed in real time, a preset time can be set. When determining whether the amplitude vector of the previous sampling time is stored, determining whether a time difference between the time of the generated latest prompt message and the current time is less than a preset time, if so, performing step S243, and if not, performing step S244.
Step S243: a stored magnitude vector for a previous sampling instant is obtained.
And if the stored amplitude vector of the previous sampling moment is judged to be stored, the stored amplitude vector of the previous sampling moment is obtained.
Step S244: and taking a preset amplitude vector as the amplitude vector of the previous sampling moment.
If the amplitude vector of the previous sampling moment is not stored, the fact that the previous sampling moment does not exist is indicated, namely the current sampling moment is the initial sampling moment, so that the preset amplitude vector can be obtained to serve as the amplitude vector of the previous sampling moment, and iterative operation is carried out.
Step S250: and adding the product of the sine and cosine vector and the intermediate value to the amplitude vector of the previous sampling moment to obtain the amplitude vector of the current sampling moment.
The iterative formula is that the amplitude vector of the current sampling moment is equal to the amplitude vector of the previous sampling moment plus the product of the sine and cosine vector and the intermediate value, namely the formula:
Figure BDA0002306885550000111
and at the initial sampling moment, taking a preset amplitude vector as the amplitude vector at the previous sampling moment, so that the amplitude vector at the initial sampling moment can be obtained, and the amplitude vectors at all subsequent sampling moments can be calculated according to the amplitude vector at the initial sampling moment and the iterative formula.
Step S260: and obtaining the frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector, and extracting the frequency of the maximum value of the frequency amplitude.
Step S260 may refer to corresponding parts of the foregoing embodiments, and will not be described herein again.
The signal processing method provided by the embodiment of the application samples an original signal, acquires a time domain sampling value of a preset frequency interval at the current sampling moment, and stores the time domain sampling value into a sampling sequence; acquiring a first time domain sampling value in a sampling sequence, acquiring a last time domain sampling value in the sampling sequence, and subtracting the last time domain sampling value from the first time domain sampling value to obtain a middle value; obtaining a trigonometric function expression corresponding to a sine and cosine vector at a previous sampling moment, searching the trigonometric function table according to the trigonometric function expression to obtain a numerical value of the sine and cosine vector, and judging whether the amplitude vector at the previous sampling moment is stored or not when the amplitude vector at the previous sampling moment is obtained, so as to determine the amplitude vector at the previous sampling moment; and substituting the obtained amplitude vector, sine and cosine vector and intermediate value of the previous sampling moment into an iterative formula for iterative calculation. The method reduces the operation amount for processing the original signal, thereby detecting and processing the signal in real time and realizing high-precision detection.
Referring to fig. 6, another embodiment of the present application provides a signal processing method, which focuses on the process of obtaining frequency amplitudes corresponding to respective frequencies in a preset frequency interval according to an amplitude vector and extracting a frequency of a maximum value of the frequency amplitudes based on the previous embodiment, where the method may include:
step S310: sampling the original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment, and storing the time domain sampling value into a sampling sequence.
Step S320: and obtaining a middle value by taking the difference of the time domain sampling values at the head and the tail of the sampling sequence.
Step S330: and acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment.
Step S340: and calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment.
The corresponding parts of the foregoing embodiments can be referred to in steps S310 to S340, which are not described herein again.
After the amplitude vector of the current sampling time is obtained, the amplitude vector comprises sine amplitude values and cosine amplitude values corresponding to a plurality of frequencies of the time domain sampling value of the current sampling time. For example, the current sampling time is k +1 and the frequency is Z 1 ~Z 2 The obtained magnitude vector may be
Figure BDA0002306885550000121
Figure BDA0002306885550000131
Wherein x is 1 ,y 1 Is a frequency of Z 1 The corresponding sine amplitude and cosine amplitude; x is the number of 2 ,y 2 Is a frequency of Z 1 The sine amplitude and the cosine amplitude corresponding to + 1; x is the number of 3 ,y 3 Is a frequency of Z 1 +2 corresponding sine amplitude and cosine amplitude; x is a radical of a fluorine atom n ,y n Then is the frequency Z 2 The corresponding sine amplitude and cosine amplitude.
Therefore, after the amplitude vector corresponding to the current sampling moment is calculated, the amplitude vector can be acquired to obtain the frequency amplitude of each frequency in the preset frequency interval, and the frequency of the maximum frequency amplitude is extracted. As an embodiment, a corresponding frequency amplitude may be calculated according to the sine amplitude and the cosine amplitude, and a frequency corresponding to a maximum value of the frequency amplitude may be extracted. As another embodiment, the corresponding differentiated frequency amplitude may be calculated according to the sine amplitude and the cosine amplitude, and the frequency corresponding to the maximum value of the differentiated frequency amplitude may be extracted. Wherein, the steps S350 to S360 describe extracting the frequency of the maximum value of the frequency amplitude, and the steps S370 to S380 describe extracting the frequency of the maximum value of the differentiated frequency amplitude.
Step S350: and calculating frequency amplitude values corresponding to a plurality of frequencies in a preset frequency interval, wherein the frequency amplitude values are equal to the square of the sum of the square of the sine amplitude value and the square of the cosine amplitude value to the power of half.
The amplitude vector is a sine amplitude and a cosine amplitude corresponding to a plurality of frequencies of the time domain sampling value at the current sampling moment. That is, the amplitude vector includes sine and cosine amplitudes corresponding to respective frequencies within a preset frequency interval. Thus, frequency amplitudes corresponding to a plurality of frequencies in a preset frequency interval can be calculated, and the frequency amplitude is equal to half power of the sum of the square of the sine amplitude and the square of the cosine amplitude.
For example, frequency N 1 ω 0 The amplitude of the sine trigonometric function is a N1 The amplitude of the cosine trigonometric function is b N1 Then frequency N 1 ω 0 Frequency amplitude of H N1 Comprises the following steps:
Figure BDA0002306885550000132
thus, the frequency amplitude corresponding to each frequency can be obtained.
Step S360: and acquiring the frequency corresponding to the maximum value of the frequency amplitude as the frequency of the maximum value of the frequency amplitude.
After the frequency amplitude corresponding to each frequency is obtained, the maximum value of the frequency amplitude corresponding to each frequency can be obtained, and after the frequency amplitude of the maximum value is obtained, the frequency corresponding to the frequency amplitude of the maximum value can be determined, so that the frequency of the maximum value of the frequency amplitude can be obtained.
Step S370: and calculating differentiated frequency amplitude values corresponding to a plurality of frequencies in a preset frequency interval, wherein the differentiated frequency amplitude values are equal to the product of the frequency and the half power of the sum of the square of the sine amplitude value and the square of the cosine amplitude value.
The amplitude vector is a sine amplitude and a cosine amplitude corresponding to a plurality of frequencies of the time domain sampling value at the current sampling moment. That is, the amplitude vector includes sine and cosine amplitudes corresponding to respective frequencies within a preset frequency interval. Thereby, differentiated frequency amplitudes corresponding to a plurality of frequencies in a preset frequency interval may be calculated, the differentiated frequency amplitudes being equal to the product of the frequency and the power half of the sum of the square of the sine amplitude and the square of the cosine amplitude.
For example, frequency N 1 ω 0 The amplitude of the sine trigonometric function is a N1 The amplitude of the cosine trigonometric function is b N1 Then frequency N 1 ω 0 Frequency amplitude H' N1 Comprises the following steps:
Figure BDA0002306885550000141
thus, the frequency amplitude corresponding to each frequency can be obtained.
Step S380: and acquiring the frequency corresponding to the maximum value of the differentiated frequency amplitude as the frequency of the maximum value of the frequency amplitude.
After the differentiated frequency amplitude corresponding to each frequency is obtained, the maximum value of the differentiated frequency amplitude corresponding to each frequency may be obtained, after the differentiated frequency amplitude of the maximum value is obtained, the frequency corresponding to the differentiated frequency amplitude of the maximum value may be determined, and the frequency corresponding to the differentiated frequency amplitude is taken as the frequency of the maximum value of the frequency amplitude.
If the original signal is a vital sign signal, the frequency of the maximum value of the extracted frequency amplitude is the corresponding vital sign. For example, if the original signal is a heart rate signal, the frequency of the extracted maximum frequency amplitude is a heart rate, and if the original signal is a respiration rate signal, the frequency of the extracted maximum frequency amplitude is a respiration rate, so that according to an iterative formula, when the heart rate signal or the respiration rate signal is processed, the processes of filtering, smoothing and the like are simplified, and the corresponding heart rate or respiration rate can be directly obtained. Thereby when using on electronic equipment such as bracelet that detects vital sign, can be fast to handling of the signal of gathering, realize the real-time detection to user's vital sign.
The signal processing method provided by the embodiment of the application samples an original signal, acquires a time domain sampling value of a preset frequency interval at the current sampling moment, and stores the time domain sampling value into a sampling sequence, wherein the preset frequency interval is the frequency range of a target signal; taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value; acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment; calculating the amplitude vector of the current sampling moment according to the sine and cosine vector, the intermediate value and the amplitude vector of the previous sampling moment; and obtaining frequency amplitudes corresponding to all frequencies in a preset frequency interval according to the amplitude vector, and when the frequency of the maximum value of the frequency amplitudes is extracted, calculating the frequency amplitudes corresponding to all frequencies according to the amplitude vector, and extracting the frequency corresponding to the frequency amplitude of the maximum value. Or extracting the frequency corresponding to the differentiated frequency amplitude of the maximum value by calculating the differentiated frequency amplitude corresponding to each frequency. Therefore, the signals are processed through the deduced iteration formula, and the frequency corresponding to the maximum value of the frequency amplitude is extracted quickly.
Referring to fig. 7, a signal processing apparatus 400 provided in an embodiment of the present application is shown and can be applied to an electronic device, where the signal processing apparatus 400 includes a sampling module 410, an intermediate value obtaining module 420, a vector obtaining module 430, an iteration module 440, and a signal obtaining module 450.
The sampling module 410 is configured to sample an original signal, obtain a time domain sampling value of a preset frequency interval at a current sampling time, and store the time domain sampling value in a sampling sequence, where the preset frequency range interval is a frequency range of a target signal; the intermediate value obtaining module 420 is configured to perform a difference on the time domain sampling values at the head and the tail of the sampling sequence to obtain an intermediate value; the vector obtaining module 430 is configured to obtain sine and cosine vectors corresponding to multiple frequencies of time domain sample values in the preset frequency interval at a previous sampling time; the iteration module 440 is configured to calculate an amplitude vector at a current sampling time according to the sine and cosine vector, the intermediate value, and an amplitude vector at a previous sampling time; the signal obtaining module 450 is configured to obtain a frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector, and extract a frequency of a maximum value of the frequency amplitude.
Further, the sampling module 410 is further configured to determine a sampling interval for sampling the original signal; when the time interval with the previous sampling moment is the sampling interval, sampling the original signal to obtain a sampling value of the current moment; converting the sampling value into a preset frequency interval to obtain a time domain sampling value at the current sampling moment; and storing the time domain sampling value of the current sampling moment into the sampling sequence according to the sequence of the sampling moments.
Wherein the original signal is discretized when the original signal is sampled, thereby changing the continuous signal into a digital signal for processing by the electronic device. And when the time domain sampling value is obtained, the collected time domain sampling value is stored in the sampling sequence for the electronic equipment to process.
Furthermore, the sampling sequence is the first-in first-out sequence that is used for depositing the time domain sample value of the default quantity, the sampling module still is used for working as deposit the time domain sample value of the default quantity in the sampling sequence, will all time domain sample values in the sampling sequence move one bit forward in order, and will first time domain sample value in the sampling sequence shifts out the sampling sequence, will time domain sample value is regarded as the last time domain sample value of sampling sequence is deposited in the sampling sequence.
The sampling sequence is a first-in first-out sequence, that is, a time domain sampling value of the first-in sampling sequence is processed first, after a time domain sampling value is processed, the processed time domain sampling value is moved out of the sampling sequence, and all time domain sampling values in the sampling sequence are moved forward by one bit, so that a new time domain sampling value can be stored in the sampling sequence, and each time domain sampling value in the sampling sequence is processed.
Further, the intermediate value obtaining module 420 is further configured to obtain a first time-domain sample value in the sample sequence; acquiring the last time domain sampling value in the sampling sequence; and obtaining the intermediate value by taking the difference between the last time domain sampling value and the first time domain sampling value.
The first time domain sampling value and the last time domain sampling value of the sampling sequence are subjected to difference to obtain an intermediate value, and the intermediate value can be substituted into an iterative formula for calculation.
Further, a trigonometric function table is stored in advance, the trigonometric function table includes values corresponding to trigonometric function expressions in each preset frequency interval, the vector obtaining module 430 is further configured to obtain a trigonometric function expression corresponding to the sine and cosine vector at the previous sampling time, and the trigonometric function expression is a preset sine function and cosine function related to the sampling time; and searching the trigonometric function table according to the trigonometric function expression to obtain the numerical value of the sine and cosine vector.
When the trigonometric function expression corresponding to the sine and cosine vector at the previous sampling moment is obtained, the values of the sine function and the cosine function in the trigonometric function expression can be obtained by searching the trigonometric function table, so that the value corresponding to the sine and cosine vector can be obtained, and the value of the sine and cosine vector can be substituted into the iterative formula for calculation.
Further, the iteration module 440 is further configured to obtain a magnitude vector of a previous sampling time; the amplitude vector of the current sampling moment is equal to the amplitude vector of the previous sampling moment plus the product of the sine and cosine vector and the intermediate value.
When the amplitude vector of the previous sampling time is obtained, the amplitude vector, the intermediate value, and the sine and cosine vector of the previous sampling time may be substituted into an iterative formula for calculation, where the iterative formula is that the amplitude vector of the current sampling time is equal to the sum of the amplitude vector of the previous sampling time and the product of the sine and cosine vector and the intermediate value.
Further, the iteration module 440 is further configured to store the amplitude vector at the previous sampling time, and determine whether the amplitude vector at the previous sampling time is stored; if the sampling time does not exist, taking a preset amplitude vector as the amplitude vector of the previous sampling time; and if so, acquiring the stored amplitude vector of the previous sampling moment.
When the amplitude vector of the previous sampling time is obtained, the previous sampling time may not exist, that is, the current sampling time is the initial sampling time. Therefore, whether the amplitude vector of the previous sampling moment is stored or not can be judged, and if the amplitude vector of the previous sampling moment is stored, the stored amplitude vector of the previous sampling moment is obtained; if the current sampling time is not the initial sampling time, the preset amplitude vector is used as the amplitude vector of the previous sampling time. Therefore, normal iteration can be ensured when the iterative formula is used for calculation.
Further, the signal obtaining module 450 is further configured to calculate frequency amplitude values corresponding to a plurality of frequencies in a preset frequency interval, where the frequency amplitude value is equal to a half power of a sum of a square of the sine amplitude value and a square of the cosine amplitude value; and acquiring the frequency corresponding to the maximum value of the frequency amplitude as the frequency of the maximum value of the frequency amplitude.
After the amplitude vector at the current sampling time is obtained, the sine amplitude and the cosine amplitude corresponding to each frequency in the amplitude vector can be obtained according to the amplitude vector, the frequency amplitude corresponding to each frequency is calculated according to the sine amplitude and the cosine amplitude corresponding to each frequency, and the frequency corresponding to the maximum value of the frequency amplitude is extracted.
Further, the signal obtaining module 450 is further configured to calculate differentiated frequency amplitudes corresponding to a plurality of frequencies in a preset frequency interval, where the differentiated frequency amplitudes are equal to a product of a half power of a sum of a square of the sine amplitude and a square of the cosine amplitude and a frequency; and acquiring the frequency corresponding to the maximum value of the differentiated frequency amplitude as the frequency of the maximum value of the frequency amplitude.
After the amplitude vector at the current sampling time is obtained, the sine amplitude and the cosine amplitude corresponding to each frequency in the amplitude vector can be obtained according to the amplitude vector, the differentiated frequency amplitude corresponding to each frequency is calculated according to the sine amplitude and the cosine amplitude corresponding to each frequency, and the frequency corresponding to the maximum value of the differentiated frequency amplitude is extracted.
The signal processing apparatus 400 provided in this embodiment of the application can implement each process of the signal processing method implemented by the electronic device in the method embodiments of fig. 1 to fig. 6, and is not described herein again to avoid repetition.
An embodiment of the present application provides an electronic device, which includes a processor and a memory, where at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the signal processing method provided by the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and information feedback by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
Fig. 8 is a block diagram of a hardware structure of an electronic device according to a signal processing method provided in an embodiment of the present application. As shown in fig. 8, the electronic device 500 may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 510 (the processors 510 may include but are not limited to a Processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 530 for storing data, and one or more storage media 520 (e.g., one or more mass storage devices) for storing applications 523 or data 522. Memory 530 and storage medium 520 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 520 may include one or more modules, each of which may include a sequence of instructions operating on an electronic device. Still further, the processor 510 may be configured to communicate with the storage medium 520 to execute a series of instruction operations in the storage medium 520 on the electronic device 500. The electronic device 500 may also include one or more power supplies 560, one or more wired or wireless network interfaces 550, one or more input-output interfaces 540, and/or one or more operating systems 521, such as Windows Server, macOSXTM, unixTM, linuxTM, freeBSDTM, and so forth.
The input/output interface 540 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the electronic device 500. In one example, the input/output Interface 540 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the input/output interface 540 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
It will be understood by those skilled in the art that the structure shown in fig. 8 is only an illustration, and is not intended to limit the structure of the electronic device. For example, electronic device 500 may also include more or fewer components than shown in FIG. 8, or have a different configuration than shown in FIG. 8.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the processes of the signal processing method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the particular illustrative embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but is intended to cover various modifications, equivalent arrangements, and equivalents thereof, which may be made by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (11)

1. A method of signal processing, the method comprising:
sampling an original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment, and storing the time domain sampling value into a sampling sequence, wherein the preset frequency interval is the frequency range of a target signal;
taking the difference of the time domain sampling values at the head and the tail of the sampling sequence to obtain a middle value;
acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment;
obtaining an amplitude vector of a previous sampling moment, and obtaining the amplitude vector of the current sampling moment based on the sum of the amplitude vector of the previous sampling moment and the product of the sine and cosine vector and the intermediate value;
and obtaining the frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector of the current sampling moment, and extracting the frequency of the maximum value of the frequency amplitude.
2. The method of claim 1, wherein the sampling the original signal to obtain the time domain sample values of the preset frequency interval at the current sampling time and storing the time domain sample values into the sampling sequence comprises:
determining a sampling interval for sampling the original signal;
when the time interval with the previous sampling moment is the sampling interval, sampling the original signal to obtain a sampling value of the current moment;
converting the sampling value into a preset frequency interval to obtain a time domain sampling value at the current sampling moment;
and storing the time domain sampling value of the current sampling moment into the sampling sequence according to the sequence of the sampling moments.
3. The method of claim 2, wherein the sampling sequence is a first-in first-out sequence for storing a preset number of time-domain sample values, and the storing the time-domain sample value of the current sampling time into the sampling sequence according to the sequence of the sampling times comprises:
when a preset number of time domain sampling values are stored in the sampling sequence, sequentially shifting all the time domain sampling values in the sampling sequence forward by one bit, shifting a first time domain sampling value in the sampling sequence out of the sampling sequence, and storing the time domain sampling value as a last time domain sampling value of the sampling sequence in the sampling sequence.
4. The method of claim 1, wherein the step of differencing the beginning and end time-domain sample values of the sample sequence to obtain an intermediate value comprises:
acquiring a first time domain sampling value in the sampling sequence;
acquiring the last time domain sampling value in the sampling sequence;
and obtaining the intermediate value by taking the difference between the last time domain sampling value and the first time domain sampling value.
5. The method according to claim 1, wherein a trigonometric function table is stored in advance, and the trigonometric function table comprises corresponding numerical values of trigonometric function expressions in each of preset frequency intervals;
the obtaining of the sine and cosine vectors corresponding to a plurality of frequencies of the time domain sampling value in the preset frequency interval at the previous sampling time includes:
acquiring a corresponding trigonometric function expression of the sine and cosine vector at the previous sampling moment, wherein the trigonometric function expression is a preset sine function and a preset cosine function related to the sampling moment;
and searching the trigonometric function table according to the trigonometric function expression to obtain the numerical value of the sine and cosine vector.
6. The method of claim 1, further comprising: the magnitude vector of the previous sampling instant is stored,
the obtaining of the magnitude vector of the previous sampling time includes:
judging whether the amplitude vector of the previous sampling moment is stored or not;
if the current sampling time does not exist, taking a preset amplitude vector as the amplitude vector of the previous sampling time;
if so, the stored magnitude vector of the previous sampling instant is obtained.
7. The method according to any one of claims 1 to 6, wherein the obtaining, according to the amplitude vector at the current sampling time, the frequency amplitude corresponding to each frequency in the preset frequency interval, and extracting the frequency of the maximum value of the frequency amplitude, includes:
calculating frequency amplitude values corresponding to a plurality of frequencies in a preset frequency interval according to sine amplitude values and cosine amplitude values corresponding to the plurality of frequencies in the preset frequency interval, which are included in the amplitude vector at the current sampling moment; the frequency amplitude is equal to one-half power of the sum of the square of the sine amplitude and the square of the cosine amplitude;
and acquiring the frequency corresponding to the maximum value of the frequency amplitude as the frequency of the maximum value of the frequency amplitude.
8. The method according to any one of claims 1 to 6, wherein the obtaining, according to the amplitude vector at the current sampling time, the frequency amplitude corresponding to each frequency in the preset frequency interval, and extracting the frequency of the maximum value of the frequency amplitude, includes:
calculating differentiated frequency amplitudes corresponding to a plurality of frequencies in a preset frequency interval according to sine amplitudes and cosine amplitudes corresponding to the plurality of frequencies in the preset frequency interval, which are included in the amplitude vector at the current sampling moment, wherein the differentiated frequency amplitudes are equal to the product of the frequency and the half power of the sum of the square of the sine amplitude and the square of the cosine amplitude;
and acquiring the frequency corresponding to the maximum value of the differentiated frequency amplitude as the frequency of the maximum value of the frequency amplitude.
9. A signal processing apparatus, characterized in that the apparatus comprises:
the sampling module is used for sampling an original signal, acquiring a time domain sampling value of a preset frequency interval at the current sampling moment and storing the time domain sampling value into a sampling sequence, wherein the preset frequency interval is the frequency range of a target signal;
the intermediate value acquisition module is used for subtracting the time domain sampling values at the head and the tail of the sampling sequence to obtain an intermediate value;
the vector acquisition module is used for acquiring sine and cosine vectors corresponding to a plurality of frequencies of time domain sampling values in the preset frequency interval at the previous sampling moment;
the iteration module is used for obtaining an amplitude vector at the previous sampling moment and obtaining the amplitude vector at the current sampling moment based on the sum of the amplitude vector at the previous sampling moment and the product of the sine and cosine vector and the intermediate value;
and the signal acquisition module is used for acquiring the frequency amplitude corresponding to each frequency in the preset frequency interval according to the amplitude vector of the current sampling moment and extracting the frequency of the maximum value of the frequency amplitude.
10. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a memory electrically connected with the one or more processors;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of any of claims 1-8.
11. A computer-readable storage medium, having stored thereon program code that can be invoked by a processor to perform the method according to any one of claims 1 to 8.
CN201911243477.1A 2019-12-06 2019-12-06 Signal processing method, signal processing device, electronic equipment and storage medium Active CN111134637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911243477.1A CN111134637B (en) 2019-12-06 2019-12-06 Signal processing method, signal processing device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911243477.1A CN111134637B (en) 2019-12-06 2019-12-06 Signal processing method, signal processing device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111134637A CN111134637A (en) 2020-05-12
CN111134637B true CN111134637B (en) 2023-04-07

Family

ID=70517712

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911243477.1A Active CN111134637B (en) 2019-12-06 2019-12-06 Signal processing method, signal processing device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111134637B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113180689A (en) * 2021-04-08 2021-07-30 上海数创医疗科技有限公司 P wave crest and initial position extraction method based on Gaussian function fitting
CN115795253B (en) * 2021-09-09 2023-10-03 武汉市聚芯微电子有限责任公司 Frequency tracking method, device, equipment and computer storage medium
CN114415265B (en) * 2022-01-20 2024-02-02 广东省气象探测数据中心(广东省气象技术装备中心、广东省气象科技培训中心) Meteorological observation data processing method and device, computer equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07218288A (en) * 1994-01-28 1995-08-18 Mitsubishi Electric Corp Absolute position detector and its error correcting method
US7117030B2 (en) * 2004-12-02 2006-10-03 The Research Foundation Of State University Of New York Method and algorithm for spatially identifying sources of cardiac fibrillation
JP6109927B2 (en) * 2012-05-04 2017-04-05 カオニックス ラブス リミテッド ライアビリティ カンパニー System and method for source signal separation
CN102798748B (en) * 2012-07-13 2014-08-13 中冶南方工程技术有限公司 Method for calculating amplitude and phase of alternating-voltage signal based on iteration Fourier transform
CN102818921B (en) * 2012-07-13 2014-07-02 中冶南方工程技术有限公司 Method for calculating amplitude and phase of alternating current signal based on iterative Fourier transform
CN105372471B (en) * 2015-07-09 2018-05-25 深圳市科润宝实业有限公司 The amplitude detection method and system of sinusoidal signal
CN105067882B (en) * 2015-07-24 2017-11-07 许继电气股份有限公司 A kind of assay method of electricity amplitude
EP3492946B1 (en) * 2017-12-01 2021-05-12 Origin Wireless, Inc. Method, apparatus, and system for object tracking and navigation
CN109308341B (en) * 2018-09-20 2023-01-20 扬州大学 Method capable of rapidly calculating turbulent power spectral density based on weighted overlapping

Also Published As

Publication number Publication date
CN111134637A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111134637B (en) Signal processing method, signal processing device, electronic equipment and storage medium
CN111027487B (en) Behavior recognition system, method, medium and equipment based on multi-convolution kernel residual error network
EP3876191B1 (en) Estimator generation device, monitoring device, estimator generation method, estimator generation program
Hegger et al. Coping with nonstationarity by overembedding
Sikder et al. Human activity recognition using multichannel convolutional neural network
Al Disi et al. ECG signal reconstruction on the IoT-gateway and efficacy of compressive sensing under real-time constraints
CN111091278A (en) Edge detection model construction method and device for mechanical equipment anomaly detection
CN108697352B (en) Physiological information measuring method, physiological information monitoring device and equipment
CN112775931A (en) Mechanical arm control method and device, computer readable storage medium and robot
CN106933247B (en) Unmanned aerial vehicle control method, device and system
Triwiyanto et al. Embedded machine learning using a multi-thread algorithm on a Raspberry Pi platform to improve prosthetic hand performance
CN106845348B (en) Gesture recognition method based on arm surface electromyographic signals
Niu et al. Enhancing computer digital signal processing through the utilization of rnn sequence algorithms
CN112075930B (en) Analysis early warning device, method and system based on scatter diagram and electronic equipment
Mishra et al. Performance Evaluation of Various Window Techniques for Noise Cancellation from ECG Signal
CN115579130B (en) Method, device, equipment and medium for evaluating limb function of patient
CN116712099A (en) Fetal heart state detection method based on multi-mode data, electronic equipment and storage medium
CN108567420B (en) Blood pressure measuring terminal and computer-readable storage medium
CN111730604B (en) Mechanical clamping jaw control method and device based on human body electromyographic signals and electronic equipment
CN113115247B (en) Signal processing method, device and equipment
CN110990819B (en) Method and server for acquiring gait feature data of terminal user based on mobile terminal data
CN115568844A (en) Apnea detection method and device, electronic equipment and storage medium
Mahajan et al. Sense Your Data: Sensor Toolbox Manual, Version 1.0
Liu et al. Using algorithms on smart transducer: An IEEE standard perspective
Djeufa Dagoumguei et al. System dynamics monitoring using PIC micro-controller-based PLSE

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant