Wave spectrum measurement methods, wave measurement devices and computer-readable storage media
By installing an inertial sensor on the floating body, collecting and processing sea surface wave data, and generating wave spectrum, the problems of poor aging and inaccurate analysis in the prior art are solved, and wave spectrum measurement with high aging and high accuracy is achieved.
Patent Information
- Application Number
- CN202210211059.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-03
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-03-03
AI Technical Summary
The existing wave spectrum measurement methods have poor aging and cannot accurately analyze the wave patterns in a certain water area.
By installing an inertial sensor on the floating body, the acceleration and angular velocity data of the floating body following the ups and downs of the sea surface waves are collected, the quaternion queue is calculated, and the data is converted into a geographic coordinate system acceleration queue, thereby generating a wave spectrum.
Improves the timeliness and accuracy of wave measurements, and enables real-time analysis and generation of wave spectrum.
Smart Images

Figure CN114674524B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of measurement engineering technology, and in particular to a wave spectrum measurement method, a wave measurement device and a storage medium. Background Art
[0002] The currently disclosed wave measurement methods mainly use three parameters, wave height, wave period and wave direction, from the perspective of time domain to count the wave morphology of a water area. However, the movement of water bodies, whether oceans, rivers or lakes, will change with time. It is impossible to accurately analyze the wave morphology of a certain water area by describing the individual morphology of a series of waves from the perspective of time domain. Alternatively, the wave spectrum is calculated using the wave spectrum empirical function, but the method of calculating the wave spectrum using the wave spectrum empirical function has poor timeliness and lags. Summary of the invention
[0003] The present application provides a wave spectrum measurement method, a wave measurement device and a computer-readable storage medium to solve the problems of poor timeliness and inability to accurately analyze the wave morphology of a certain water area in existing wave spectrum measurement methods.
[0004] In a first aspect, the present application provides a wave spectrum measurement method, which is applied to a wave measurement device, wherein the wave measurement device comprises: a floating body and a wave measurement device installed inside the floating body; the method comprises:
[0005] Acquire data corresponding to the movement of the floating body following the waves on the sea surface collected by the wave measurement device, wherein the data at least includes acceleration and angular velocity;
[0006] Calculate the quaternion queue corresponding to the data according to the data;
[0007] Convert the acceleration of the data and the quaternion array into a geographic coordinate system acceleration array;
[0008] Converting the geographic coordinate system acceleration array into a geographic coordinate system displacement spectrum;
[0009] A wave spectrum is generated according to the geographic coordinate system displacement spectrum.
[0010] In the wave spectrum measurement method provided in the present application, generating the wave spectrum according to the geographic coordinate system displacement spectrum includes:
[0011] Calculate the power spectrum density and wave direction corresponding to each frequency of the displacement spectrum of the geographic coordinate system;
[0012] The wave spectrum is synthesized according to each frequency and the power spectrum density and the wave direction corresponding to each frequency.
[0013] In the wave spectrum measurement method provided in the present application, the calculation of the power spectrum density and wave direction corresponding to each frequency of the displacement spectrum of the geographic coordinate system includes:
[0014] The calculation formula of the power spectral density is:
[0015]
[0016] Wherein, the PSD represents the power spectral density; the R Z is the real part of the Z-direction displacement of the frequency; Z is the imaginary part of the Z-direction displacement of the frequency; f is the sampling frequency of the inertial sensor; n is the number of accelerations of the geographic coordinate system actually used in the process of transforming the acceleration queue of the geographic coordinate system from the time domain to the frequency domain;
[0017] The calculation formula of the wave direction is:
[0018]
[0019] Where X = R X ×I Z -I X ×R Z , X represents the cross product of the X-direction displacement and the Z-direction displacement of the frequency, Y = R Y ×I Z -I Y ×R Z , Y represents the cross product of the Y displacement and the Z displacement of the frequency, and the R X is the real part of the X-direction displacement of the frequency, the I X is the imaginary part of the Y displacement of the frequency, the R Y is the real part of the Y displacement of the frequency, the I Y is the imaginary part of the Y displacement of the frequency.
[0020] In the wave spectrum measurement method provided in the present application, the step of obtaining the data corresponding to the undulating movement of the floating body following the waves on the sea surface collected by the wave measurement device includes:
[0021] Acquiring a sampling frequency of the inertial sensor;
[0022] Creating a sampling data queue, wherein the sampling data queue is used to store the sampling data of the inertial sensor;
[0023] Reading the sampled data, and marking the sampled data that has not been updated;
[0024] The read sampling data is stored in the sampling data queue, and the data in the sampling data queue is obtained.
[0025] In the wave spectrum measurement method provided in the present application, the step of converting the acceleration of the data and the quaternion array into a geographic coordinate system acceleration array includes:
[0026] The acceleration of the data is transformed with the quaternion array through a direction cosine matrix to obtain the acceleration array of the geographic coordinate system.
[0027] In the wave spectrum measurement method provided in the present application, converting the geographic coordinate system acceleration array into a geographic coordinate system displacement spectrum includes:
[0028] Read the geographic coordinate system acceleration queue;
[0029] Transforming the geographic coordinate system acceleration queue from the time domain to the frequency domain to obtain a geographic coordinate system acceleration spectrum;
[0030] Performing frequency domain integration on the acceleration spectrum of the geographic coordinate system to obtain a velocity spectrum of the geographic coordinate system;
[0031] The geographic coordinate system velocity spectrum is integrated in the frequency domain to obtain the geographic coordinate system displacement spectrum.
[0032] In the wave spectrum measurement method provided in the present application, the transformation of the acceleration queue of the geographic coordinate system from the time domain to the frequency domain adopts a fast Fourier transform algorithm.
[0033] In the wave spectrum measurement method provided in the present application, the wave spectrum measurement method further includes: obtaining an operation mode and a measurement duration of the wave spectrum measurement, wherein the operation mode includes any one of a single measurement, a continuous measurement, and a timed measurement.
[0034] In a second aspect, the present application further provides a wave measurement device, the wave measurement device comprising an inertial sensor, a memory and a processor;
[0035] The inertial sensor is used to collect data;
[0036] The memory is used to store computer programs;
[0037] The processor is used to execute the computer program and implement the wave spectrum measurement method as described in any one of the embodiments of the present application when executing the computer program.
[0038] In a third aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements a wave spectrum measurement method as described in any one of the embodiments of the present application.
[0039] The present application discloses a wave spectrum measurement method, a wave measurement device, and a computer-readable storage medium. By installing the wave measurement device in a floating body, the wave measurement device collects data corresponding to the undulating movement of the floating body following the waves on the sea surface, thereby improving the timeliness of wave measurement. At the same time, the wave measurement device converts the collected data in the time domain into a geographic coordinate system displacement spectrum in the frequency domain, and generates a wave spectrum according to the geographic coordinate system displacement spectrum, thereby improving the accuracy of wave measurement.
[0040] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A schematic block diagram of the structure of a wave measurement device provided in an embodiment of the present application;
[0043] Figure 2 A schematic block diagram of the structure of a wave measurement device provided in an embodiment of the present application;
[0044] Figure 3 A schematic flow chart of a wave spectrum measurement method provided in an embodiment of the present application;
[0045] Figure 4 A schematic flow chart of steps for obtaining data collected by a wave measurement device provided in an embodiment of the present application;
[0046] Figure 5 A schematic flow chart of the steps of calculating a quaternion queue provided in an embodiment of the present application;
[0047] Figure 6 A schematic flow chart of the steps of calculating the acceleration queue of a geographic coordinate system provided in an embodiment of the present application;
[0048] Figure 7 A schematic flow chart of the steps of calculating a displacement spectrum of a geographic coordinate system provided in an embodiment of the present application;
[0049] Figure 8 A schematic flow chart of the steps of generating a wave spectrum according to a displacement spectrum of a geographic coordinate system provided in an embodiment of the present application;
[0050] Fig. 9A single measurement procedure flow chart provided for an embodiment of the present application;
[0051] Fig.10 A flow chart of a continuous measurement procedure provided in an embodiment of the present application;
[0052] Fig.11 A flow chart of a timing measurement procedure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0055] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0056] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0057] Embodiments of the present application provide a wave spectrum measurement method, a wave measurement device, and a computer-readable storage medium.
[0058] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0059] See also Figure 1 , Figure 1 A schematic block diagram of the structure of a wave measurement device provided in an embodiment of the present application.
[0060] The wave measurement device 100 includes a wave measurement device 110, a floating body 120, a wireless transceiver 130, an antenna 140, a battery 150, a charge and discharge management module 160, and a solar panel 170, and corresponding connections are established between the components. The wave measurement device 110, the wireless transceiver 130, the battery 150, and the charge and discharge management module 160 are installed inside the floating body 120; the antenna 140 and the solar panel 170 are installed outside the floating body 120.
[0061] The wave measuring device 110 of the present invention runs a program for implementing the wave spectrum measurement method involved in the present invention. Since the wave measuring device 110 is installed in the floating body 120, when the wave measuring equipment 100 is placed on a certain sea surface to measure the wave shape of a certain sea surface, the wave measuring device 110 can indirectly measure the state of the floating body 120 moving with the ups and downs of the sea surface waves in real time, thereby improving the timeliness of the wave measurement.
[0062] It can be understood that the wave measurement device 110 can also be used to measure the wave shape of rivers, lakes and other water bodies.
[0063] The wireless transceiver 130 and the antenna 140 constitute the communication system of the wave spectrum measuring device 100, which is used to control the wave measuring device 110. Specifically, the user encodes the control command into an analog signal for transmission through the transceiver on the shore (not shown), and the antenna 140 receives the analog signal and transmits it to the wireless transceiver 130. After the wireless transceiver 130 decodes the analog signal and restores it to the control command, it transmits the control command to the wave measuring device 110 through the transceiver 116 for further analysis, thereby controlling the wave measuring device 110.
[0064] The storage battery 150 , the charge and discharge management module 160 and the solar panel 170 form a power supply system for supplying power to the wave measurement device 110 and the wireless transceiver 130 .
[0065] See also Figure 2 , Figure 2 A schematic block diagram of the structure of a wave measurement device provided in an embodiment of the present application.
[0066] The wave measuring device 110 includes a processor 111, an inertial sensor 112, a non-volatile memory 113, a random access memory 114, a power supply 115, a transceiver 116 and an external interface 117, and corresponding connections are established between the components. The processor 111 is connected to the inertial sensor 112 via a serial peripheral interface, connected to the random access memory 114 via a data bus and an address bus, connected to the non-volatile memory 113 via a secure digital input and output interface, and connected to the transceiver 116 via a universal asynchronous receiver and transmitter interface. The power supply 115 is directly connected to the internal power supply circuit of the wave measuring device 110.
[0067] The processor 111 is used to execute the computer program and implement the wave spectrum measurement method as described in any one of the embodiments of the present application when executing the computer program. In some embodiments, the processor 111 uses a microprocessor with a single-precision floating-point arithmetic unit and a digital signal processing unit; in other embodiments, the processor 111 uses a microprocessor with a double-precision floating-point arithmetic unit and a digital signal processing unit.
[0068] The inertial sensor 112 is used to collect data. Specifically, the inertial sensor 112 is used to collect accelerations a of three mutually orthogonal axes x, y and z when the floating body 120 moves along the waves on the sea surface. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z In order to ensure the accuracy and timeliness of the measurement, the sampling frequency of the inertial sensor 112 is not less than 4 Hz.
[0069] In some embodiments, the inertial sensor 112 is a single nine-degree-of-freedom inertial sensor that provides nine-degree-of-freedom data. It is understood that the nine-degree-of-freedom data here refers to the acceleration a of the three mutually orthogonal axes x, y and z when the floating body 120 moves with the waves on the sea surface. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z Nine data.
[0070] In other embodiments, the inertial sensor 112 is a combination of three DOF inertial sensors 112a, 112b, and 112c that provide 3DOF data. It can be understood that the 3DOF data here refers to the acceleration a, angular velocity α, and magnetic field intensity H of one of the three mutually orthogonal axes x, y, and z when the floating body 120 moves with the waves on the sea surface. The 3DOF inertial sensor 112a is used to collect the acceleration a of the x-axis among the three mutually orthogonal axes x, y, and z. x , angular velocity α x and magnetic field strength H x The three-degree-of-freedom inertial sensor 112b is used to collect the acceleration a of the y-axis among the three mutually orthogonal axes x, y and z. y , angular velocity α y and magnetic field strength H y The three-degree-of-freedom inertial sensor 112c is used to collect the acceleration a of the z-axis among the three mutually orthogonal axes x, y and z. z , angular velocity α z and magnetic field strength H z .
[0071] The non-volatile memory 113 is used to store wave spectrum measurement results and configuration parameters, including the sampling frequency of the inertial sensor 112, the operation mode and sampling duration of the wave spectrum measurement, and other parameters that are not desired to be lost in the event of a power outage. The non-volatile memory 113 of the present application includes but is not limited to a flash memory, a secure data card, and a multimedia card. In some embodiments, in order to ensure the security of data, the non-volatile memory 113 uses a secure data card.
[0072] The random access memory 114 is used to store the accelerations a of the three mutually orthogonal axes x, y and z acquired by the inertial sensor 112. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z The random access memory 114 of the present application includes, but is not limited to, static random access memory, dynamic random access memory, pseudo-static random access memory, and synchronous dynamic random access memory. In some embodiments, the random access memory 114 uses a synchronous dynamic random access memory, which can store data in real time, thereby further improving the timeliness of wave measurement.
[0073] The power supply 115 is used to supply power to the wave measuring device 110. The input voltage and output voltage of the power supply 115 depend on the specific application scenario. In some embodiments, the power supply 115 uses an isolated DC regulated power supply to prevent external interference from entering the wave measuring device 110 through the power supply.
[0074] The transceiver 116 is used to transmit control commands and wave spectrum measurement results. The data transmission protocol of the transceiver 116 includes but is not limited to RS-232 and RS-485. In some embodiments, the transceiver 116 is an isolated transceiver to prevent external interference from entering the wave measurement device 110 through the transceiver.
[0075] The external interface 117 is an external circuit interface and communication interface of the wave measurement device 110, and the external interface 117 is connected to the charge and discharge management module 160 and the wireless transceiver 130. In some embodiments, the external interface 117 uses a waterproof interface.
[0076] See also Figure 3 , Figure 3 A schematic flow chart of a wave spectrum measurement method provided in an embodiment of the present application. The wave spectrum measurement method is applied to a wave measurement device 100 to improve the timeliness and accuracy of wave spectrum measurement.
[0077] like Figure 3 As shown, the wave spectrum measurement method specifically includes steps S301 to S305.
[0078] Step S301: Acquire data corresponding to the movement of the floating body 120 following the waves on the sea surface collected by the wave measurement device 110, wherein the data at least includes acceleration and angular velocity.
[0079] The wave measuring device 110 collects data through an inertial sensor 112. The data collected by the inertial sensor 112 includes accelerations a of three mutually orthogonal axes x, y and z when the floating body 120 moves along the waves on the sea surface. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z .
[0080] In some embodiments, step S301 includes: Figure 4 Sub-steps S301a to S301d are shown.
[0081] Sub-step S301a: acquiring the sampling frequency of the inertial sensor 112.
[0082] The sampling frequency of the inertial sensor 112 is stored in the non-volatile memory 113, which ensures that the set value of the sampling frequency will not disappear even when the power is turned off.
[0083] In some implementations, the sampling frequency of the inertial sensor 112 is 10-25.6 Hz.
[0084] Sub-step S301b: creating a sampled data queue, where the sampled data queue is used to store the sampled data of the inertial sensor 112 .
[0085] The sampled data queue is created in the random access memory 114 . The sampled data queue is used to store the sampled data. The purpose of creating the sampled data is to store the sampled data in the order of sampling time to ensure the timeliness of the data.
[0086] Sub-step S301c, reading the sampled data, and marking the sampled data that has not been updated;
[0087] Sub-step S301d: storing the read sampling data into the sampling data queue, and acquiring the data in the sampling data queue.
[0088] It can be understood that the sampled data is the acceleration a of the three mutually orthogonal axes x, y and z when the floating body 120 follows the waves on the sea surface and moves as collected by the inertial sensor 112. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z It should be noted that the acceleration a is collected at each sampling point. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z , the acceleration a collected at each sampling point x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H zEach group of the sampling data is stored in the sampling data queue according to the time sequence of the sampling points corresponding to each group of the sampling data, so as to ensure the timeliness of the sampling data.
[0089] The accelerometer, angular velocity meter and magnetic field intensity meter in the inertial sensor are independent devices, and their update speeds may be different. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z Before storing in the sampled data queue, data that has not been updated needs to be marked to facilitate subsequent calculations. The marking method has been set in the computer program, including but not limited to italics, bold and color change.
[0090] In some embodiments, the acceleration a corresponding to the undulating motion of the floating body 120 following the waves on the sea surface collected by the wave measuring device 110 is obtained. x 、a y 、a z and angular velocity α x , α y , α z .
[0091] In other embodiments, the acceleration a corresponding to the undulating motion of the floating body 120 following the waves on the sea surface collected by the wave measuring device 110 is obtained. x 、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z .
[0092] Step S302: Calculate a quaternion queue corresponding to the data according to the data.
[0093] It is understandable that in some embodiments, the data includes the acceleration a collected by the inertial sensor 112. x 、a y 、a z and angular velocity α x , α y , α z In some other embodiments, the data includes the acceleration a collected by the inertial sensor 112. x、a y 、a z , angular velocity α x , α y , α z and magnetic field strength H x , H y , H z .
[0094] In some embodiments, step S302 includes: Figure 5 Sub-steps S302a to S302i are shown.
[0095] Sub-step S302a: Create a quaternion data queue.
[0096] The quaternion data queue structure is created in the random access memory 114, and the quaternion data queue is used to store the calculated quaternions. The purpose of creating the quaternion data queue is to ensure the timeliness and accuracy of the data.
[0097] Sub-step S302b: setting the quaternion corresponding to the first group of data in the sampled data queue, and storing it in the quaternion data queue.
[0098] In some implementations, the quaternion corresponding to the first set of data in the sampled data queue is set to Q W =1, Q X =0, Q Y =0, Q Z =0.
[0099] It should be noted that the quaternion corresponding to the first group of data in the sampled data queue is the first group of quaternions. The first group of quaternions are artificially set data and are independent of other factors. The first group of quaternions can be set to any data.
[0100] Sub-step S302c: reading the next set of data in the sampled data queue.
[0101] Sub-step S302d: determining whether the acceleration and angular velocity data in the next set of data have been updated.
[0102] If both the acceleration data and the angular velocity data in the next set of data have been updated, then sub-step S302f is directly executed; if at least one of the acceleration data and the angular velocity data in the next set of data has not been updated, then S302e is executed.
[0103] Sub-step S302e: the acceleration and / or the angular velocity that is not updated in the next set of data is set to the arithmetic mean of the acceleration and / or the arithmetic mean of the angular velocity of the previous set and the next set of data of the next set of data.
[0104] In some implementations, the acceleration in the next set of data is not updated, and the acceleration in the next set of data that is not updated is set to the arithmetic mean of the accelerations of the previous set of data and the next set of data of the next set of data.
[0105] Exemplarily, the next set of data is the fifth set of data, the acceleration of the fifth set of data is not updated, and the acceleration of the previous set of data (the fourth set of data) of the fifth set of data is 2 m·s -2 The acceleration of the next set of data (the sixth set of data) of the fifth set of data is 4 m·s -2 , then the acceleration of the fifth set of data is set to 3m·s -2 .
[0106] In some implementations, the angular velocity in the next set of data is not updated, and the angular velocity in the next set of data that is not updated is set to the arithmetic mean of the angular velocities of the previous set of data and the next set of data of the next set of data.
[0107] Exemplarily, the next set of data is the third set of data, the angular velocity of the third set of data is not updated, and the angular velocity of the previous set of data (the second set of data) of the third set of data is 0.5 rad·s -1 The angular velocity of the next set of data (the fourth set of data) of the third set of data is 0.2 rad·s -1 , then the angular velocity of the third set of data is set to 0.35 rad·s -1 .
[0108] In some embodiments, the acceleration and the angular velocity in the next set of data are not updated, and the acceleration and the angular velocity that are not updated in the next set of data are set to the arithmetic mean of the acceleration and the arithmetic mean of the angular velocity of the previous and next sets of data of the next set of data.
[0109] Exemplarily, the next set of data is the eighth set of data, the acceleration and the angular velocity of the eighth set of data are not updated, and the acceleration of the previous set of data (the seventh set of data) of the eighth set of data is -2 m·s -2 , the angular velocity is 0.3 rad·s -1 The acceleration of the next set of data (the ninth set of data) after the eighth set of data is 4 m·s -2 , the angular velocity is 0.5 rad·s -1, then the acceleration of the eighth set of data is set to 1 m·s -2 , the angular velocity is set to 0.4 rad·s -1 .
[0110] Sub-step S302f, determining whether the magnetic field strength is updated.
[0111] It is understandable that the data do not include the magnetic field strength H x , H y , H z , directly execute sub-step S302gⅡ.
[0112] If the magnetic field strength has been updated, sub-step S302gⅠ is executed.
[0113] If the magnetic field strength is not updated, sub-step S302gⅡ is executed.
[0114] Sub-step S302gⅠ: use the acceleration, the angular velocity and the magnetic field strength data to calculate the quaternion corresponding to the next set of data, and store it in the quaternion data queue.
[0115] Sub-step S302gⅡ: use the acceleration and the angular velocity data to calculate the quaternion corresponding to the next set of data, and store it in the quaternion data queue.
[0116] It should be noted that the quaternion corresponding to the next group of data is calculated based on the quaternion corresponding to the previous group of data of the next group of data. Exemplarily, the quaternion corresponding to the sixth group of data in the sampled data queue is calculated based on the quaternion corresponding to the fifth group of data in the sampled data queue. Therefore, for the same batch of sampled data, when the setting value of the quaternion corresponding to the first group of data in the sampled data queue is different, the calculated value of the quaternion corresponding to each remaining group of data in the sampled data queue is also different.
[0117] It should be noted that the angular velocity α x , α y , α z is the calculation data mainly used to calculate the quaternion data queue, the acceleration a x 、a y 、a z Used to correct the calculation results and update the magnetic field strength H x , H y , H z It is used to further correct the calculation results and improve the timeliness and accuracy of the quaternion data queue.
[0118] Sub-step S302h: determine whether all the data in the sampled data queue has been calculated.
[0119] If all the data in the sampled data queue has been calculated, sub-step S302i is implemented to obtain the complete quaternion queue.
[0120] If all the data in the sampled data queue has not been calculated, continue to execute sub-steps S302c to S302h.
[0121] Step S303: convert the acceleration of the data and the quaternion array into a geographic coordinate system acceleration array.
[0122] In some embodiments, step S303 includes: Figure 6 Sub-steps S303a to S303g are shown.
[0123] Sub-step S303a: creating a geographic coordinate system acceleration data queue.
[0124] The geographic coordinate system acceleration data queue is created in the random access memory 114, and the geographic coordinate system acceleration data queue is used to store the calculated geographic coordinate system acceleration. The purpose of creating the geographic coordinate system acceleration data queue is to ensure the timeliness and accuracy of the data.
[0125] Sub-step S303b: reading the acceleration of the first group of data in the sampled data queue and the first group of quaternions in the quaternion queue.
[0126] Sub-step S303c, obtaining the first geographic coordinate system acceleration by performing direction matrix cosine transformation on the acceleration of the first group of data in the sampled data queue and the first group of quaternions in the quaternion queue, and storing the result in the geographic coordinate system acceleration data queue.
[0127] Sub-step S303d, reading the acceleration of the next set of data in the sampled data queue and the next set of quaternions in the quaternion queue.
[0128] Sub-step S303e, obtaining the next geographic coordinate system acceleration by transforming the acceleration of the next set of data in the sampled data queue and the next set of quaternions in the quaternion queue through direction matrix cosine transformation, and storing the resultant acceleration in the geographic coordinate system acceleration data queue.
[0129] Sub-step S303f, determining whether all the accelerations in the sampled data queue and all the quaternions in the quaternion queue have been converted.
[0130] If all the accelerations of the sampled data queue and all the quaternions of the quaternion queue have been converted, step S303g is implemented to obtain a complete acceleration queue of the geographic coordinate system.
[0131] If all the accelerations of the sampled data queue and all the quaternions of the quaternion queue have not been converted, continue to execute sub-steps S303d to S303f.
[0132] Step S304: convert the geographic coordinate system acceleration array into a geographic coordinate system displacement spectrum.
[0133] In some embodiments, step S304 includes: Figure 7 Sub-steps S304a to S304d are shown.
[0134] Sub-step S304a, reading the geographic coordinate system acceleration queue;
[0135] Sub-step S304b, transforming the geographic coordinate system acceleration queue from the time domain to the frequency domain to obtain a geographic coordinate system acceleration spectrum;
[0136] In some implementations, a fast Fourier transform algorithm is used to transform the geographic coordinate system acceleration queue from the time domain to the frequency domain.
[0137] It can be understood that the fast Fourier transform algorithm requires that the number of input data is a positive integer power of 2. Therefore, before using the fast Fourier transform algorithm to transform the geographic coordinate system acceleration queue from the time domain to the frequency domain, it includes truncating the geographic coordinate system acceleration queue so that the number of the geographic coordinate system accelerations in the geographic coordinate system acceleration queue satisfies a positive integer power of 2.
[0138] For example, if the number of sampling points measured in a certain time is 46080, the number of the accelerations in the geographic coordinate system in the geographic coordinate system acceleration queue is also 46080. The fast Fourier transform algorithm requires that the number of input data is a positive integer power of 2. Let the positive integer be a, then a=log246080=15.49185, rounded down to 15, that is, the number of sampling points retained is 2 to the power of 15, that is, 32768, and the first 13312 elements are truncated.
[0139] Sub-step S304c, performing frequency domain integration on the acceleration spectrum of the geographic coordinate system to obtain a velocity spectrum of the geographic coordinate system;
[0140] Sub-step S304d: frequency-domain integrate the geographic coordinate system velocity spectrum to obtain the geographic coordinate system displacement spectrum.
[0141] Step S304 involves converting the wave spectrum measurement data in the time domain into the wave spectrum measurement data in the frequency domain, thereby improving the stability of the wave spectrum measurement.
[0142] Step S305: Generate a wave spectrum according to the geographic coordinate system displacement spectrum.
[0143] In some embodiments, step S305 includes: Figure 8 Sub-steps S305a to S305b are shown.
[0144] Sub-step S305a, calculating the power spectrum density and wave direction corresponding to each frequency of the displacement spectrum of the geographic coordinate system;
[0145] In some embodiments, the power spectral density is calculated as:
[0146]
[0147] Wherein, the PSD represents the power spectral density; the R Z is the real part of the Z-direction displacement of the frequency; Z is the imaginary part of the Z-direction displacement of the frequency; f is the sampling frequency of the inertial sensor; and n is the number of accelerations of the geographic coordinate system actually used in the process of transforming the acceleration queue of the geographic coordinate system from the time domain to the frequency domain.
[0148] The calculation formula of the wave direction is:
[0149]
[0150] Where X = R X ×I Z -I X ×R Z , X represents the cross product of the X-direction displacement and the Z-direction displacement of the frequency, Y = R Y ×I Z -I Y ×R Z , Y represents the cross product of the Y displacement and the Z displacement of the frequency, and the R X is the real part of the X-direction displacement of the frequency, the I X is the imaginary part of the X-direction displacement of the frequency, the R Y is the real part of the Y displacement of the frequency, the I Y is the imaginary part of the Y displacement of the frequency.
[0151] It can be understood that the X direction, the Y direction and the Z direction are respectively the positive directions of the X axis, the Y axis and the Z axis, and the Z axis is the earth's rotation axis.
[0152] Sub-step S305b, synthesizing the wave spectrum according to each frequency and the power spectrum density and wave direction corresponding to each frequency.
[0153] It can be understood that all calculation results of the above steps S301 to S305 are stored in the random access memory 114 .
[0154] In some embodiments, the wave spectrum measurement method further includes: obtaining an operation mode and a sampling duration of the wave spectrum measurement.
[0155] In actual applications, the operating mode and the sampling duration are input by the user through a transceiver on the shore (not shown) according to the user's actual needs and then acquired by the wave measuring device 110, so that the user can choose a suitable operating mode and sampling duration according to his actual needs.
[0156] To ensure that the operating mode and the sampling duration are not lost even in the event of a power outage, the operating mode and the sampling duration are stored in a non-volatile memory 113 .
[0157] In some embodiments, the wave spectrum measurement is performed in a single measurement mode, see Fig. 9 , Fig. 9 This is a program flow chart for a single measurement, including steps 11 to 13.
[0158] Step 11: Get a single measurement command and sampling duration.
[0159] Step 12: Execute the wave spectrum measurement and analysis process.
[0160] Step 13: Output the wave spectrum.
[0161] It can be understood that step 12 includes the above steps S301 to S305 , and the number of the sampling points can be determined according to the sampling duration and the sampling frequency of the inertial sensor 112 .
[0162] In some embodiments, the wave spectrum is operated in a continuous measurement mode, see Fig.10 , Fig.10 The program flow chart for continuous measurement includes steps 21 to 23.
[0163] Step 21: Obtain the continuous measurement command, sampling duration and measurement cycle.
[0164] Step 22: Execute the wave spectrum measurement and analysis process.
[0165] Step 23: Output the wave spectrum.
[0166] It can be understood that step 22 includes the above-mentioned steps S301 to S305, and the number of sampling points can be determined according to the sampling duration and the sampling frequency of the inertial sensor 112, and the number of sampling points for each measurement can be determined according to the measurement period and the sampling frequency of the inertial sensor 112.
[0167] The sampling duration in step 21 is an integer multiple of the measurement period, and the measurement period is the sampling duration of each measurement. After executing one measurement period and outputting the wave spectrum, the next measurement period is continued.
[0168] In some embodiments, the wave spectrum is operated in a timed measurement mode, see Fig.11 , Fig.11 This is a flowchart of a timing measurement program, including steps 31 to 36.
[0169] Step 31: Obtain a continuous measurement command, a time when the first measurement starts, a sampling duration, and a measurement period.
[0170] Step 32: Wait.
[0171] Step 33: Determine whether it is already at the timing moment.
[0172] If it is at the timing moment, then execute step 34; if it is not at the timing moment, then continue to execute step 32.
[0173] Step 34: Execute the wave spectrum measurement and analysis process.
[0174] Step 35: Output the wave spectrum.
[0175] Step 36: Recalculate the timing time and continue to execute steps 33 to 35.
[0176] It can be understood that step 34 includes the above-mentioned steps S301 to S305, and the time of starting the first measurement can be set as needed, which improves the flexibility of wave spectrum measurement. The measurement period includes the interval between two consecutive measurements and the sampling period of each measurement. The number of sampling points for each measurement can be determined according to the sampling period of each measurement in the measurement period and the sampling frequency of the inertial sensor 112.
[0177] It should be noted that the waiting time for the first measurement is uncertain, and the waiting time for each subsequent measurement is the interval between two consecutive measurements in the measurement cycle.
[0178] Exemplarily, the time of the first measurement in step 31 is 12:00, the measurement cycle is 60 minutes, and the interval between the two consecutive measurements in the measurement cycle is 10 minutes. If the user places the wave measuring device 100 on the sea surface at 11:45, the waiting time for the first measurement is 15 minutes, and the waiting time for each remaining measurement is 10 minutes; if the user places the wave measuring device 100 on the sea surface at 11:55, the waiting time for the first measurement is 5 minutes, and the waiting time for each remaining measurement is still 10 minutes.
[0179] It can be understood that the sampling duration in step 31 is calculated from the start of the first measurement, and the sampling duration is an integer multiple of the measurement period minus the interval between the two consecutive measurements in the measurement period.
[0180] Exemplarily, the time of the first measurement in step 31 is 12:00, the measurement cycle is 60 minutes, and the interval between two consecutive measurements in the measurement cycle is 10 minutes. If three wave spectra need to be measured, the required time is 60 minutes × 3-10 minutes = 170 minutes, and the measurement ends at 14:50.
[0181] The embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor 111 executes the program instructions to implement any of the wave spectrum measurement methods provided in the embodiment of the present application. For a detailed description of the relevant content, please refer to the control method of the above-mentioned ozone microbubble water heater, which will not be repeated here.
[0182] The computer-readable storage medium may be an internal storage unit of the wave measuring device 100 of the aforementioned embodiment, such as the non-volatile memory 113. The computer-readable storage medium may also be an external storage device of the wave measuring device 100, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., provided on the wave measuring device 100.
[0183] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A wave spectrum measurement method, characterized in that: Applied to a wave measurement device, the wave measurement device comprises: a floating body and a wave measurement device installed inside the floating body; the wave measurement device comprises an inertial sensor, and the inertial sensor is used to collect data; the method comprises: Acquire data corresponding to the movement of the floating body following the waves on the sea surface collected by the wave measurement device, wherein the data at least includes acceleration and angular velocity; Calculate the quaternion queue corresponding to the data according to the data; Convert the acceleration of the data and the quaternion array into a geographic coordinate system acceleration array; Converting the geographic coordinate system acceleration array into a geographic coordinate system displacement spectrum; generating a wave spectrum according to the geographic coordinate system displacement spectrum; Wherein, calculating the quaternion queue corresponding to the data according to the data includes: Create a quaternion data queue; The quaternion corresponding to the first group of data of the sampling data queue is set and stored in the quaternion data queue, wherein the sampling data queue is used to store the data corresponding to the movement of the floating body following the waves on the sea surface collected by the wave measurement device; Reading the next set of data in the sampled data queue, and determining whether the acceleration data and the angular velocity data in the next set of data have been updated; Setting the acceleration and / or the angular velocity that is not updated in the next set of data to the arithmetic mean of the acceleration and / or the arithmetic mean of the angular velocity of the previous set of data and the next set of data of the next set of data; Calculating the quaternion corresponding to the next set of data using the acceleration and the angular velocity data, and storing the quaternion in the quaternion data queue; When all the data in the sampled data queue are calculated, obtaining the quaternion queue; Wherein, generating a wave spectrum according to the displacement spectrum of the geographic coordinate system includes: Calculate the power spectrum density and wave direction corresponding to each frequency of the displacement spectrum of the geographic coordinate system; Synthesize the wave spectrum according to each frequency and the power spectrum density corresponding to each frequency and the wave direction; The calculation formula of the wave direction is: in, X'=R X ×I Z -I X ×R Z , X’ represents the cross product of the X-direction displacement and the Z-direction displacement of the frequency, Y'=R Y ×I Z -I Y ×R Z , Y’ represents the cross product of the Y-direction displacement and the Z-direction displacement of the frequency, R X is the real part of the X-direction displacement of the frequency, I X is the imaginary part of the X-direction displacement of the frequency, R Y is the real part of the Y displacement of the frequency, I Y is the imaginary part of the Y-direction displacement of the frequency, R Z is the real part of the Z-direction displacement of the frequency, I Z is the imaginary part of the Z-direction displacement of the frequency.
2. The wave spectrum measurement method according to claim 1, characterized in that: The calculating the power spectrum density and wave direction corresponding to each frequency of the geographic coordinate system displacement spectrum includes: The calculation formula of the power spectral density is: Wherein, the PSD represents the power spectral density; f is the sampling frequency of the inertial sensor; n It is the number of accelerations of the geographic coordinate system actually used in the process of transforming the acceleration queue of the geographic coordinate system from the time domain to the frequency domain.
3. The wave spectrum measurement method according to claim 1, characterized in that: The step of obtaining data corresponding to the movement of the floating body following the waves on the sea surface collected by the wave measuring device comprises: Acquiring a sampling frequency of the inertial sensor; Creating a sampling data queue, wherein the sampling data queue is used to store the sampling data of the inertial sensor; Reading the sampled data, and marking the sampled data that has not been updated; The read sampling data is stored in the sampling data queue, and the data in the sampling data queue is obtained.
4. The wave spectrum measurement method according to claim 1, characterized in that: The step of converting the acceleration of the data and the quaternion queue into a geographic coordinate system acceleration queue includes: The acceleration of the data is transformed with the quaternion array through a direction cosine matrix to obtain the acceleration array of the geographic coordinate system.
5. The wave spectrum measurement method according to claim 1, characterized in that: The converting the geographic coordinate system acceleration array into a geographic coordinate system displacement spectrum comprises: Read the geographic coordinate system acceleration queue; Transforming the geographic coordinate system acceleration queue from the time domain to the frequency domain to obtain a geographic coordinate system acceleration spectrum; Performing frequency domain integration on the acceleration spectrum of the geographic coordinate system to obtain a velocity spectrum of the geographic coordinate system; The geographic coordinate system velocity spectrum is integrated in the frequency domain to obtain the geographic coordinate system displacement spectrum.
6. The wave spectrum measurement method according to claim 5, characterized in that: The transformation of the geographic coordinate system acceleration queue from time domain to frequency domain adopts a fast Fourier transform algorithm.
7. The wave spectrum measurement method according to claim 3, characterized in that: The wave spectrum measurement method further includes: obtaining an operation mode and a sampling duration of the wave spectrum measurement, wherein the operation mode includes any one of single measurement, continuous measurement and timed measurement.
8. A wave measuring device, characterized in that: The wave measuring device comprises a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the wave spectrum measurement method according to any one of claims 1 to 7 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the wave spectrum measurement method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Sea wave spectrum calculation method based on inertia measurement
CN113405535A
Device And Method For Measuring Wave Motion
US20150025804A1