High-speed data abstracting method based on the input and output arranged in sequence that FPGA realizes
Technical field
The invention belongs to Data Extraction Technology field, a kind of input and output realized based on FPGA are sequentially
The high-speed data abstracting method of arrangement.
Background technology
Data pick-up and by certain way, former data sequence is carried out data take out value, this has in a lot of reality cases should
It is sequentially order with, general abstracting method and takes out value situation, if the time function of certain initial data model is X (t), (t takes 0,
1,2 ... infinite), this pattern function is carried out every N number of value and takes the computing of a value, and carried out this model extracting ratio for N's
Extraction running.Abstracting method application mode in sampling system and principle are also such, and the institute that temporally samples sampling system
Data carry out certain intervals take out value behavior, it can effectively reduce data rate.
Based on current sample rate in GHz and above high-speed a/d applicable cases, according to the difference of data handling utility demand,
Original high-speed a/d sampled data need to first be extracted, stores by a lot of situations, computing, analyzing and processing.To high-speed sampling
Data necessarily extract in FPGA than the mode of directly extraction be realize the quick reduction of speed of data, data effectively process, data
The effectively method of transmission.Owing to FPGA processing speed is limited, GHz and above high-speed a/d data directly carry out tradition in FPGA
The method extracted the most one by one can not realize, and divides, also based on current high-speed a/d converter, the situation that multichannel reduction of speed exports, because of many
Circuit-switched data is simultaneously or interval exports, and has thus upset the pattern of original single-pass data extraction, it is impossible to directly carry out waiting extraction ratio
Direct extraction activity, extraction situation complicated and changeable, for adapt to high-speed a/d converter multiple-channel output situation, the most general
Extraction activity is both for what single channel was carried out, and as high-speed a/d converter divides four tunnel outputs, most extraction situation is all just for it
In a road, thus causing extracting specific factor can only be able to not be specific situation for arbitrary value.As only taken single-pass data, then may be used
Realize the extraction extraction than 4, take a value as single-pass data is the most N number of, then carry out extraction than the extraction for 4*N.Such take out
The extraction ratio taking computing realization is all the multiple proportion of 4, and extraction situation is restricted.
Therefore, prior art existing defects, need to improve.
Summary of the invention
The technical problem to be solved is for the deficiencies in the prior art, it is provided that a kind of based on FPGA realization defeated
Enter to export the high-speed data abstracting method of arranged in sequence.
Technical scheme is as follows:
The high-speed data abstracting method of a kind of input and output arranged in sequence realized based on FPGA, wherein, including following step
Rapid:
Step 1: input 12 groups of data;Judge that extraction ratio, whether less than 12, is then to enter step 6, otherwise enters step 2;
Step 2: judge whether count value reaches to take out value condition, is then to enter step 3, returns step after otherwise counting increases by 12
Rapid 1;
Step 3: in the extraction step 1 of location, a value in 12 groups of data is as decimation value, enters step 4, then remainder meter
Enter circulation next time and return step 1;
Step 4: decimation value is sequentially given output number;Enter step 5;
Step 5: judge whether to meet 12 groups of data output conditions, be to export the numerical value of 12 groups of data of extraction, and defeated
After going out counting clearing, return step 4;Otherwise output counting returns step 4 after adding 1;
Step 6: carry out classification process according to extraction ratio, when extraction is than entrance step 7 when being 2;When extraction enters than when being 3
Step 8;When extraction is than entrance step 9 when being 4;When extraction is than entrance step 10 when being 5;When extraction is than entrance step 11 when being 6;
When extraction is than entrance step 12 when being 7;When extraction is than entrance step 13 when being 8;When extraction is than entrance step 14 when being 9;When taking out
Take ratio for entering step 15 when 10;When extraction is than entrance step 16 when being 11;
Step 7: extraction ratio is to take out value when 2 to process, and returns step 1;
Step 8: extraction ratio is to take out value when 3 to process, and returns step 1;
Step 9: extraction ratio is to take out value when 4 to process, and returns step 1;
Step 10: extraction ratio is to take out value when 5 to process, and returns step 1;
Step 11: extraction ratio is to take out value when 6 to process, and returns step 1;
Step 12: extraction ratio is to take out value when 7 to process, and returns step 1;
Step 13: extraction ratio is to take out value when 8 to process, and returns step 1;
Step 14: extraction ratio is to take out value when 9 to process, and returns step 1;
Step 15: extraction ratio is to take out value when 10 to process, and returns step 1;
Step 16: extraction ratio is to take out value when 11 to process, and returns step 1;
Described abstracting method, wherein, 12 groups of data in described step 1 are that the data of 3 A/D conversions are combined taking out
Take.
Described abstracting method, wherein, in described step 2, taking out value condition is that count value is less than or equal to extract ratio, and is more than
Extraction ratio subtracts 12.
Described abstracting method, wherein, the output condition in described step 5 for output count value whether can dividend whole
Removing, described divisor is 11.
Described abstracting method, wherein, in described step 3, in described extraction step 1 value in 12 groups of data be
Meeting when taking out value condition, the data positioned are the counting numerical value equal to extraction ratio.
Described abstracting method, wherein, in described step 1, described extraction ratio is when being 2, every time from 12 data of input
Middle extraction 6 number, needs 2 operating process to pump full and once exports combination, and output data rate reduces to the 1/2 of input;Described extraction ratio
When being 3, from 12 data of input, extract 4 numbers every time, need 3 operating process to pump full and once export combination, export data
Rate reduces to the 1/3 of input;Described extraction ratio, when being 4, extracts 3 numbers every time from 12 data of input, needs 4 operating process
Pumping full and once export combination, output data rate reduces to the 1/4 of input;Described extraction ratio, when being 5, is taken out from every 5 of the beginning of circulation
Taking a value, remainder counts the sum of next time, need to circulate operation altogether and pump full for 5 times and once export combination, and output data rate is reduced to defeated
1/5 entered;Described extraction ratio, when being 6, extracts 2 numbers from 12 data of input every time, need to circulate operation altogether and can pump full for 6 times
Once exporting combination, output data rate reduces to the 1/6 of input;Beginning every 7 extractions one when being 7, from circulation of the described extraction ratio
Individual value, remainder counts the sum of next time, need to circulate operation altogether and pump full for 7 times and once export combination, and output data rate reduces to input
1/7;Described extraction ratio is when being 8, and beginning one value of every 8 extractions from circulation, remainder counts the sum of next time, need to circulate behaviour altogether
Making to pump full for 8 times once to export combination, output data rate reduces to the 1/8 of input;Described extraction ratio is when being 9, from the beginning every 9 of circulation
Individual extraction one value, remainder counts the sum of next time, need to circulate operation altogether and pump full for 9 times and once export combination, and output data rate drops
For input 1/9;Described extraction ratio is when being 10, and a value is extracted in every 10 of the beginning from circulation, and remainder counts the sum of next time,
Need to circulate altogether to operate can pump full for 10 times and once export combination, output data rate reduces to the 1/10 of input;Extraction ratio is when being 11, from following
Beginning one value of every 11 extractions of ring, remainder counts the sum of next time, need to circulate operation altogether and can pump full once output group 11 times
Closing, output data rate reduces to the 1/11 of input;The extraction ratio of extraction, during more than or equal to 12, is only counted by described extraction ratio
12 numbers being currently entered are carried out data locking peek by number when meeting condition, then remainder counts sum next time.
Use such scheme, to carry out under the applicable cases of high-speed a/d converter multiple-channel output data high-speed a/d is changed
The directly extraction of data is background, the arbitrary extracting that when successfully solving high-speed a/d converter multiple-channel output, data directly extract
Ratio extraction activity, extraction mode is flexible.The high-speed a/d hits that extraction input object is 12 groups of particular arrangement of this abstracting method
According to, be so conducive to processing the rate reduction of high-speed a/d sampled data, realize providing reliability and convenient, practical for FPGA
Property.The extraction of this abstracting method is output as and inputs the specific extraction in the identical 12 group numerical value that puts in order.So be conducive to extraction
Data output is mated with the memory device such as rear end SRAM, is also beneficial to subsequent digital signal and analyzes and processes.The method divides extraction
Ratio processes respectively less than 12 with more than or equal to 12 two kinds of situations, to the extraction less than 12 than the most individually Design Treatment, makes
Complex situations are had the simplification of conditioning, reduce difficulty.Appointing of high-speed a/d sampled data can be realized than aspect this method in extraction
Meaning extraction ratio extraction situation so that extract various, flexible, provide guarantee for subsequent digital signal Treatment Analysis.
Accompanying drawing explanation
Fig. 1 is to extract than the flow chart less than 12 situations in the inventive method.
Fig. 2 is to extract than the extraction flow chart more than or equal to 12 situations in the inventive method.
Detailed description of the invention
Embodiment 1
12 groups of data of input every time are extracted by the present invention, solve in two kinds of situation when design, Yi Zhongwei
Extraction is than the situation less than 12, a kind of situation for extraction ratio more than or equal to 12.For extraction ratio during less than 12, because can
To take out multiple value in once inputting, according to the difference of extraction ratio, individual processing is compared in each extraction.Extraction ratio is more than
For the situation of 12, input most only one of which decimation values every time, can realize by making round-robin algorithm.This abstracting method can
Realize the arbitrary extracting of high-speed a/d sampled data than extraction.
The inputoutput data of the method is all 12 groups of data sets arranged in certain sequence, its inputoutput data group word
Shown in section sequence and the face that is defined as follows describe:
Input is defined as follows:
I11I10I09I08 I07I06I05I04I I03I0201I00
Here I00, I01, I02, I03, I04, I05, I06, I07, I08, I09, I10, I11 are that the method corresponds to A/D
12 high-speed a/d sampled data value fields of sampled data.Wherein I00 in time prior to I01, I01 in time prior to
I02, the like.
Output is defined as follows:
O11O10O09O08 O07O06O05O04 O03O02O01O00
Here O00, O01, O02, O03, O04, O05, O06, O07, O08, O09, O10, O11 be extraction output 12 high
The decimation value data splitting field of speed A/D sampled data.Wherein O00 in time prior to O01, O01 in time prior to O02,
The like.
Below in conjunction with accompanying drawing, the present invention is described in detail.
As Figure 1-Figure 2, by defined above understand inputoutput data order define as, explain separately below and respectively take out
Take than the process that realizes, wherein input is taken out value and is represented the value of extraction in 12 data of every time input, exports data and represents input
Taking out the output valve that value is corresponding, cyclic order represents which time input operation carried out in the output cycle:
1, the extraction realization than 2:
When extraction ratio is when being 2, from 12 data of input, extract 6 numbers every time, need 2 operating process can pump full once
Output combination, output data rate reduces to the 1/2 of input.Input and output correspondence relation and the circulation of extraction input data are secondary in order
Sequence is as shown in table 1 below:
Corresponding relation during table 1 extraction ratio 2
Value is taken out in input |
I00 I02 I04 I06 I08 I10 |
I00 I02 I04 I06 I08 I10 |
Output data |
O00 O01 O02 O03 O04 O05 |
O06 O07 O08 O09 O10 O11 |
Cyclic order |
1 |
2 |
2, the extraction realization than 3:
When extraction ratio is when being 3, from 12 data of input, extract 4 numbers every time, need 3 operating process can pump full once
Output combination, output data rate reduces to the 1/3 of input.Input and output correspondence relation and the circulation of extraction input data are secondary in order
Sequence is as shown in table 2 below:
Corresponding relation during table 2 extraction ratio 3
Value is taken out in input |
I00 I03 I06 I09 |
I00 I03 I06 I09 |
I00 I03 I06 I09 |
Output data |
O00 O01 O02 O03 |
O04 O05 O06 O07 |
O08 O09 O10 O11 |
Cyclic order |
1 |
2 |
3 |
3, the extraction realization than 4:
When extraction ratio is when being 4, from 12 data of input, extract 3 numbers every time, need 4 operating process can pump full once
Output combination, output data rate reduces to the 1/4 of input.Input and output correspondence relation and the circulation of extraction input data are secondary in order
Sequence is as shown in table 3 below:
Corresponding relation during table 3 extraction ratio 4
Value is taken out in input |
I00 I04 I08 |
I00 I04 I08 |
I00 I04 I08 |
I00 I04 I08 |
Output data |
O00 O01 O02 |
O03 O04 O05 |
O06 O07 O08 |
O09 O10 O11 |
Cyclic order |
1 |
2 |
3 |
4 |
4, the extraction realization than 5:
When extraction ratio is when being 5, beginning one value of every 5 extractions from circulation, remainder counts the sum of next time, needs circulation altogether
Operating can pump full for 5 times and once export combination, output data rate reduces to the 1/5 of input.The input of extraction input data is defeated in order
Go out corresponding relation and cyclic order be as shown in table 4 below:
Corresponding relation during table 4 extraction ratio 5
Value is taken out in input |
I00 I05 I10 |
I03 I08 |
I01 I06 I11 |
I04 I09 |
I02 I07 |
Output data |
O00 O01 O02 |
O03 O04 |
O05 O06 O07 |
O08 O09 |
O10 O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
5, the extraction realization than 6:
When extraction ratio is when being 6, from 12 data of input, extract 2 numbers every time, operation need to be circulated altogether and can pump full 16 times
Secondary output combination, output data rate reduces to the 1/6 of input.Extraction inputs input and output correspondence relation and the circulation of data in order
Order is as shown in table 5 below:
Corresponding relation during table 5 extraction ratio 6
Value is taken out in input |
I00 I06 |
I00 I06 |
I00 I06 |
I00 I06 |
I00 I06 |
I00 I06 |
Output data |
O00 O01 |
O02 O03 |
O04 O05 |
O06 O07 |
O08 O09 |
O10 O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
6 |
6, the extraction realization than 7:
When extraction ratio is when being 7, beginning one value of every 7 extractions from circulation, remainder counts the sum of next time, needs circulation altogether
Operating can pump full for 7 times and once export combination, output data rate reduces to the 1/7 of input.The input of extraction input data is defeated in order
Go out corresponding relation and cyclic order be as shown in table 6 below:
Corresponding relation during table 6 extraction ratio 7
Value is taken out in input |
I00 I07 |
I02 I09 |
I04 I11 |
I06 |
I01 I08 |
I03 I10 |
I05 |
Output data |
O00 O01 |
O02 O03 |
O04 O05 |
O06 |
O07 O08 |
O09 O10 |
O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
7, the extraction realization than 8:
When extraction ratio is when being 8, beginning one value of every 8 extractions from circulation, remainder counts the sum of next time, needs circulation altogether
Operating can pump full for 8 times and once export combination, output data rate reduces to the 1/8 of input.The input of extraction input data is defeated in order
Go out corresponding relation and cyclic order be as shown in table 7 below:
Corresponding relation during table 7 extraction ratio 8
Value is taken out in input |
I00 I08 |
I04 |
I00 I08 |
I04 |
I00 I08 |
I04 |
I00 I08 |
I04 |
Output data |
O00 O01 |
O02 |
O03 O04 |
O05 |
O06 O07 |
O08 |
O09 O10 |
O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
8, the extraction realization than 9:
When extraction ratio is when being 9, beginning one value of every 9 extractions from circulation, remainder counts the sum of next time, needs circulation altogether
Operating can pump full for 9 times and once export combination, output data rate reduces to the 1/9 of input.The input of extraction input data is defeated in order
Go out corresponding relation and cyclic order be as shown in table 8 below:
Corresponding relation during table 8 extraction ratio 9
Value is taken out in input |
I00 I09 |
I06 |
I03 |
I00 I09 |
I06 |
I03 |
I00 I09 |
I06 |
I03 |
Output data |
O00 O01 |
O02 |
O03 |
O04 O05 |
O06 |
O07 |
O08 O09 |
O10 |
O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
9, the extraction realization than 10:
When extraction ratio is when being 10, beginning one value of every 10 extractions from circulation, remainder counts the sum of next time, need to follow altogether
Ring operation can pump full for 10 times and once export combination, and output data rate reduces to the 1/10 of input.Extraction input data is defeated in order
Enter to export corresponding relation and cyclic order be as shown in table 9 below:
Corresponding relation during table 9 extraction ratio 10
Value is taken out in input |
I00 I10 |
I08 |
I06 |
I04 |
I02 |
I00 I10 |
I08 |
I06 |
I04 |
I02 |
Output data |
O00 O01 |
O02 |
O03 |
O04 |
O05 |
O06 O07 |
O08 |
O09 |
O10 |
O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
10, the extraction realization than 11:
When extraction ratio is when being 11, beginning one value of every 11 extractions from circulation, remainder counts the sum of next time, need to follow altogether
Ring operation can pump full for 11 times and once export combination, and output data rate reduces to the 1/11 of input.Extraction input data is defeated in order
Enter to export corresponding relation and cyclic order be as shown in table 10 below:
Corresponding relation during table 10 extraction ratio 11
Value is taken out in input |
I00 I11 |
I10 |
I09 |
I08 |
I07 |
I06 |
I05 |
I04 |
I03 |
I02 |
I01 |
Output data |
O00 O01 |
O02 |
O03 |
O04 |
O05 |
O06 |
O07 |
O08 |
O09 |
O10 |
O11 |
Cyclic order |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
11, extraction is than the realization more than or equal to 12:
When extraction ratio is during more than or equal to 12, because in 12 each numbers, the most only 1 value is extracted, so the most only needing
To need extraction extraction ratio count, when reach extract than time calculate extraction input which value, when taking out not
Then continuing when taking ratio to count, extraction flow process is as shown in Figure 2.But be 12 numbers due to each input, so every time herein
Operation increment is 12.By analyzing, we are only to analyzing which of this input of current extraction when count value meets following relation
Value, remainder is charged in circulation next time, and all countings of other condition is not satisfied increase 12.Described following refer to extraction than-12 <
The situation of count value≤extraction ratio;As long as the data of output are filled with 12 field combination and export once, output data rate will be
(the 1/ extraction ratio) of input data transfer rate.
Embodiment 2
On the basis of above-described embodiment, the most as shown in Figure 1 to Figure 2, a kind of input and output realized based on FPGA
The high-speed data abstracting method of arranged in sequence, wherein, comprises the following steps:
Step 1: input 12 groups of data;Judge that extraction ratio, whether less than 12, is then to enter step 6, otherwise enters step 2;
Step 2: judge whether count value reaches to take out value condition, is then to enter step 3, returns step after otherwise counting increases by 12
Rapid 1;
Step 3: in the extraction step 1 of location, a value in 12 groups of data is as decimation value, enters step 4, then remainder meter
Enter circulation next time and return step 1;
Step 4: decimation value is sequentially given output number;Enter step 5;
Step 5: judge whether to meet 12 groups of data output conditions, be to export the numerical value of 12 groups of data of extraction, and defeated
After going out counting clearing, return step 4;Otherwise output counting returns step 4 after adding 1;
Step 6: carry out classification process according to extraction ratio, when extraction is than entrance step 7 when being 2;When extraction enters than when being 3
Step 8;When extraction is than entrance step 9 when being 4;When extraction is than entrance step 10 when being 5;When extraction is than entrance step 11 when being 6;
When extraction is than entrance step 12 when being 7;When extraction is than entrance step 13 when being 8;When extraction is than entrance step 14 when being 9;When taking out
Take ratio for entering step 15 when 10;When extraction is than entrance step 16 when being 11;
Step 7: extraction ratio is to take out value when 2 to process, and returns step 1;
Step 8: extraction ratio is to take out value when 3 to process, and returns step 1;
Step 9: extraction ratio is to take out value when 4 to process, and returns step 1;
Step 10: extraction ratio is to take out value when 5 to process, and returns step 1;
Step 11: extraction ratio is to take out value when 6 to process, and returns step 1;
Step 12: extraction ratio is to take out value when 7 to process, and returns step 1;
Step 13: extraction ratio is to take out value when 8 to process, and returns step 1;
Step 14: extraction ratio is to take out value when 9 to process, and returns step 1;
Step 15: extraction ratio is to take out value when 10 to process, and returns step 1;
Step 16: extraction ratio is to take out value when 11 to process, and returns step 1;
Described abstracting method, wherein, 12 groups of data in described step 1 are that the data of 3 A/D conversions are combined taking out
Take.
Described abstracting method, wherein, in described step 2, taking out value condition is that count value is less than or equal to extract ratio, and is more than
Extraction ratio subtracts 12.
Described abstracting method, wherein, the output condition in described step 5 for output count value whether can dividend whole
Removing, described divisor is 11.
Described abstracting method, wherein, in described step 3, in described extraction step 1 value in 12 groups of data be
Meeting when taking out value condition, the data positioned are the counting numerical value equal to extraction ratio.
Described abstracting method, wherein, in described step 1, described extraction ratio is when being 2, every time from 12 data of input
Middle extraction 6 number, needs 2 operating process to pump full and once exports combination, and output data rate reduces to the 1/2 of input;Described extraction ratio
When being 3, from 12 data of input, extract 4 numbers every time, need 3 operating process to pump full and once export combination, export data
Rate reduces to the 1/3 of input;Described extraction ratio, when being 4, extracts 3 numbers every time from 12 data of input, needs 4 operating process
Pumping full and once export combination, output data rate reduces to the 1/4 of input;Described extraction ratio, when being 5, is taken out from every 5 of the beginning of circulation
Taking a value, remainder counts the sum of next time, need to circulate operation altogether and pump full for 5 times and once export combination, and output data rate is reduced to defeated
1/5 entered;Described extraction ratio, when being 6, extracts 2 numbers from 12 data of input every time, need to circulate operation altogether and can pump full for 6 times
Once exporting combination, output data rate reduces to the 1/6 of input;Beginning every 7 extractions one when being 7, from circulation of the described extraction ratio
Individual value, remainder counts the sum of next time, need to circulate operation altogether and pump full for 7 times and once export combination, and output data rate reduces to input
1/7;Described extraction ratio is when being 8, and beginning one value of every 8 extractions from circulation, remainder counts the sum of next time, need to circulate behaviour altogether
Making to pump full for 8 times once to export combination, output data rate reduces to the 1/8 of input;Described extraction ratio is when being 9, from the beginning every 9 of circulation
Individual extraction one value, remainder counts the sum of next time, need to circulate operation altogether and pump full for 9 times and once export combination, and output data rate drops
For input 1/9;Described extraction ratio is when being 10, and a value is extracted in every 10 of the beginning from circulation, and remainder counts the sum of next time,
Need to circulate altogether to operate can pump full for 10 times and once export combination, output data rate reduces to the 1/10 of input;Extraction ratio is when being 11, from following
Beginning one value of every 11 extractions of ring, remainder counts the sum of next time, need to circulate operation altogether and can pump full once output group 11 times
Closing, output data rate reduces to the 1/11 of input;The extraction ratio of extraction, during more than or equal to 12, is only counted by described extraction ratio
12 numbers being currently entered are carried out data locking peek by number when meeting condition, then remainder counts sum next time.
Use such scheme, to carry out under the applicable cases of high-speed a/d converter multiple-channel output data high-speed a/d is changed
The directly extraction of data is background, the arbitrary extracting that when successfully solving high-speed a/d converter multiple-channel output, data directly extract
Ratio extraction activity, extraction mode is flexible.The high-speed a/d hits that extraction input object is 12 groups of particular arrangement of this abstracting method
According to, be so conducive to processing the rate reduction of high-speed a/d sampled data, realize providing reliability and convenient, practical for FPGA
Property.The extraction of this abstracting method is output as and inputs the specific extraction in the identical 12 group numerical value that puts in order.So be conducive to extraction
Data output is mated with the memory device such as rear end SRAM, is also beneficial to subsequent digital signal and analyzes and processes.The method divides extraction
Ratio processes respectively less than 12 with more than or equal to 12 two kinds of situations, to the extraction less than 12 than the most individually Design Treatment, makes
Complex situations are had the simplification of conditioning, reduce difficulty.Appointing of high-speed a/d sampled data can be realized than aspect this method in extraction
Meaning extraction ratio extraction situation so that extract various, flexible, provide guarantee for subsequent digital signal Treatment Analysis.It is to be understood that
, for those of ordinary skills, can be improved according to the above description or be converted, and all these improvement and
Conversion all should belong to the protection domain of claims of the present invention.