CN114205054A - Signal processing method and device, electronic device and storage medium - Google Patents
Signal processing method and device, electronic device and storage medium Download PDFInfo
- Publication number
- CN114205054A CN114205054A CN202111442970.3A CN202111442970A CN114205054A CN 114205054 A CN114205054 A CN 114205054A CN 202111442970 A CN202111442970 A CN 202111442970A CN 114205054 A CN114205054 A CN 114205054A
- Authority
- CN
- China
- Prior art keywords
- edge
- data
- valid
- nth
- signal
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 15
- 230000007704 transition Effects 0.000 claims abstract description 101
- 230000009191 jumping Effects 0.000 claims abstract description 54
- 238000005070 sampling Methods 0.000 claims abstract description 36
- 238000000034 method Methods 0.000 claims description 28
- 238000012545 processing Methods 0.000 claims description 8
- 101100134058 Caenorhabditis elegans nth-1 gene Proteins 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 6
- 230000003287 optical effect Effects 0.000 description 17
- 238000006243 chemical reaction Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 6
- 230000008859 change Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000001514 detection method Methods 0.000 description 4
- 238000001914 filtration Methods 0.000 description 4
- 238000012216 screening Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 2
- 230000000630 rising effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000009432 framing Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0009—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the channel coding
Landscapes
- Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Dc Digital Transmission (AREA)
Abstract
The invention provides a signal processing method and a device, electronic equipment and a storage medium, wherein the signal processing method comprises the following steps: sampling a Manchester coded signal; determining the jump edge of the Manchester coded signal according to the sampled data; determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1; and outputting the decoded data of the effective edges corresponding to the Manchester coded signals. Therefore, the effective jumping edge in the coded signal can be accurately identified, and the Manchester coded signal is accurately decoded.
Description
Technical Field
The present invention relates to the field of communications, and in particular, to a signal processing method and apparatus, an electronic device, and a storage medium.
Background
In the current communication field, for example, in an optical communication application scenario, in order to meet the 5G forwarding requirement, an operator proposes an Open-Wavelength Division Multiplexing (Open-WDM) technical scheme. In the scheme, an Operation and Maintenance Administration (OAM) physical layer adopts manchester coding, and in order to extract OAM information to realize monitoring of a network node, a dedicated chip or a dedicated Field Programmable Gate Array (FPGA) is generally adopted to decode the manchester coding in the prior art. However, this would bring a great decoding cost, and in an application scenario with a large data volume, the decoding accuracy is not high due to factors such as bit errors, and more chips or FPGA overhead is required.
Disclosure of Invention
The embodiment of the invention provides a signal processing method and device, electronic equipment and a storage medium.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a signal processing method, including:
sampling a Manchester coded signal;
determining the jump edge of the Manchester coded signal according to the sampled data;
determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1;
and outputting the decoded data of the effective edges corresponding to the Manchester coded signals.
Further, the determining whether the n-1 th transition edge is a valid edge based on a time interval between an occurrence time of the n-th transition edge and an occurrence time of the n-1 th transition edge of the manchester encoded signal includes:
and determining whether the nth transition edge is a valid edge or not based on the time interval between the occurrence time of the nth transition edge and the occurrence time of the (n-1) th transition edge of the Manchester coded signal and whether the (n-1) th transition edge is valid or not.
Further, the determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the manchester encoded signal and whether the n-1 th transition edge is valid includes:
and if the time interval between the occurrence time of the nth jumping edge and the occurrence time of the (n-1) th jumping edge of the Manchester coded signal is greater than a preset threshold value, determining the nth jumping edge as a valid edge.
Further, the method further comprises:
and if the time interval between the occurrence time of the nth hopping edge and the occurrence time of the (n-1) th hopping edge is smaller than or equal to the preset threshold, determining whether the nth hopping edge is a valid edge according to whether the (n-1) th hopping edge is valid.
Further, the determining whether the nth hopping edge is a valid edge according to whether the nth-1 hopping edge is valid includes:
if the nth-1 hopping edge is a valid edge, determining that the nth hopping edge is an invalid edge;
and if the n-1 th jumping edge is an invalid edge and the n-2 th jumping edge is a valid edge, determining that the n-th jumping edge is a valid edge.
Further, the sampling the manchester encoded signal includes:
converting the Manchester coded signal into a digital signal;
determining a clock period of the digital signal based on a frequency of the Manchester encoded signal;
equally dividing each clock period into a preset number of sub-periods;
and sampling the digital signal of each sub-period according to a preset sampling frequency.
Further, the determining the transition edge of the manchester encoded signal according to the sampled data includes:
determining an average value of a plurality of sampling data in each sub-period;
comparing the average value with a preset threshold;
if the average value of the mth sub-period and the average value of the (m-1) th sub-period are positioned on different sides of the preset threshold, determining that a jumping edge occurs in the mth sub-period; and m is a positive integer greater than 1.
Further, the outputting the decoded data of which the effective edges correspond to the manchester encoded signal includes:
acquiring a message frame corresponding to the effective edge; the message frame is used for recording the data of the effective edge;
and outputting the message frame.
Further, the acquiring the message frame corresponding to the valid edge includes:
detecting frame head data and frame tail data of the message frame corresponding to the effective edge; the frame header data is preset data of j bytes; the frame tail data is preset data of k bytes; j and k are positive integers greater than 0;
and if the preset data of j + k bytes is continuously detected, splicing the data before the preset data of j + k bytes to obtain a message frame corresponding to the effective edge.
In a second aspect, an embodiment of the present invention provides a signal processing apparatus, including:
the sampling unit is used for sampling the Manchester coded signal;
the determining unit is used for determining the jump edge of the Manchester coded signal according to the sampled data; determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1;
and the output unit is used for outputting the decoding data of which the effective edges correspond to the Manchester coding signal.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes: a processor and a memory for storing a computer program capable of running on the processor;
the processor, when running said computer program, performs the steps of one or more of the preceding claims.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions; the computer-executable instructions, when executed by a processor, are capable of implementing the methods described in one or more of the preceding claims.
The signal processing method provided by the embodiment of the invention comprises the following steps: sampling a Manchester coded signal; determining the jump edge of the Manchester coded signal according to the sampled data; determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1; and outputting the decoded data of the effective edges corresponding to the Manchester coded signals. Therefore, by identifying the jumping edges in the coded signal, effective jumping edges in the coded signal are screened out, and a large amount of invalid data caused by decoding due to error codes, signal burrs and the like is effectively inhibited, so that the decoded signal of the Manchester coded signal can be more accurately obtained. Based on the method, the accuracy and the effectiveness of the decoded data can be improved, the decoding process can be realized through a singlechip with lower cost based on the simplification of the decoding process, and a special chip or FPGA (field programmable gate array) is not required, so that the decoding overhead is reduced.
Drawings
Fig. 1 is a schematic flow chart of a signal processing method according to an embodiment of the present invention;
FIG. 2 is a diagram comparing waveforms of a digital signal and a Manchester encoded signal according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a signal processing method according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a signal processing method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a signal processing method according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating signal transition edges according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a queue according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a message frame according to an embodiment of the present invention;
FIG. 9 is a flowchart illustrating parallel multi-channel decoding according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a signal processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the description that follows, references to the terms "first \ second \ third" are intended merely to distinguish similar objects and do not denote a particular order, but rather are to be understood that the terms "first \ second \ third" may be interchanged under certain circumstances or sequences of events to enable embodiments of the invention described herein to be practiced in other than those illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
As shown in fig. 1, an embodiment of the present invention provides a signal processing method, including:
s110: sampling a Manchester coded signal;
s120: determining the jump edge of the Manchester coded signal according to the sampled data;
s130: determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1;
s140: and outputting the decoded data of the effective edges corresponding to the Manchester coded signals.
In the embodiment of the present invention, the manchester encoded signal is a signal formed based on a manchester encoding mode, as shown in fig. 2, in the manchester encoded signal, 0 represents a level transition from low to high, and 1 represents a level transition from high to low. For example, in a Wavelength Division Multiplexed (WDM) optical signal transmission scenario, the manchester encoded signal may be a manchester encoding-based jack signal generated by the far end. Here, the pilot signal may be an optical associated signal transmitted together with a main signal transmitted from a remote end, and may carry information of a remote WDM optical module. Therefore, after the manchester coded signal is received by the local terminal, the manchester coded signal can be used for analyzing and acquiring OAM data carried in the manchester coded signal, so that the monitoring of the state information of the local terminal and the remote WDM Optical module is realized without accessing an Optical module hardware management interface or an Optical monitoring Channel (OSC) additionally.
In one embodiment, sampling the manchester encoded signal may include: performing analog-to-digital conversion on the Manchester coded signal to obtain a corresponding digital signal; the digital signal is sampled. For example, when the manchester encoded signal is an optical signal, it is photoelectrically converted to obtain a digital signal.
In another embodiment, after the manchester encoded signal is sampled, the sampled data may be further filtered, such as by mean filtering and/or amplitude filtering. The S120 may include: and determining the jump edge of the Manchester coded signal according to the filtered sampling data.
In one embodiment, the transition edge of the manchester encoded signal is determined according to the sampled data, and whether the transition edge occurs may be determined according to the change of the level value corresponding to the sampled data. For example, when a level value corresponding to a certain time is different from a level value at a previous time, or when the level value corresponding to the certain time and the level value corresponding to the previous time are respectively located at two sides of a preset level threshold, or when a difference value between the level value at the certain time and the level value at the previous time is greater than a preset level difference threshold, it may be determined that a level jump occurs at the time, that is, it is determined that a jump edge occurs.
After all transition edges in the Manchester encoded signal are determined, it can be determined whether each transition edge is a valid edge. Illustratively, the validity of the first transition edge may be initially determined before decoding, e.g., the first transition edge may default to an invalid edge. Starting from the second transition edge, it is determined whether the edge is a valid edge based on the time interval between the occurrence time and the occurrence time of the previous transition edge.
In another embodiment, after determining the transition edge in the manchester-encoded signal, the occurrence time of each transition edge, i.e., the time at which a level transition begins to occur, may also be determined, and the time interval between the occurrence time of a previous transition edge may be calculated based on the occurrence time of the transition edge.
For example, the time interval may be compared with a preset threshold, and whether the jumping edge is a valid edge may be determined according to the comparison result. Here, the preset threshold may be set according to a clock period of the digital signal corresponding to the manchester encoded signal, and may be, for example, half of the clock period. Therefore, error code data with shorter time intervals in the jumping edge, namely formed invalid edges can be effectively screened out based on the valid edges determined by the time intervals, and therefore the decoded data can be provided more accurately.
In another embodiment, after the valid edge is determined in the transition edge corresponding to the manchester encoded signal, the valid edge data may be output as decoded data, or OAM frame data corresponding to the valid edge data may be acquired and the OAM frame data may be output as decoded data. Here, the decoded data may be used to determine status information of a transmitting end of the manchester encoded signal, for example, status information of a remote WDM optical module, so as to monitor optical path hardware information.
Therefore, the jumping edges in the coded signal are identified, the original signal characteristic before Manchester coding can be accurately restored, and then effective jumping edges in the coded signal are screened out through the time interval between the jumping edges, so that invalid jumping edges caused by factors such as error codes and signal burrs in decoding are better inhibited. Therefore, the decoded signal of the Manchester coded signal can be obtained more accurately, and the WDM optical module state information can be monitored more accurately. On the basis of improving the accuracy and effectiveness of Manchester coded signal decoding, the decoding process can be realized by a singlechip with lower cost based on the simplification of the decoding process, so that the response speed can be improved, and a special chip or FPGA (field programmable gate array) is not required to be used, thereby reducing the decoding overhead.
In some embodiments, as shown in fig. 3, the S130 may include:
s131: and determining whether the nth transition edge is a valid edge or not based on the time interval between the occurrence time of the nth transition edge and the occurrence time of the (n-1) th transition edge of the Manchester coded signal and whether the (n-1) th transition edge is valid or not.
In the embodiment of the present invention, whether the nth hopping edge is a valid edge may be preliminarily determined based on a time interval between an occurrence time of the nth hopping edge and an occurrence time of the (n-1) th hopping edge, for example, when the comparison between the time interval and a preset threshold is greater than the preset threshold, the nth hopping edge is a valid edge. If the time interval is less than or equal to the preset threshold, the nth jumping edge is not determined to be invalid for the moment, and whether the nth jumping edge is a valid edge or not can be further determined by further combining whether the (n-1) th jumping edge is a valid edge or not.
In one embodiment, when n is 3, determining a time interval between the occurrence time of the 3 rd transition edge and the occurrence time of the 2 nd transition edge, and if the time interval is greater than a preset threshold, determining the 3 rd transition edge as a valid edge. And if the time interval is less than or equal to the preset threshold, determining whether the 2 nd jumping edge is effective according to whether the 2 nd jumping edge is an effective edge.
Therefore, the effective edges can be further screened by combining the effectiveness of the previous jumping edge on the basis of screening the effective edges based on the time interval, so that the situation that part of the effective edges are mistaken for invalid edges in the process of determining the effective edges based on the time interval is inhibited, and the accuracy of signal decoding is further improved.
In some embodiments, as shown in fig. 4, the S131 may include:
s1311: and if the time interval between the occurrence time of the nth jumping edge and the occurrence time of the (n-1) th jumping edge of the Manchester coded signal is greater than a preset threshold value, determining the nth jumping edge as a valid edge.
In the embodiment of the present invention, when the valid edges are preliminarily screened based on the time interval, the time interval may be compared with a preset threshold, and if the time interval is greater than the preset threshold, it indicates that a sufficient time has elapsed between the nth hopping edge and the (n-1) th hopping edge, and the nth hopping edge and the (n-1) th hopping edge may be determined as valid edges.
In one embodiment, the preset threshold may be determined according to a clock period of the digital signal corresponding to the manchester encoded signal, and may be set to be half of the clock period, for example. Illustratively, when the clock cycle of the manchester encoded signal is 1ms, the preset threshold may be set to 0.5ms, and if the time interval between the occurrence time of the nth transition edge and the occurrence time of the (n-1) th transition edge is greater than 0.5ms, the nth transition edge may be determined as a valid edge.
In the original digital signal before manchester coding, when continuous 1 or 0 occurs, bit errors easily occur at corresponding positions of the continuous 1 or 0 after coding, namely, false coding causes invalid jump edges. And the time interval between the occurrence time of the invalid edge and the previous jumping edge is smaller, so that the valid edge is determined to be the one with the time interval higher than the preset threshold value based on the comparison between the preset threshold value and the time interval. Therefore, preliminary screening of effective edges can be achieved, and the identification accuracy of the effective edges is improved.
In some embodiments, as shown in fig. 5, the method further comprises:
s1312: and if the time interval between the occurrence time of the nth hopping edge and the occurrence time of the (n-1) th hopping edge is smaller than or equal to the preset threshold, determining whether the nth hopping edge is a valid edge according to whether the (n-1) th hopping edge is valid.
In the embodiment of the invention, if the preliminary screening based on the time interval cannot determine that the nth hopping edge is the valid edge, the further judgment is carried out based on whether the (n-1) th hopping edge is valid or not.
In one embodiment, the preset threshold is half of a clock cycle of a digital signal corresponding to a manchester encoded signal, and if a time interval between an occurrence time of an nth transition edge and an occurrence time of an n-1 th transition edge is less than or equal to the preset threshold, it indicates that a time interval between the nth transition edge and a previous transition edge is short, and at this time, whether the nth transition edge is valid needs to be determined according to whether the n-1 th transition edge is valid.
In some embodiments, the S1312 may include:
if the nth-1 hopping edge is a valid edge, determining that the nth hopping edge is an invalid edge;
and if the n-1 th jumping edge is an invalid edge and the n-2 th jumping edge is a valid edge, determining that the n-th jumping edge is a valid edge.
In the embodiment of the invention, the step of determining whether the nth hopping edge is the valid edge according to whether the (n-1) th hopping edge is valid may include the step of determining whether the nth hopping edge is the valid edge according to whether the (n-1) th hopping edge and the (n-2) th hopping edge are valid.
In one embodiment, as shown in fig. 6, if n is 5 and the preset threshold is half of a clock cycle, the time interval between the occurrence time of the 5 th transition edge and the occurrence time of the 4 th transition edge is first determined, and the time interval is determined to be less than or equal to the preset threshold through comparison. Further, if the 4 th jumping edge is determined to be an invalid edge and the 3 rd jumping edge is determined to be a valid edge, the 5 th jumping edge can be determined to be a valid edge.
In another embodiment, if the (n-1) th transition edge is an invalid edge and the (n-2) th transition edge is also an invalid edge, the nth transition edge is determined to be an invalid edge. For the determined invalid edge, it can be selected to be discarded and not output as decoded data. For example, only the data corresponding to the acquired valid edge is output when the decoded data is output.
Since manchester encoding is applied to successive "0" or successive "1" bits present in a digital signal, a plurality of transition edges are generated in a corresponding period in order to suppress the failure to accurately identify the start and end points of each bit "0" or "1". This encoding characteristic results in a large number of invalid transition edges in the manchester encoded signal corresponding to successive "0" or "1" digital signals. Therefore, whether the time interval and the previous jumping edge are effective edges or not can be based on the fact that the effective edges are screened out in the jumping edge more accurately and reliably, and the accuracy of signal decoding is effectively improved.
In some embodiments, the S110 may include:
converting the Manchester coded signal into a digital signal;
determining a clock period of the digital signal based on a frequency of the Manchester encoded signal;
equally dividing each clock period into a preset number of sub-periods;
and sampling the digital signal of each sub-period according to a preset sampling frequency.
In the embodiment of the invention, the frequency of the Manchester coded signal can be directly obtained based on the signal parameters, and can also be calculated and determined based on the level change condition of the signal. The frequency of the manchester encoded signal and the corresponding clock cycle of the digital signal are reciprocal, and for example, when the frequency of the manchester encoded signal is determined to be 1kHz, the clock cycle of the digital signal can be determined to be 1 ms.
In one embodiment, in order to more accurately locate the edge of each transition edge in the signal corresponding to each clock cycle, each clock cycle may be equally divided into a preset number of sub-cycles, for example, the preset number may be 8, and each sub-cycle is 125 μ s.
In another embodiment, the digital signal of each sub-period is sampled a plurality of times, for example, at a certain preset sampling frequency. Illustratively, the preset sampling frequency may be acquired 8 times per sub-period, i.e. 8 times within each 125 μ s. The sampled data may be used to calculate an average value as the digital signal level value for the sub-period in which it is located.
In one embodiment, determining the frequency of the manchester encoded signal may include: determining the level change condition of the corresponding digital signal; determining the minimum level width in the digital signal according to the level change condition; the frequency of the manchester encoded signal is determined based on the minimum level width. Here, the minimum level width is the shortest time period for which one level value in the digital signal remains unchanged, for example, the minimum level width remains unchanged for 500 μ s for a certain level value among all level values in the digital signal, and the like.
In another embodiment, the minimum level width may be a shortest time period for which a level state in the digital signal is kept unchanged, and the level state may include a first level state and a second level state. For example, the first level state may be a high level state, and the second level state may be a low level state, and for example, whether the level at each time belongs to the high level state or the low level state is determined according to a preset level threshold, the high level state may be a level value higher than the level threshold, and the low level state may be a level value lower than or equal to the level threshold.
After the minimum level width is determined, the frequency f of the manchester-encoded signal may be determined by calculating the minimum level width x, and for example, the frequency of the manchester-encoded signal may be calculated by f ═ 1/(2 x).
Therefore, each clock cycle is equally divided, and the edge of the jumping edge can be more accurately detected and positioned, so that the accuracy of positioning the jumping edge at the moment is improved, and the accuracy of judging the effective edge based on the moment is improved. In addition, the digital signal of the sub-period is sampled according to the preset sampling frequency, and the level value of the digital signal can be more accurately acquired based on the richness of sampling data.
In some embodiments, the S120 may include:
determining an average value of a plurality of sampling data in each sub-period;
comparing the average value with a preset threshold;
if the average value of the mth sub-period and the average value of the (m-1) th sub-period are positioned on different sides of the preset threshold, determining that a jumping edge occurs in the mth sub-period; and m is a positive integer greater than 1.
In the embodiment of the invention, the average value of a plurality of sampling data in a certain sub-period is calculated and determined as the level value of the signal in the sub-period. The average value is compared to a preset level threshold to determine the signal level state for the sub-period, e.g., sub-period signal level states having an average value greater than the preset threshold may be considered higher levels and sub-period signal level states having an average value less than or equal to the preset threshold may be considered lower levels.
In an embodiment, if the average value of one sub-period and the average value of the previous sub-period are located on different sides of the preset threshold, that is, the average value of the mth sub-period is greater than the preset threshold and the average value of the m-1 sub-period is less than or equal to the preset threshold, or the average value of the mth sub-period is less than or equal to the preset threshold and the average value of the m-1 sub-period is greater than the preset threshold, it may be considered that a transition edge occurs in the mth sub-period.
In another embodiment, if it is determined that the transition edge occurs in the mth sub-period, the occurrence time of the transition edge may be determined according to the mth sub-period, for example, the occurrence time of the transition edge may be a start time of the mth sub-period, or an intermediate time of the mth sub-period.
Therefore, whether the level jump occurs or not can be determined based on the level change condition of the adjacent sub-periods, and the accuracy of the determined jump edge and the accuracy of the jump edge occurrence time can be effectively improved.
In some embodiments, the S140 may include:
acquiring a message frame corresponding to the effective edge; the message frame is used for recording the data of the effective edge;
and outputting the message frame.
In an embodiment of the present invention, the data of the active edges is recorded in the manchester encoded signal in the form of a message frame. The remote WDM optical module can carry out Manchester coding on the digital signals in the form of OAM message frames and then sends the digital signals to the local terminal, and the local terminal determines the data of the effective edge, namely the OAM message frames, through jump edge detection and effective edge identification after receiving the digital signals.
In an embodiment, before acquiring the message frame corresponding to the valid edge, the method may further include: the determined valid edges are written into the queue, for example, 0 represents a valid rising edge and 1 represents a valid falling edge, and as shown in fig. 7, the valid edges are written into a queue in sequence from first to last according to the occurrence time. Here, the queue may be a circular queue.
Based on this, acquiring the message frame corresponding to the valid edge may include: the message frame corresponding to the valid edge is obtained from the queue, for example, the data in the queue may be screened by setting a window. The screened message frame is the OAM message frame encoded by the far-end WDM optical module, and can be output as the decoded data corresponding to the Manchester encoded signal.
In some embodiments, the obtaining the message frame corresponding to the valid edge includes:
detecting frame head data and frame tail data of the message frame corresponding to the effective edge; the frame header data is preset data of j bytes; the frame tail data is preset data of k bytes; j and k are positive integers greater than 0;
and if the preset data of j + k bytes is continuously detected, splicing the data before the preset data of j + k bytes to obtain a message frame corresponding to the effective edge.
In this embodiment of the present invention, the message frame may be an OAM message frame, and the format of the message frame is as shown in fig. 8, where a length of a message frame is 64 bytes (byte), a length of the message content is defined by X bytes according to the content, and a length of Y bytes is Y bytes, and a padding code of 0 is used for idle bytes in each frame. The module ID represents identification Information (ID) of the WDM optical module that generates and transmits the manchester encoded signal, and the message ID represents identification information of the message frame.
In one embodiment, since there is no close connection between message frames, when detecting the end of a frame only through 1 window of 7E, the detection may have more errors due to the presence of 7E data in the frame header. Therefore, the detection of the frame header data and the frame tail data of the message frame corresponding to the effective edge may be performed by setting a window so that the queue sequentially passes through the window, where the window may be data obtained by combining the frame header data and the frame tail data. For example, the header data may be 0 × 7E7E data, i.e., 4 pieces of 7E data, and the trailer data may be 0 × 7E data, i.e., 1 piece of 7E data. Therefore, the preset data is 7E, j is 4, k is 1, and the window length may be set to 5 bytes. When it is detected that the data in the window are all 7E, that is, 5 consecutive 7E data are detected, it may be determined that the end data of one message frame and the header data of the next message frame are detected.
In another embodiment, the window content may be set to be 5 pieces of 7E data, and when the data conforms to the window content, it may be determined that end data of one message frame and header data of a next message frame are detected.
If preset data of j + k bytes, namely frame tail data of one message frame and frame head data of the next message frame, are continuously detected, 63 bytes of data are searched forward from the 5 pieces of 7E data, and the data are spliced with the first 7E data in the window, so that a complete 64-byte message frame can be obtained.
In one embodiment, after the message frame is acquired, the message frame may be checked, for example, by a check code in the message frame. And if the verification is successful, outputting the message frame as decoding data.
In another embodiment, as shown in fig. 9, the multi-channel function of the ADC may be set by configuring the function pins of the ADC. For example, after the manchester encoded signal is converted into a digital signal, the conversion result, i.e., the digital signal, is stored in a buffer area in the memory, and the conversion result is read from the buffer area according to a certain period to perform the steps of the aforementioned step edge identification, the effective edge screening, the message frame positioning, and the like. In this way, parallel processing of multiple Manchester encoded signals can be achieved.
Therefore, based on the detection of continuous frame head data and frame tail data, the tail part of the message frame can be detected more accurately, the error rate of message frame positioning is reduced, the decoding data is provided more accurately, and the state of the far-end WDM optical module can be better monitored.
As shown in fig. 10, an embodiment of the present invention provides a signal processing apparatus, including:
a sampling unit 10 for sampling a manchester encoded signal;
a determining unit 20, configured to determine a transition edge of the manchester encoded signal according to sampled data obtained by sampling; determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1;
an output unit 30, configured to output the decoded data of which the effective edge corresponds to the manchester encoded signal.
In some embodiments, the determining unit 20 is specifically configured to:
and determining whether the nth transition edge is a valid edge or not based on the time interval between the occurrence time of the nth transition edge and the occurrence time of the (n-1) th transition edge of the Manchester coded signal and whether the (n-1) th transition edge is valid or not.
In some embodiments, the determining unit 20 is specifically configured to:
and if the time interval between the occurrence time of the nth jumping edge and the occurrence time of the (n-1) th jumping edge of the Manchester coded signal is greater than a preset threshold value, determining the nth jumping edge as a valid edge.
In some embodiments, the determining unit 20 is further configured to:
and if the time interval between the occurrence time of the nth hopping edge and the occurrence time of the (n-1) th hopping edge is smaller than or equal to the preset threshold, determining whether the nth hopping edge is a valid edge according to whether the (n-1) th hopping edge is valid.
In some embodiments, the determining unit 20 is specifically configured to:
if the nth-1 hopping edge is a valid edge, determining that the nth hopping edge is an invalid edge;
and if the n-1 th jumping edge is an invalid edge and the n-2 th jumping edge is a valid edge, determining that the n-th jumping edge is a valid edge.
In some embodiments, the sampling unit 10 is specifically configured to:
converting the Manchester coded signal into a digital signal;
determining a clock period of the digital signal based on a frequency of the Manchester encoded signal;
equally dividing each clock period into a preset number of sub-periods;
and sampling the digital signal of each sub-period according to a preset sampling frequency.
In some embodiments, the determining unit 20 is specifically configured to:
determining an average value of a plurality of sampling data in each sub-period;
comparing the average value with a preset threshold;
if the average value of the mth sub-period and the average value of the (m-1) th sub-period are positioned on different sides of the preset threshold, determining that a jumping edge occurs in the mth sub-period; and m is a positive integer greater than 1.
In some embodiments, the output unit 30 is specifically configured to:
acquiring a message frame corresponding to the effective edge; the message frame is used for recording the data of the effective edge;
and outputting the message frame.
In some embodiments, the output unit 30 is specifically configured to:
detecting frame head data and frame tail data of the message frame corresponding to the effective edge; the frame header data is preset data of j bytes; the frame tail data is preset data of k bytes; j and k are positive integers greater than 0;
and if the preset data of j + k bytes is continuously detected, splicing the data before the preset data of j + k bytes to obtain a message frame corresponding to the effective edge.
One specific example is provided below in connection with any of the embodiments described above:
the embodiment of the invention provides a method and a system for decoding Manchester codes in the field of optical communication. The system comprises: the sampling unit samples the Manchester coded signal after photoelectric conversion; the filtering unit is used for filtering the mean value and the amplitude of the sampled data; the decoding unit analyzes the filtered data, can adaptively identify the rate according to the level duration and the edge-hopping period, judges whether the current hopping edge is an effective data hopping edge according to the rate and whether the last hopping edge is the effective data hopping edge or not, stores the data corresponding to the effective data hopping edge into a cache queue, and captures an OAM information frame header sequence; and the de-framing unit performs OAM frame identification and verification on the data in the buffer queue and outputs the data as an OAM data frame. The system has the advantages of high response speed, strong fault-tolerant capability, simple structure and low cost, and can decode a plurality of channels in parallel by adopting a single microcontroller.
The decoding method and the steps comprise:
1. determining clock periods
The Manchester coding provides enough jump to recover the clock, the clock period of each bit is locked through learning, the clock period of the single chip microcomputer timer is subjected to AD C conversion results of a top-modulated signal (Manchester coded signal) through a microsecond period, the AD C conversion results are compared with a set high-low level threshold value, the width of a high level/a low level is further accurately acquired, and therefore the frequency of the Manchester coding can be acquired.
2. Determining Manchester code transition edges
The ADC conversion is performed periodically on the pilot signal (manchester encoded signal), and in order to prevent bit errors and interference caused by signal glitches, the signal is sampled a plurality of times within 1/n period of each bit, and an average value is extracted. Assuming that the rate of manchester encoding is 1k, the period of each bit is 1/1k (1 millisecond), in order to accurately sample the transition edge of each bit, each bit is divided into n periods, assuming that n is 8, each period is 125 μ s, the bits are sampled for a plurality of times (for example, 8 times) and accumulated, the accumulated result is averaged (divided by 8) to obtain an Analog-Digital (AD) value of the level at this time, the AD value is compared with the decision threshold of the level, so as to decide whether the level at this time is high or low, and then compared with the decision result of the level at the previous time, if the level at the previous time is different from the current level, it is stated that the transition of the level occurs, and an edge occurs.
3. Extracting effective jumping edges from all jumping edges and picking out ineffective jumping edges
In the next step, when an edge is detected to be generated, if the time interval between the edge and the previous edge is greater than a given threshold, the threshold may be set, for example, the threshold may be 5 (more than half a bit period, 1 bit period is 1ms, and the corresponding value is 8), and the current edge is considered to be a valid edge. If the last edge of the current leading edge is detected to be an invalid edge, and the last edge of the current leading edge is a valid edge, otherwise, the current leading edge is an invalid edge, and the current leading edge is discarded. When the alternating condition of 0-1 occurs, the time interval of the current edge from the last edge is larger than a half bit period, and when the condition of continuous 0 or continuous 1 occurs, invalidity is generated, the time intervals of all invalid edges and a valid edge before the invalid edges are smaller than a given threshold value, and the judgment whether the current edge is valid is based on whether the last edge of the current edge is a valid edge. All the detected valid edges are arranged into a circular queue according to the detection sequence, wherein 0 is a valid rising edge and 1 is a valid falling edge in the queue.
4. Setting a window to find an OAM protocol header from a selected valid edge queue
The frame head is 4 7E, the frame tail is 1 7E, the window is set to be 5 bytes, when the bit on the effective edge of the previous step flows through the window of 5 bytes, if all 5 bytes in the window are found to be 7E, the correct analysis to the tail of the protocol is indicated, and then the head and tail pointers are moved to take out the front data from the circular queue for processing.
5. Parallel multi-path decoding
The Direct Memory Access (DMA) mode of the microcontroller provides the possibility of performing AD sampling in parallel and in multiple ways. By configuring ADC function pins, setting ADC multichannel function and configuring DMA channel, ADC conversion result is enabled to be from external to internal memory, buffer area for storing result is opened up, and ADC conversion function is enabled. And reading the conversion result from the ADC conversion result buffer at a fixed time, and repeating the steps 1-4, so that the multi-path Manchester coded information can be processed in parallel on one single board.
An embodiment of the present invention further provides an electronic device, where the electronic device includes: a processor and a memory for storing a computer program capable of running on the processor, the computer program when executed by the processor performing the steps of one or more of the methods described above.
An embodiment of the present invention further provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and after being executed by a processor, the computer-executable instructions can implement the method according to one or more of the foregoing technical solutions.
The computer storage media provided by the present embodiments may be non-transitory storage media.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
In some cases, any two of the above technical features may be combined into a new method solution without conflict.
In some cases, any two of the above technical features may be combined into a new device solution without conflict.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as a removable Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (12)
1. A method of signal processing, the method comprising:
sampling a Manchester coded signal;
determining the jump edge of the Manchester coded signal according to the sampled data;
determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1;
and outputting the decoded data of the effective edges corresponding to the Manchester coded signals.
2. The method of claim 1, wherein determining whether the nth-1 transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of the nth-1 transition edge of the manchester encoded signal comprises:
and determining whether the nth transition edge is a valid edge or not based on the time interval between the occurrence time of the nth transition edge and the occurrence time of the (n-1) th transition edge of the Manchester coded signal and whether the (n-1) th transition edge is valid or not.
3. The method of claim 2, wherein determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the manchester encoded signal and whether the n-1 th transition edge is valid comprises:
and if the time interval between the occurrence time of the nth jumping edge and the occurrence time of the (n-1) th jumping edge of the Manchester coded signal is greater than a preset threshold value, determining the nth jumping edge as a valid edge.
4. The method of claim 3, further comprising:
and if the time interval between the occurrence time of the nth hopping edge and the occurrence time of the (n-1) th hopping edge is smaller than or equal to the preset threshold, determining whether the nth hopping edge is a valid edge according to whether the (n-1) th hopping edge is valid.
5. The method of claim 4, wherein the determining whether the nth hopping edge is a valid edge according to whether the (n-1) th hopping edge is valid comprises:
if the nth-1 hopping edge is a valid edge, determining that the nth hopping edge is an invalid edge;
and if the n-1 th jumping edge is an invalid edge and the n-2 th jumping edge is a valid edge, determining that the n-th jumping edge is a valid edge.
6. The method of claim 1, wherein sampling the manchester encoded signal comprises:
converting the Manchester coded signal into a digital signal;
determining a clock period of the digital signal based on a frequency of the Manchester encoded signal;
equally dividing each clock period into a preset number of sub-periods;
and sampling the digital signal of each sub-period according to a preset sampling frequency.
7. The method of claim 6, wherein determining the transition edge of the Manchester encoded signal based on the sampled data comprises:
determining an average value of a plurality of sampling data in each sub-period;
comparing the average value with a preset threshold;
if the average value of the mth sub-period and the average value of the (m-1) th sub-period are positioned on different sides of the preset threshold, determining that a jumping edge occurs in the mth sub-period; and m is a positive integer greater than 1.
8. The method of claim 1, wherein outputting the decoded data for which the valid edge corresponds to the manchester encoded signal comprises:
acquiring a message frame corresponding to the effective edge; the message frame is used for recording the data of the effective edge;
and outputting the message frame.
9. The method of claim 8, wherein the obtaining the message frame corresponding to the active edge comprises:
detecting frame head data and frame tail data of the message frame corresponding to the effective edge; the frame header data is preset data of j bytes; the frame tail data is preset data of k bytes; j and k are positive integers greater than 0;
and if the preset data of j + k bytes is continuously detected, splicing the data before the preset data of j + k bytes to obtain a message frame corresponding to the effective edge.
10. A signal processing apparatus, characterized in that the apparatus comprises:
the sampling unit is used for sampling the Manchester coded signal;
the determining unit is used for determining the jump edge of the Manchester coded signal according to the sampled data; determining whether the nth transition edge is a valid edge based on a time interval between an occurrence time of the nth transition edge and an occurrence time of an n-1 th transition edge of the Manchester encoded signal; n is a positive integer greater than 1;
and the output unit is used for outputting the decoding data of which the effective edges correspond to the Manchester coding signal.
11. An electronic device, characterized in that the electronic device comprises: a processor and a memory for storing a computer program capable of running on the processor; wherein,
the processor, when executing the computer program, performs the steps of the signal processing method of any of claims 1 to 9.
12. A computer-readable storage medium having stored thereon computer-executable instructions; the computer-executable instructions, when executed by a processor, enable the signal processing method of any of claims 1 to 9 to be implemented.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111442970.3A CN114205054A (en) | 2021-11-30 | 2021-11-30 | Signal processing method and device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111442970.3A CN114205054A (en) | 2021-11-30 | 2021-11-30 | Signal processing method and device, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114205054A true CN114205054A (en) | 2022-03-18 |
Family
ID=80649726
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111442970.3A Pending CN114205054A (en) | 2021-11-30 | 2021-11-30 | Signal processing method and device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114205054A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116132245A (en) * | 2023-02-13 | 2023-05-16 | 烽火通信科技股份有限公司 | 5G forwarding device management information monitoring method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0185556A2 (en) * | 1984-12-21 | 1986-06-25 | Advanced Micro Devices, Inc. | A method for digital clock signal recovery from manchester-encoded signals |
EP1347609A1 (en) * | 2002-03-22 | 2003-09-24 | STMicroelectronics S.r.l. | Method and apparatus for decoding Manchester-encoded signals |
WO2014090854A1 (en) * | 2012-12-14 | 2014-06-19 | Sagem Defense Securite | Demodulation of a frame encoded using manchester code |
CN105162471A (en) * | 2015-08-24 | 2015-12-16 | 武汉瑞纳捷电子技术有限公司 | Differential Manchester decoding circuit and method |
CN108512552A (en) * | 2018-06-15 | 2018-09-07 | 珠海市微半导体有限公司 | A kind of the decoding system and coding/decoding method of Manchester code |
CN109861692A (en) * | 2019-03-04 | 2019-06-07 | 北京瑞源芯科技有限公司 | The coding/decoding method and device of high speed Manchester's code |
-
2021
- 2021-11-30 CN CN202111442970.3A patent/CN114205054A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0185556A2 (en) * | 1984-12-21 | 1986-06-25 | Advanced Micro Devices, Inc. | A method for digital clock signal recovery from manchester-encoded signals |
EP1347609A1 (en) * | 2002-03-22 | 2003-09-24 | STMicroelectronics S.r.l. | Method and apparatus for decoding Manchester-encoded signals |
WO2014090854A1 (en) * | 2012-12-14 | 2014-06-19 | Sagem Defense Securite | Demodulation of a frame encoded using manchester code |
CN105162471A (en) * | 2015-08-24 | 2015-12-16 | 武汉瑞纳捷电子技术有限公司 | Differential Manchester decoding circuit and method |
CN108512552A (en) * | 2018-06-15 | 2018-09-07 | 珠海市微半导体有限公司 | A kind of the decoding system and coding/decoding method of Manchester code |
CN109861692A (en) * | 2019-03-04 | 2019-06-07 | 北京瑞源芯科技有限公司 | The coding/decoding method and device of high speed Manchester's code |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116132245A (en) * | 2023-02-13 | 2023-05-16 | 烽火通信科技股份有限公司 | 5G forwarding device management information monitoring method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103533631A (en) | Radio link performance prediction in wireless communication terminal | |
CA2371414A1 (en) | Decoding and encoding of information in audio signals | |
KR20120101570A (en) | Definition of wakeup bus messages for partial networking | |
WO2011059509A4 (en) | Detection of start frame delimiters in a wireless digital communication system | |
CN106788888A (en) | The method and system of Android mobile terminal communication success rate are improved under vulnerable network environment | |
JP2006262454A (en) | Clock reproducing method and manchester decoding method | |
CN114205054A (en) | Signal processing method and device, electronic device and storage medium | |
US20110013689A1 (en) | Digital signal receiver | |
CN1662957A (en) | Broadcast router having a serial digital audio data stream decoder | |
RU2650496C1 (en) | Method and device for detection of the frame header of a multichannel signal | |
CN1364287A (en) | Method for decreasing the processing capacity required by speech encoding and a network element | |
US7278071B2 (en) | Receiving circuit for receiving message signals | |
US8175829B2 (en) | Analyzer for signal anomalies | |
CN110635854B (en) | Transmission protocol self-adaptive decoding system and method | |
CN106612168A (en) | Voice out-of-synchronism detection method based on PCM coding characteristics | |
CN115086454B (en) | Method, system and storage medium for self-adaptive galvanometer control signal interface | |
CN102355318A (en) | Method and device for recognizing clock reference type | |
CN113678197B (en) | Method and apparatus for using incremental search sequences in audio error cancellation | |
US6567487B1 (en) | Method for the sampling of biphase coded digital signals | |
JP5787776B2 (en) | Radio wave separation device | |
CN116192998B (en) | Method, device and equipment for decoding power transmission protocol information packet | |
CN114745029B (en) | Method, device and system for synchronous acquisition of narrowband power line communication | |
CN111224748A (en) | Data transmission by wired network | |
CN112821988B (en) | Distortion signal correction method, device and storage medium | |
KR101122242B1 (en) | decoder for Manchester Coded Signal |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220318 |