CN110365342A - Waveform decoder method and device - Google Patents
Waveform decoder method and device Download PDFInfo
- Publication number
- CN110365342A CN110365342A CN201910492652.4A CN201910492652A CN110365342A CN 110365342 A CN110365342 A CN 110365342A CN 201910492652 A CN201910492652 A CN 201910492652A CN 110365342 A CN110365342 A CN 110365342A
- Authority
- CN
- China
- Prior art keywords
- data
- pointer
- file
- frame
- file data
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M5/00—Conversion of the form of the representation of individual digits
- H03M5/02—Conversion to or from representation by pulses
- H03M5/04—Conversion to or from representation by pulses the pulses having two levels
- H03M5/06—Code representation, e.g. transition, for a given bit cell depending only on the information in that bit cell
- H03M5/12—Biphase level code, e.g. split phase code, Manchester code; Biphase space or mark code, e.g. double frequency code
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Library & Information Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention discloses a kind of waveform decoder method and devices.Wherein, this method comprises: choosing the file data of predetermined length from wave file;File data is decoded;After the completion of file data decoding, judge whether wave file decodes completion;In the case where wave file decoding does not complete, the subsequent file data of selecting file data from wave file, circulation executes above-mentioned steps and is decoded, until wave file decoding is completed.The present invention solves the total decoding process of the relevant technologies, and since file is larger, decoding time is longer, the low technical problem of decoding efficiency.
Description
Technical field
The present invention relates to decoding fields, in particular to a kind of waveform decoder method and device.
Background technique
In the related art, it when being decoded to wave file, decodes, is continued until since the beginning of wave file
The decoding to wave file is completed in the ending of wave file.In the lesser situation of wave file, can quickly it be decoded,
But in the biggish situation of wave file, longer time is generally required, due to lasting decoding, will cause system program card
, load excessive needs to wait a longer time, and decoding performance is greatly reduced, and seriously affects working efficiency, reduces waveform text
The decoding efficiency and decoding speed of part.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of waveform decoder method and devices, at least to solve the total decoding side of the relevant technologies
Formula, since file is larger, decoding time is longer, the low technical problem of decoding efficiency.
According to an aspect of an embodiment of the present invention, a kind of waveform decoder method is provided, comprising: choose from wave file
The file data of predetermined length;The file data is decoded;After the completion of the file data decoding, the waveform is judged
Whether file decodes completion;In the case where wave file decoding does not complete, the text is chosen from the wave file
Number of packages executes above step and is decoded according to subsequent file data, circulation, until wave file decoding is completed.
Optionally, choosing the file data of predetermined length from wave file includes: to judge to choose from the wave file
Whether the length of file data is less than the predetermined length;It is less than the predetermined length in the length of the file data of the selection
In the case where, from the file data for the wave file chosen before, selecting file data are as the selection again
The supplementary data of file data makes the total length of the file data of the supplementary data and the selection be equal to the pre- fixed length
Degree.
Optionally, before being decoded to the file data, comprising: carried out to the analog waveform of the wave file low
Pass filter obtains waveform signal;Thresholding processing is carried out to the waveform signal, obtains corresponding digital waveform, wherein high electricity
The corresponding high level of flat data, the corresponding zero of data between the corresponding low value of low-level data and high level and low level;It is right
The digital waveform deburring.
Optionally, being decoded to the file data includes: the data frame frame head for searching the file data, described
In the case that the waveform of file data is the waveform of data frame frame head, confirmation finds the data frame frame head of the file data;
Whether the data frame format for judging the data frame frame head is main frame format;Based on the data frame format of the data frame frame head
It in the case where frame format, is decoded the file data as prime frame data, completes decoding;In the data frame frame head
In the case that data frame format is not main frame format, judge whether the data frame format of the data frame frame head is from frame format;
In the case where the data frame format of the data frame frame head is from frame format, carried out using the file data as from frame data
Decoding is completed in decoding;In the case where the data frame format of the data frame frame head is not from frame format, the number of files is searched
According to data End of Frame, terminate decoding.
Optionally, search the file data data frame frame head include: setting the first pointer and with first pointer
Differ the second pointer of the default time difference, wherein first pointer and/or second pointer, the data of direction include high level,
Low value and zero;The initial value of first pointer and second pointer is zero, controls first pointer and described
Second pointer persistently searches the file data, the file data high level for being directed toward second pointer;It is described finding
In the case that the file data that second pointer is directed toward is high level, first pointer and second pointer are controlled, is begun stepping through
File data later makes the file data of first pointer and second pointer direction while being high level;Described
In the case that the file data that one pointer and second pointer are directed toward is high level simultaneously, first pointer and described the are controlled
Two pointers continue the file data after traversal, and the data for being directed toward second pointer become low value from high level;When described
In the case that the data that two pointers are directed toward become low value from high level, first pointer and second pointer are controlled, is continued time
File data after going through, and judge whether the duration for the low value that second pointer is directed toward meets preset duration;Institute
State the second pointer to low value duration meet preset duration in the case where, determination find the data frame frame head;Otherwise,
It returns to execute and controls first pointer and second pointer, continue the file data after traversal, make second pointer
The step of data of direction become low value from high level.
Optionally, first pointer and second pointer, the file data after beginning stepping through are controlled, makes described the
The file data that one pointer and second pointer are directed toward is simultaneously high level, later further include: find second pointer and refer to
To data become zero again, or in the case where being changed into low value, return to execute and control first pointer and described the
The step of two pointers persistently search the file data, the file data high level for being directed toward second pointer.
Optionally, it controls first pointer and second pointer persistently searches the file data, make described second
The file data that pointer is directed toward is that high level includes: to control first pointer and second pointer, is jumped backward every time, described
The data of the default time difference make the file data high level of the second pointer direction to search the file data.
Optionally, before whether the data frame format for judging the data frame frame head is main frame format, further includes: by institute
The logical value for stating data frame frame head is set as the corresponding logical value of data of sampling predeterminated position, wherein predeterminated position at least wraps
It includes one of following: at 1/4BIT, at 3/4BIT.
Optionally, further includes: in the case where searching the data frame frame head of the file data, execute the data frame
The logical value of frame head, the step of being set as the data corresponding logical value of sampling predeterminated position;The data frame frame head it is subsequent
Data, rising edge at the end of using the data frame frame head in the file data is as starting point.
According to another aspect of an embodiment of the present invention, a kind of waveform decoder device is additionally provided, comprising: choose module, use
In the file data for choosing predetermined length from wave file;Decoder module, for being decoded to the file data;Judge mould
Block judges whether the wave file decodes completion after the completion of file data decoding;Loop module, in institute
State wave file decoding do not complete in the case where, the subsequent file data of the file data is chosen from the wave file,
Recursive call is decoded with upper module, until wave file decoding is completed.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, the storage medium includes storage
Program, wherein described program operation when control the storage medium where equipment execute it is any one of above-mentioned described in
Method.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, the processor is used to run program,
Wherein, described program run when execute it is any one of above-mentioned described in method.
In embodiments of the present invention, using the file data for choosing predetermined length from wave file;File data is carried out
Decoding;After the completion of file data decoding, judge whether wave file decodes completion;In the unfinished situation of wave file decoding
Under, the subsequent file data of selecting file data from wave file, circulation executes above step and is decoded, until waveform text
The mode that part decoding is completed, by being decoded with the datacycle of regular length to wave file, reached holding efficiently and
High-speed decoding, to the purpose that wave file is decoded, to realize the technology for improving decoding efficiency and improving decoding speed
Effect, and then solve the total decoding process of the relevant technologies, since file is larger, decoding time is longer, the low skill of decoding efficiency
Art problem.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of waveform decoder method according to an embodiment of the present invention;
Fig. 2 is a kind of flow chart of waveform decoder method of embodiment according to the present invention;
Fig. 3 is the schematic diagram of another waveform decoder method basic framework of embodiment according to the present invention;
Fig. 4 is the flow chart of the decoding process of embodiment according to the present invention;
Fig. 5 is the flow chart of the frame head search procedure of embodiment according to the present invention;
Fig. 6 is the schematic diagram that the frame data of embodiment according to the present invention determine;
Fig. 7 is a kind of schematic diagram of waveform decoder device according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
According to embodiments of the present invention, a kind of embodiment of the method for waveform decoder method is provided, it should be noted that attached
The step of process of figure illustrates can execute in a computer system such as a set of computer executable instructions, though also,
So logical order is shown in flow charts, but in some cases, it can be to be different from shown by sequence execution herein
Or the step of description.
Fig. 1 is a kind of flow chart of waveform decoder method according to an embodiment of the present invention, as shown in Figure 1, this method includes
Following steps:
Step S102 chooses the file data of predetermined length from wave file;
Step S104, is decoded file data;
Step S106 judges whether wave file decodes completion after the completion of file data decoding;
Step S108, in the case where wave file decoding does not complete, selecting file data are subsequent from wave file
File data, circulation execute above step and are decoded, until wave file decoding is completed.
Through the above steps, using the file data for choosing predetermined length from wave file;File data is decoded;
After the completion of file data decoding, judge whether wave file decodes completion;In the case where wave file decoding does not complete, from wave
The subsequent file data of selecting file data in shape files, circulation execute above step and are decoded, until wave file decodes
The mode of completion has been reached holding and efficiently solved with high speed by being decoded with the datacycle of regular length to wave file
Code, to the purpose that wave file is decoded, so that the technical effect for improving decoding efficiency and improving decoding speed is realized, into
And solve the total decoding process of the relevant technologies, since file is larger, decoding time is longer, the low technical problem of decoding efficiency.
When above-mentioned wave file can be the troubleshooting of MVB communication network of train, the physics waveform of the train bus-line of acquisition.
It can also be that other physics waveform files, the above-mentioned file data that predetermined length is chosen from wave file can be from waveform texts
In the data to data area pointer databuf for reading regular length in part, by the directly in situ location upper-level threshold value of this partial data
Input decoder after operation, a variable is arranged when decoding, and record is currently decoded to the position in file.Decoding has been completed every time
Just more new variables, specially variable add one to be recorded after a whole frame data.
Above-mentioned decoding may include a variety of coding/decoding methods, for example, graceful Chester decodes, can be decoded by decoder
Deng.Above-mentioned predetermined length can be the data volume of file, and above-mentioned predetermined length can also be the duration etc. of waveform.At different angles
The length for spending lower wave file is different, for example, saying in above-mentioned wave file from the angle of the data volume of file data, above-mentioned waveform
The length of file can be the length of data volume, that is to say the size of above-mentioned data volume.Change in above-mentioned wave file from waveform
Angle say that the length of above-mentioned wave file can be duration.
After the completion of the file data decoding of above-mentioned selection, it can only illustrate the text of a part of preset length of above-mentioned wave file
Number of packages is completed according to decoding, judges whether above-mentioned wave file has arrived tail of file, and does not have data, to determine above-mentioned waveform text
Whether part decodes completion.Determining the case where file data of above-mentioned selection is the last part data of above-mentioned wave file
Under, the file data of the selection is decoded and is completed, the decoding to above-mentioned wave file is also just completed.In above-mentioned wave file
In the case that decoding does not complete, continues the file data for choosing above-mentioned predetermined length from remaining wave file, is decoded,
Then judge whether above-mentioned Wave data is completed to decode, circulation executes above-mentioned steps S102 to step S106, presses to Wave data
It is decoded according to the data file of predetermined length, until the decoding of above-mentioned wave file is completed.It ensure that and Wave data was decoded
Always to decode the fair speed of the file data of predetermined length, be decoded, effectively improve the decoding effect of wave file in journey
Rate and decoding speed.
It optionally, include: the file for judging to choose from wave file from the file data that wave file chooses predetermined length
Whether the length of data is less than predetermined length;In the case where the length of the file data of selection is less than predetermined length, from before
In the file data of the wave file of selection, supplementary data of the selecting file data as the file data chosen, makes to mend again
It makes up the number and is equal to predetermined length according to the total length of the file data of selection.
It is deleted after the completion of above-mentioned supplementary data decoding, to avoid the useless decoding carried out to hash, further
Improve the decoding efficiency and decoding speed of wave file.The above-mentioned file data that predetermined length is chosen from wave file is by pre-
What the data field pointer of measured length was chosen, in above-mentioned data field pointer during selecting file data, file data
Length need and the equal length of above-mentioned data field pointer.But can not be subscribed in the length of above-mentioned wave file, therefore
When being decoded to the end of above-mentioned wave file, the length of the file data of usually all remaining wave file all can not be with above-mentioned number
According to the equal length of area's pointer.Then the above-mentioned remaining data in wave file end can not be read by data field pointer
It takes, also above-mentioned remaining data can not be just decoded, wave file is caused to be lost.In the present embodiment, in order to avoid above-mentioned feelings
The generation of condition adds supplementary data for above-mentioned remaining data, be above-mentioned remaining data with the total length of above-mentioned supplementary data with it is upper
The preset length for stating data field pointer is equal, to ensure that the efficient decoding of wave file end remaining data.
It should be noted that above-mentioned supplementary data can be the number in the default chosen position selection of above-mentioned wave file
According to for example, being chosen from the beginning of above-mentioned wave file, or being chosen from the beginning of decoded wave file, the latter is from wave
The a certain predeterminated position of shape files is chosen, and above-mentioned supplementary data is only used for choosing above-mentioned remaining data in data field pointer
When, the length of above-mentioned remaining data is made up, so that remaining data meets reading requirement.
Optionally, before being decoded to file data, comprising: low-pass filtering is carried out to the analog waveform of wave file,
Obtain waveform signal;Thresholding processing is carried out to waveform signal, obtains corresponding digital waveform, wherein high level data is corresponding
High level, the corresponding zero of data between the corresponding low value of low-level data and high level and low level;Digital waveform is gone
Burr.
The corresponding high level of above-mentioned high level can be the amplitude of high level, and the corresponding low value of above-mentioned low level can be low electricity
Flat amplitude, the amplitude of the data between above-mentioned high level and low level, is accordingly to be regarded as zero.To guarantee the accurate of digital waveform
Property.Above-mentioned high level and low value are not used to limit into for distinguishing and comparing.
Optionally, file data is decoded include: locating file data data frame frame head, in the wave of file data
In the case that shape is the waveform of data frame frame head, confirmation finds the data frame frame head of file data;Judge data frame frame head
Whether data frame format is main frame format;In the case where the data frame format of data frame frame head is main frame format, by number of files
It is decoded according to as prime frame data, completes decoding;In the case where the data frame format of data frame frame head is not main frame format,
Whether the data frame format for judging data frame frame head is from frame format;It is from frame format in the data frame format of data frame frame head
In the case of, it is decoded using file data as from frame data, completes decoding;The data frame format of data frame frame head be not from
In the case where frame format, the data End of Frame of locating file data terminates decoding.
Above-mentioned to be decoded by decoder state machine to file data decoding, decoder state machine enters first state,
The data frame frame head of locating file data, in the case where data frame frame head is the predetermined waveform of frame head, into the second state;Solution
Code state machine enters the second state, judges whether data frame frame head is main frame format, in the feelings that data frame frame head is main frame format
Under condition, into the third state;Otherwise, judge whether data frame frame head is from frame format, is from frame format in data frame frame head
In the case of, into the 4th state;Otherwise enter the 5th state;Decoder state machine enters the third state, using file data as master
Frame data are decoded, and complete decoding;Decoder state machine enters the 4th state, solves using file data as from frame data
Code completes decoding;Decoder state machine enters the 5th state, and the data End of Frame of locating file data terminates decoding.
Optionally, the data frame frame head of locating file data includes: the first pointer of setting and differs default with the first pointer
The second pointer of the time difference, wherein the first pointer and/or the second pointer, the data of direction include high level, low value and zero;First
The initial value of pointer and the second pointer is zero, controls the first pointer and the second pointer continues locating file data, make second
The file data that pointer is directed toward is high level;In the case where finding the file data of the second pointer direction is high level, control the
One pointer and the second pointer, the file data after beginning stepping through, the file data for being directed toward the first pointer and the second pointer are same
When be high level;In the case where the file data that the first pointer and the second pointer are directed toward is simultaneously high level, the first pointer of control and
Second pointer continues the file data after traversal, and the data for being directed toward the second pointer become low value from high level;When the second pointer
In the case that the data of direction become low value from high level, the first pointer and the second pointer are controlled, continues the number of files after traversal
According to, and judge whether the duration for the low value that the second pointer is directed toward meets preset duration;Second pointer to low value hold
In the case that continuous duration meets preset duration, data frame frame head is found in determination;Otherwise, it returns and executes control the first pointer and second
The step of pointer continues the file data after traversal, and the data for being directed toward the second pointer become low value from high level.
The data frame frame head of decoder state machine locating file data, is specifically as follows, and the first pointer is arranged in decoder state machine
With the second pointer for differing the default time difference with the first pointer, wherein the first pointer and/or the second pointer, the data of direction include
High level, low value and zero;First pointer and the second pointer enter state 0, in state 0, control the first pointer and the second pointer
Continue locating file data;In the case where finding the data of the second pointer direction is high level, into state 1, in state 1
In, the first pointer and the second pointer are controlled, traversal enters the file data after state 1;Refer in the first pointer and the second pointer
To data be high level simultaneously in the case where, into state 2, in state 2, control the first pointer and the second pointer, traverse into
Enter the file data after state 2;In the case that the data that the second pointer is directed toward become low value from high level, into state 3,
In state 3, the first pointer and the second pointer are controlled, traversal enters the file data after state 3;The second pointer to low electricity
In the case that flat duration meets preset duration, data frame frame head is found in determination;Otherwise, into state 2.
Optionally, controlling the first pointer and the second pointer, the file data after beginning stepping through makes the first pointer and second
The file data that pointer is directed toward is simultaneously high level, later further include: the data for finding the second pointer direction become zero again,
Or in the case where being changed into low value, returns to execution the first pointer of control and the second pointer continues locating file data, make second
The step of file data that pointer is directed toward is high level.
In the case where above-mentioned first pointer and the second pointer enter state 1, in state 1, file data is traversed, is searched
The data being directed toward to the second pointer become zero again, or in the case where being changed into low value, illustrate that the high point found is chosen as hair
Thorn interference, returns in state 0, continues to search.
Optionally, it controls the first pointer and the second pointer continues locating file data, the number of files for being directed toward the second pointer
According to including: the first pointer of control and the second pointer for high level, jumps backward every time, the data of the time difference are preset, with locating file number
According to the file data high level for being directed toward the second pointer.
First pointer and the second pointer, jump backward every time, preset the data of the time difference, the second pointer be transferred to after it is default
The file data of the time difference, the first pointer jump to the position of the file data where the second pointer last time.It can be quickly with the side of Mi Pu
Formula searches entire wave file.Due to there is a large amount of zero in wave file, with the lookup of above-mentioned great-jump-forward than traversal
The mode of lookup, it is more efficient.To improve the decoded efficiency of data and speed.
Optionally, before whether the data frame format for judging data frame frame head is main frame format, further includes: by data frame
The logical value of frame head, be set as sampling predeterminated position the corresponding logical value of data, wherein predeterminated position include at least it is following it
At one: 1/4BIT, at 3/4BIT.
Due to the data dithering of wave file, only occur in the biggish situation of rising edge ringing effect, in order to avoid number
According to fluctuation, data is caused to determine that the time is long, data can be chosen in the medium position of BIT, the data frame as data frame frame head
The starting point of format.It can also be by the data of the several sampled points of more options, with the accuracy for the data for ensuring to choose, to protect
The accuracy of the starting point of the data frame format of data frame frame head is demonstrate,proved, calculating speed is improved.
Optionally, further includes: in the case where the data frame frame head of locating file data, execute patrolling data frame frame head
Volume value, the step of being set as the data corresponding logical value of sampling predeterminated position;The follow-up data of data frame frame head, with data frame
Rising edge at the end of frame head is in file data is as starting point.
It should be noted that the present embodiment additionally provides a kind of optional embodiment, the embodiment is carried out below
It is described in detail.
The present invention relates to field of signal processing, a kind of MVB physics waveform quickly decoded method in graceful Chester is proposed.Phase
Than traditional coding/decoding method, there is significant increase on this method decoding performance.In train MVB network communication problem troubleshooting, usually
Need to acquire train bus-line physics waveform analytical equipment failure cause.In order to quickly search equipment physics waveform, investigation event is improved
Barrier investigation efficiency, generally requires the automatic positioning that equipment waveform is realized by software decoding process.Traditional MVB physics waveform solution
Code method is still able to satisfy requirement of real-time, but if needing to decode the waveform in a macro period when decoding is compared with small echo shape files
When data, up to a hundred seconds time is needed under generally requiring waiting tens seconds or even certain running environment, decoding performance will seriously affect
Working efficiency.The invention proposes a kind of MVB physics waveform decoding optimization method, this method is quasi- in decoding speed and decoding result
True property has significant increase.Present embodiments provide for a kind of MVB physics waveform coding/decoding method, thinkings are as follows: and low-pass filtering →
Thresholding → deburring → manchester decoder.Fig. 2 is a kind of process of waveform decoder method of embodiment according to the present invention
Figure, detailed process are as shown in Figure 2:
The coding/decoding method is in 60M sample rate, Intel (R) Core (TM) i5-6200U@2.30GHz processor WIN7 operation
Under system and ARM7 666MHz processor (SuSE) Linux OS environment, decoding speed test result is as shown in table 1:
Table 1: decoding speed test result
Wave file size (MB) | Host computer decoding speed (s) | ARM platform decoding speed (s) |
8 | 1 | 23 |
48 | 5 | 158 |
121 | 8 | 317 |
288 | 21 | 760 |
In terms of test result, which needs to wait long period, decoding effect when parsing biggish wave file
Rate is low.
Present embodiment additionally provides a kind of new decoding method under above-mentioned environment, decoding speed test result such as 2 institute of table
Show:
Table 2: new decoding method decoding speed test result
Wave file size (MB) | Host computer decoding speed (s) | ARM platform decoding speed (s) |
8 | 0.017 | 0.15 |
48 | 0.10 | 0.89 |
121 | 0.25 | 2.18 |
288 | 0.57 | 5.3 |
Original decoding speed is compared, the method for new version can achieve 30~50 times in WIN7 system-computed speed
It is promoted, and on ARM platform, speed more has 150 times or so of speed to be promoted.
The above-mentioned new decoding method of present embodiment is the optimization method of above-mentioned coding/decoding method, and this method is in the above method
Wave file reads part and manchester decoder part is optimized.Wherein manchester decoder process optimization part is wrapped
It includes: increasing decoder state machine, increases frame head lookup state machine, data frame judgement.Fig. 3 is the another of embodiment according to the present invention
The schematic diagram of kind waveform decoder method basic framework, new method basic framework are as shown in Figure 3.
This method includes following key point:
Wave file is read: to reduce waveform decoder to system resources consumption, this method reads waveform using segmentation and solves
The working method of code, it is every time from the data of reading regular length in file into databuf, this partial data is directly in situ
Manchester decoder is sent into after location upper-level threshold value operation, and a DataIndex variable is arranged in when decoding, and record is currently decoded to
Position in file.Decoding is completed just to update DataIndex record after a complete frame data every time, when single is decoded to
When databuf ends up, if discovery remaining data is not enough to complete a frame decoding, the position terminated from previous frame is re-read
File.
Decoder state machine: it is divided into 5 states when decoding:
1, Idle state: searching the startbit of frame head, if finding the high level and half BIT weeks that one is greater than 125ns
The low level of phase, into DecSD state;
2, DecSD state: decoding MVB message frame head then enters DecMasterData state if prime frame format;If
From frame format, then enter DecSlaveData state;Otherwise enter DecUnknownData state;
3, DecMasterData state: decoding prime frame data, until frame end;
4, DecSlaveData state: decoding is from frame data, until frame end;
5, DecUnknownData state: directly then lookup End of Frame, i.e. 0 level state of a segment length return
Idle state;
Idle state is jumped back at the end of three kinds of states afterwards, and frame count is added one, updates DataIndex.
If any state traverses buffer area ending in five kinds of states, function is jumped out, reads file, updates buffer area,
The index of file is read since the frame end of previous frame.Fig. 4 is the flow chart of the decoding process of embodiment according to the present invention, solution
Code state machine process is as shown in Figure 4.
It searches frame head state machine: will be above the high level of high threshold when carrying out threshold process according to MVB wave characteristics
10 are all set as, the low level lower than Low threshold is all set as -10, and the primary system one between two threshold values is classified as 0.
When searching frame head, p, q, two pointer differences 125ns (frame head high level minimum time) of two pointers are set, place is worked as
When original state 0, q pointer every time backward jump 125ns data, p jumps to the position of original q, if the value or 0 that q is found,
Then continue to search in state 0, otherwise enters state 1.Because there is a large amount of 0 value in Wave data, searched with such great-jump-forward
It can be higher than traversal formula search efficiency.When into succeeding state, then searches data and use traversal mode.
When enter state 1 when, continue ergodic data, it is necessary to work as p, q enters state 2 simultaneously when being high, if q become again again 0 or
Person -10, then illustrate that the high level found for burr interference, returns to 0 state.
In state 2, ergodic data searches the failing edge of startbit, when q changes low level, into state 3;Otherwise after
Continue in state 2.
In state 3, check whether low level length meets half of BIT, if satisfied, then function returns;Otherwise p is skipped to below
High level position returns to state 2.
Fig. 5 is the flow chart of the frame head search procedure of embodiment according to the present invention, inquires state machine process such as Fig. 5 institute
Show.
Frame data determine: in optimization method, in order to accelerate calculating speed, in the logical value for judging Manchester's code
Locate data using 1/4,3/4BIT of sampling, it is primary to determine, because shaking substantially only when rising edge ringing effect is bigger
Occur, in the middle position of BIT, data are basicly stable (to improve accuracy rate, can also to be taken several sampled points more, sacrifice part
Speed).Synchronizing for data is unified in completion when frame head finds startbit, at the end of each subsequent BIT is with startbit
Rising edge is as starting point.Fig. 6 is the schematic diagram that the frame data of embodiment according to the present invention determine, frame data decision process is as schemed
Shown in 6.
Fig. 7 is a kind of schematic diagram of waveform decoder device according to an embodiment of the present invention, as shown in fig. 7, according to the present invention
The another aspect of embodiment additionally provides a kind of waveform decoder device, comprising: chooses module 72, decoder module 74, judgment module
76 and loop module 78, the device is described in detail below.
Module 72 is chosen, for choosing the file data of predetermined length from wave file;Decoder module 74, with selection module
72 are connected, for being decoded to file data;Judgment module 76 is connected with above-mentioned decoder module 74, is used for file data solution
After the completion of code, judge whether wave file decodes completion;Loop module 78, for the situation unfinished in wave file decoding
Under, the subsequent file data of selecting file data, recursive call are decoded from wave file with upper module, until waveform text
Part decoding is completed.
By above-mentioned apparatus, the file data of predetermined length is chosen from wave file using selection module 72;Decoder module
74 pairs of file datas are decoded;After the completion of the decoding of 76 file data of judgment module, judge whether wave file decodes completion;It follows
Ring moulds block 78 is not in the case where wave file decoding completes, the subsequent file data of selecting file data from wave file,
Circulation executes above step and is decoded, until the mode that wave file decoding is completed, by with the datacycle of regular length
Wave file is decoded, has reached and has kept efficient and high-speed decoding, to the purpose that wave file is decoded, to realize
It improves decoding efficiency and improves the technical effect of decoding speed, and then solve the total decoding process of the relevant technologies, due to text
Part is larger, and decoding time is longer, the low technical problem of decoding efficiency.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, storage medium includes the journey of storage
Sequence, wherein equipment where control storage medium executes any one of above-mentioned method in program operation.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, processor is used to run program,
In, program executes any one of above-mentioned method when running.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module
It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or
Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code
Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (12)
1. a kind of waveform decoder method characterized by comprising
The file data of predetermined length is chosen from wave file;
The file data is decoded;
After the completion of the file data decoding, judge whether the wave file decodes completion;
In the case where wave file decoding does not complete, the subsequent text of the file data is chosen from the wave file
Number of packages evidence, circulation execute above step and are decoded, until wave file decoding is completed.
2. the method according to claim 1, wherein choosing the file data packet of predetermined length from wave file
It includes:
Judge whether the length for the file data chosen from the wave file is less than the predetermined length;
In the case where the length of the file data of the selection is less than the predetermined length, from the waveform text chosen before
In the file data of part, supplementary data of the selecting file data as the file data of the selection, makes the supplement number again
It is equal to the predetermined length according to the total length of the file data with the selection.
3. according to the method described in claim 2, it is characterized in that, before being decoded to the file data, comprising:
Low-pass filtering is carried out to the analog waveform of the wave file, obtains waveform signal;
Thresholding processing is carried out to the waveform signal, obtains corresponding digital waveform, wherein the corresponding height of high level data
Value, the corresponding zero of data between the corresponding low value of low-level data and high level and low level;
To the digital waveform deburring.
4. according to the method described in claim 3, it is characterized in that, being decoded to the file data and including:
The data frame frame head for searching the file data, the case where the waveform of the file data is the waveform of data frame frame head
Under, confirmation finds the data frame frame head of the file data;
Whether the data frame format for judging the data frame frame head is main frame format;
In the case where the data frame format of the data frame frame head is main frame format, using the file data as prime frame data
It is decoded, completes decoding;
In the case where the data frame format of the data frame frame head is not main frame format, the data of the data frame frame head are judged
Whether frame format is from frame format;
In the case where the data frame format of the data frame frame head is from frame format, using the file data as from frame data
It is decoded, completes decoding;
In the case where the data frame format of the data frame frame head is not from frame format, the data frame of the file data is searched
Ending terminates decoding.
5. according to the method described in claim 4, it is characterized in that, the data frame frame head for searching the file data includes:
First pointer is set and differs the second pointer of the default time difference with first pointer, wherein first pointer and/or
Second pointer, the data of direction include high level, low value and zero;
The initial value of first pointer and second pointer is zero, controls first pointer and second pointer
The file data is persistently searched, the file data high level for being directed toward second pointer;
In the case where finding file data that second pointer is directed toward and being high level, first pointer and described the are controlled
Two pointers, the file data after beginning stepping through, the file data for being directed toward first pointer and second pointer is simultaneously
For high level;
In the case where the file data that first pointer and second pointer are directed toward is simultaneously high level, control described first
Pointer and second pointer continue the file data after traversal, and the data for being directed toward second pointer become from high level
Low value;
In the case that the data that second pointer is directed toward become low value from high level, first pointer and described second are controlled
Pointer continues the file data after traversal, and it is pre- to judge whether the duration for the low value that second pointer is directed toward meets
If duration;
Second pointer to the duration of low value meet preset duration in the case where, the data frame frame is found in determination
Head;Otherwise, it returns to execute and controls first pointer and second pointer, continue the file data after traversal, make described
The step of data that second pointer is directed toward become low value from high level.
6. according to the method described in claim 5, it is characterized in that, control first pointer and second pointer, start
File data after traversal makes the file data of first pointer and second pointer direction while being high level, later
Further include:
Find the data that second pointer is directed toward becomes zero again, or in the case where being changed into low value, returns and execute
It controls first pointer and second pointer persistently searches the file data, the number of files for being directed toward second pointer
According to the step of for high level.
7. according to the method described in claim 6, it is characterized in that, control first pointer and second pointer are persistently looked into
The file data is looked for, the file data high level for being directed toward second pointer includes:
First pointer and second pointer are controlled, is jumped backward every time, the data of the default time difference, described in searching
File data, the file data high level for being directed toward second pointer.
8. method according to any one of claims 4 to 7, which is characterized in that judging the data frame frame head
Before whether data frame format is main frame format, further includes:
By the logical value of the data frame frame head, it is set as the corresponding logical value of data of sampling predeterminated position, wherein default position
It sets including at least one of following: at 1/4 BIT, at 3/4 BIT.
9. the method according to the description of claim 7 is characterized in that further include:
In the case where searching the data frame frame head of the file data, execute the logical value of the data frame frame head, setting
The step of data corresponding logical value to sample predeterminated position;
The follow-up data of the data frame frame head, rising edge at the end of with the data frame frame head in the file data are made
For starting point.
10. a kind of waveform decoder device characterized by comprising
Module is chosen, for choosing the file data of predetermined length from wave file;
Decoder module, for being decoded to the file data;
Judgment module judges whether the wave file decodes completion after the completion of file data decoding;
Loop module, for choosing the text from the wave file in the case where wave file decoding does not complete
Number of packages is decoded according to subsequent file data, recursive call with upper module, until wave file decoding is completed.
11. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When control the storage medium where equipment perform claim require any one of 1 to 9 described in method.
12. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run
Benefit require any one of 1 to 9 described in method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910492652.4A CN110365342B (en) | 2019-06-06 | 2019-06-06 | Waveform decoding method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910492652.4A CN110365342B (en) | 2019-06-06 | 2019-06-06 | Waveform decoding method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110365342A true CN110365342A (en) | 2019-10-22 |
CN110365342B CN110365342B (en) | 2023-05-12 |
Family
ID=68215739
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910492652.4A Active CN110365342B (en) | 2019-06-06 | 2019-06-06 | Waveform decoding method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110365342B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113868189A (en) * | 2021-12-02 | 2021-12-31 | 成都奥卡思微电科技有限公司 | Waveform file processing method, storage medium and device |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0396403A1 (en) * | 1989-05-04 | 1990-11-07 | Nortel Networks Corporation | Data stream frame synchronisation |
US20020057747A1 (en) * | 2000-11-10 | 2002-05-16 | Samsung Electronics Co., Ltd. | Apparatus and method for decoding data of unknown frame length |
CN1848241A (en) * | 1995-12-01 | 2006-10-18 | 数字剧场系统股份有限公司 | Multi-channel audio frequency coder |
CN101331733A (en) * | 2005-12-16 | 2008-12-24 | 杜比瑞典公司 | Apparatus for generating and interpreting a data stream having a series of segments using data in subsequent data frames |
CN101478466A (en) * | 2009-01-16 | 2009-07-08 | 中国北车股份有限公司大连电力牵引研发中心 | MVB analogue signal input module based on FPGA |
CN101895549A (en) * | 2010-07-21 | 2010-11-24 | 中国北车股份有限公司大连电力牵引研发中心 | Conversion gateway and conversion method of vehicle communication network data |
CN102307078A (en) * | 2011-08-22 | 2012-01-04 | 株洲南车时代电气股份有限公司 | Method for realizing MVB/WTB frame data real-time decoding by utilizing oscilloscope |
CN104837073A (en) * | 2015-05-12 | 2015-08-12 | 无锡天脉聚源传媒科技有限公司 | Method and device for decoding WMV (Windows Media Video) file |
CN106209509A (en) * | 2016-07-05 | 2016-12-07 | 北京轩宇空间科技有限公司 | A kind of MVB monitor |
CN108429738A (en) * | 2018-02-11 | 2018-08-21 | 中车青岛四方机车车辆股份有限公司 | A kind of data analysis method and analyzing platform |
-
2019
- 2019-06-06 CN CN201910492652.4A patent/CN110365342B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0396403A1 (en) * | 1989-05-04 | 1990-11-07 | Nortel Networks Corporation | Data stream frame synchronisation |
CN1848241A (en) * | 1995-12-01 | 2006-10-18 | 数字剧场系统股份有限公司 | Multi-channel audio frequency coder |
US20020057747A1 (en) * | 2000-11-10 | 2002-05-16 | Samsung Electronics Co., Ltd. | Apparatus and method for decoding data of unknown frame length |
CN101331733A (en) * | 2005-12-16 | 2008-12-24 | 杜比瑞典公司 | Apparatus for generating and interpreting a data stream having a series of segments using data in subsequent data frames |
CN101478466A (en) * | 2009-01-16 | 2009-07-08 | 中国北车股份有限公司大连电力牵引研发中心 | MVB analogue signal input module based on FPGA |
CN101895549A (en) * | 2010-07-21 | 2010-11-24 | 中国北车股份有限公司大连电力牵引研发中心 | Conversion gateway and conversion method of vehicle communication network data |
CN102307078A (en) * | 2011-08-22 | 2012-01-04 | 株洲南车时代电气股份有限公司 | Method for realizing MVB/WTB frame data real-time decoding by utilizing oscilloscope |
CN104837073A (en) * | 2015-05-12 | 2015-08-12 | 无锡天脉聚源传媒科技有限公司 | Method and device for decoding WMV (Windows Media Video) file |
CN106209509A (en) * | 2016-07-05 | 2016-12-07 | 北京轩宇空间科技有限公司 | A kind of MVB monitor |
CN108429738A (en) * | 2018-02-11 | 2018-08-21 | 中车青岛四方机车车辆股份有限公司 | A kind of data analysis method and analyzing platform |
Non-Patent Citations (2)
Title |
---|
HONGTAO ZHANG等: "("All Metadata":decode) AND ("All Metadata":data length) AND ("All Metadata":date frame)", 《IEEE ACCESS 》 * |
王永玉等: "基于整数小波变换和SPIHT编码的录波数据压缩算法", 《继电器》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113868189A (en) * | 2021-12-02 | 2021-12-31 | 成都奥卡思微电科技有限公司 | Waveform file processing method, storage medium and device |
Also Published As
Publication number | Publication date |
---|---|
CN110365342B (en) | 2023-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106302632B (en) | Downloading method of basic mirror image and management node | |
CN102148805B (en) | Feature matching method and device | |
US9712646B2 (en) | Automated client/server operation partitioning | |
US8190857B2 (en) | Deleting a shared resource node after reserving its identifier in delete pending queue until deletion condition is met to allow continued access for currently accessing processor | |
CN105808342B (en) | method, judgment device and system for distributing client request | |
CN108228799B (en) | Object index information storage method and device | |
CN109388614A (en) | A kind of method, system and the equipment of catalogue file number quota | |
CN114327280B (en) | Message storage method and system based on cold and hot separation storage | |
CN104239134A (en) | Method and device for managing tasks of many-core system | |
CN113132267B (en) | Distributed system, data aggregation method and computer readable storage medium | |
CN110427404A (en) | A kind of across chain data retrieval system of block chain | |
CN107977275B (en) | Task processing method based on message queue and related equipment | |
CN116166690A (en) | Mixed vector retrieval method and device for high concurrency scene | |
CN110134646B (en) | Knowledge platform service data storage and integration method and system | |
CN110365342A (en) | Waveform decoder method and device | |
CN109697281A (en) | The online method, apparatus and electronic equipment for merging document | |
CN113407343A (en) | Service processing method, device and equipment based on resource allocation | |
CN110008030A (en) | A kind of method of metadata access, system and equipment | |
CN116089477B (en) | Distributed training method and system | |
CN107870921B (en) | Log data processing method and device | |
CN109189343B (en) | Metadata disk-dropping method, device, equipment and computer-readable storage medium | |
CN110928902A (en) | Query method and system for acquiring cloud platform terminal data aiming at paging | |
CN116126937A (en) | Job scheduling method, job scheduling device, electronic equipment and storage medium | |
CN111090513B (en) | Method for detecting link health state of Internet of vehicles platform terminal and storage medium | |
CN112395081A (en) | Resource online automatic recovery method, system, server and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |