CN107038397A - A kind of coding/decoding method and system - Google Patents
A kind of coding/decoding method and system Download PDFInfo
- Publication number
- CN107038397A CN107038397A CN201710228173.2A CN201710228173A CN107038397A CN 107038397 A CN107038397 A CN 107038397A CN 201710228173 A CN201710228173 A CN 201710228173A CN 107038397 A CN107038397 A CN 107038397A
- Authority
- CN
- China
- Prior art keywords
- value
- amplitude
- variable
- default
- frequency
- 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
- 238000000034 method Methods 0.000 title claims abstract description 28
- 238000005070 sampling Methods 0.000 claims description 91
- 230000003321 amplification Effects 0.000 claims description 11
- 238000003199 nucleic acid amplification method Methods 0.000 claims description 11
- 230000003247 decreasing effect Effects 0.000 claims description 9
- 238000006243 chemical reaction Methods 0.000 abstract description 4
- 230000007423 decrease Effects 0.000 abstract description 4
- 229910002056 binary alloy Inorganic materials 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/08—Methods or arrangements for sensing record carriers, e.g. for reading patterns by means detecting the change of an electrostatic or magnetic field, e.g. by detecting change of capacitance between electrodes
- G06K7/082—Methods or arrangements for sensing record carriers, e.g. for reading patterns by means detecting the change of an electrostatic or magnetic field, e.g. by detecting change of capacitance between electrodes using inductive or magnetic sensors
- G06K7/083—Methods or arrangements for sensing record carriers, e.g. for reading patterns by means detecting the change of an electrostatic or magnetic field, e.g. by detecting change of capacitance between electrodes using inductive or magnetic sensors inductive
- G06K7/084—Methods or arrangements for sensing record carriers, e.g. for reading patterns by means detecting the change of an electrostatic or magnetic field, e.g. by detecting change of capacitance between electrodes using inductive or magnetic sensors inductive sensing magnetic material by relative movement detecting flux changes without altering its magnetised state
Landscapes
- Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The present invention relates to data processing field, more particularly to a kind of coding/decoding method and system.The present invention is by the way that the minimum amplitude of the situation of change of sinusoidal magnitude and useful signal is compared, the conversion that can be accurately judged between the amplitude uphill process of current sinusoidal ripple and decline process is caused by useful signal is in itself or caused by the burr that interference signal is formed, the accuracy for the frequency for calculating useful signal is improved, so as to improve the success rate of decoding.
Description
Technical field
The present invention relates to data processing field, more particularly to a kind of coding/decoding method and system.
Background technology
It is conventional financial instrument that magnetic card swipe consumption is carried out in the terminals such as POS.Due to the magnetic stripe and POS on magnetic card
Useful signal (generally sine wave) amplitude very little that heads contact on machine is produced, need to generally amplify during decoding has
Imitate signal.But, the magnetic stripe on magnetic card is easily damaged, and in the easy interfered signal interference of process of amplification useful signal so that
The many burrs of useful signal after amplification.Coding/decoding method for obtaining card information according to the frequency resolution of useful signal, effectively
Burr on signal can reduce the success rate of decoding, could successfully be consumed so that user need to repeatedly swipe the card, poor user experience.
The content of the invention
The technical problems to be solved by the invention are:In the situation of many burrs of the sine wave with card information received
Under, how to improve the success rate of decoding.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention is:
The present invention provides a kind of coding/decoding method, including:
S1, speed of being swiped the card according to default minimum and signal amplification factor obtain interference threshold value;
S2, prefixed time interval sampling sine wave corresponding with card information amplitude;
If amplitude monotonic increase described in S3, continuous sampling to default first quantity, and there is amplitude described in one more than described
Interference threshold value, then:
S4, the amplitude arrived in real time according to last samples update the value of default maximum amplitude variable;
If amplitude monotone decreasing described in S5, continuous sampling to default first quantity, and the amplitude that arrives of last samples with
The absolute value of the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then:
S6, the amplitude arrived in real time according to last samples update the value of default minimum amplitude variable;
If amplitude monotonic increase described in S7, continuous sampling to default first quantity, and the amplitude that arrives of last samples with
The absolute value of the difference of the minimum amplitude is more than interference threshold value described in twice, then:
S8, the corresponding sampling instant of value according to the maximum amplitude variable and the minimum amplitude variable value are corresponding
Sampling instant, obtains binary number;
S9, the addition binary number to default binary sequence;
S10, the value for setting the maximum amplitude variable and the minimum amplitude variable value are corresponding initial value;
S11, S3 to S10 is repeated, until continuous sampling is respectively less than to the absolute value for presetting amplitude described in the second quantity
The interference threshold value;
S12, the binary sequence is changed into the card information.
The present invention also provides a kind of solution code system, including:
Computing module, for swiping the card speed according to default minimum and signal amplification factor obtains interference threshold value;
Sampling module, the amplitude for sine wave corresponding with card information of being sampled for prefixed time interval;
First update module, if for amplitude monotonic increase described in continuous sampling to default first quantity, and there is an institute
Amplitude is stated more than the interference threshold value, then the amplitude arrived in real time according to last samples updates default maximum amplitude variable
Value;
Second update module, if for amplitude monotone decreasing described in continuous sampling to default first quantity, and last samples
The absolute value of the amplitude arrived and the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then in real time
The amplitude arrived according to last samples updates the value of default minimum amplitude variable;
First modular converter, if for amplitude monotonic increase described in continuous sampling to default first quantity, and last samples
The absolute value of the amplitude arrived and the difference of the minimum amplitude is more than interference threshold value described in twice, then:According to it is described most
The corresponding sampling instant of value of amplitude variable and the corresponding sampling instant of value of the minimum amplitude variable, obtain binary system
Number;
Add module, for adding the binary number to default binary sequence;
Setup module, for setting the value of the maximum amplitude variable and the value of the minimum amplitude variable to be corresponding first
Initial value;
Jump module, if the absolute value for amplitude described in continuous sampling to default second quantity is not less than the interference
Threshold value, then jump to first update module;
Second modular converter, for changing the binary sequence into the card information.
The beneficial effects of the present invention are:By the way that the minimum amplitude of the situation of change of sinusoidal magnitude and useful signal is entered
Row compares, and the conversion that can be accurately judged between the amplitude uphill process of current sinusoidal ripple and decline process is by useful signal sheet
Caused by body or caused by the burr that interference signal is formed, the accuracy for the frequency for calculating useful signal is improved, so as to improve
The success rate of decoding.
Brief description of the drawings
A kind of FB(flow block) for coding/decoding method that Fig. 1 provides for the present invention;
A kind of structured flowchart for solution code system that Fig. 2 provides for the present invention;
Fig. 3 is the sine wave schematic diagram with card information;
Label declaration:
1st, computing module;2nd, sampling module;3rd, the first update module;4th, the second update module;5th, the first modular converter;6、
Add module;7th, setup module;8th, jump module;9th, the second modular converter.
Embodiment
To describe technology contents, the objects and the effects of the present invention in detail, below in conjunction with embodiment and coordinate attached
Figure is explained.
Fig. 1 be refer to Fig. 3,
As shown in figure 1, the present invention provides a kind of coding/decoding method, including:
S1, speed of being swiped the card according to default minimum and signal amplification factor obtain interference threshold value;
S2, prefixed time interval sampling sine wave corresponding with card information amplitude;
If amplitude monotonic increase described in S3, continuous sampling to default first quantity, and there is amplitude described in one more than described
Interference threshold value, then:
S4, the amplitude arrived in real time according to last samples update the value of default maximum amplitude variable;
If amplitude monotone decreasing described in S5, continuous sampling to default first quantity, and the amplitude that arrives of last samples with
The absolute value of the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then:
S6, the amplitude arrived in real time according to last samples update the value of default minimum amplitude variable;
If amplitude monotonic increase described in S7, continuous sampling to default first quantity, and the amplitude that arrives of last samples with
The absolute value of the difference of the minimum amplitude is more than interference threshold value described in twice, then:
S8, the corresponding sampling instant of value according to the maximum amplitude variable and the minimum amplitude variable value are corresponding
Sampling instant, obtains binary number;
S9, the addition binary number to default binary sequence;
S10, the value for setting the maximum amplitude variable and the minimum amplitude variable value are corresponding initial value;
S11, S3 to S10 is repeated, until continuous sampling is respectively less than to the absolute value for presetting amplitude described in the second quantity
The interference threshold value;
S12, the binary sequence is changed into the card information.
Further, the S4 is specially:
The initial value is sky;
The amplitude that last samples are arrived is obtained, first amplitude is obtained;
If the value of the maximum amplitude variable is sky, the value for setting the maximum amplitude variable is the first amplitude;
If the first amplitude is more than the value of the maximum amplitude variable, the value for setting the maximum amplitude variable is institute
State first amplitude.
Further, the S6 is specially:
The initial value is sky;
The amplitude that last samples are arrived is obtained, the second amplitude is obtained;
If the value of the minimum amplitude variable is sky, the value for setting the minimum amplitude variable is second amplitude;
If second amplitude is less than the value of the minimum amplitude variable, the value for setting the minimum amplitude variable is institute
State the second amplitude.
Further, the S8 is specially:
Default first frequency and second frequency;The second frequency is twice of the first frequency;
The corresponding sampling instant of value of the maximum amplitude variable is obtained, crest value sampling instant is obtained;
The corresponding sampling instant of value of the minimum amplitude variable is obtained, valley value sampling instant is obtained;
The frequency for obtaining the sine wave is calculated according to the crest value sampling instant and the valley value sampling instant;
If the frequency of the sine wave is identical with the first frequency, generate corresponding with a binary-coded state
Binary number;
If the frequency of the sine wave is identical with the second frequency, generate corresponding with binary-coded another state
Binary number.
Further, the S11 is specially:
The binary sequence is changed into the card information according to default coding rule.
As shown in Fig. 2 the present invention also provides a kind of solution code system, including:
Computing module 1, for swiping the card speed according to default minimum and signal amplification factor obtains interference threshold value;
Sampling module 2, the amplitude for sine wave corresponding with card information of being sampled for prefixed time interval;
First update module 3, if for amplitude monotonic increase described in continuous sampling to default first quantity, and there is an institute
Amplitude is stated more than the interference threshold value, then the amplitude arrived in real time according to last samples updates default maximum amplitude variable
Value;
Second update module 4, if for amplitude monotone decreasing described in continuous sampling to default first quantity, and last samples
The absolute value of the amplitude arrived and the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then in real time
The amplitude arrived according to last samples updates the value of default minimum amplitude variable;
First modular converter 5, if for amplitude monotonic increase described in continuous sampling to default first quantity, and last samples
The absolute value of the amplitude arrived and the difference of the value of the minimum amplitude variable is more than interference threshold value described in twice, then:Root
According to the corresponding sampling instant of value and the corresponding sampling instant of value of the minimum amplitude variable of the maximum amplitude variable, obtain
Binary number;
Add module 6, for adding the binary number to default binary sequence;
Setup module 7, for setting the value of the maximum amplitude variable and the value of the minimum amplitude variable to be corresponding
Initial value;
Jump module 8, if the absolute value for amplitude described in continuous sampling to default second quantity is dry not less than described
Threshold value is disturbed, then jumps to first update module;
Second modular converter 9, for changing the binary sequence into the card information.
Further, first update module includes:
First setting unit, for setting the initial value of the maximum amplitude variable to be sky;
First acquisition unit, for obtaining the amplitude that last samples are arrived, obtains first amplitude;
Second setting unit, if the value for the maximum amplitude variable is sky, sets the maximum amplitude variable
It is worth for the first amplitude;
3rd setting unit, if being more than the value of the maximum amplitude variable for the first amplitude, described in setting most
The value of amplitude variable is the first amplitude.
Further, second update module includes:
4th setting unit, for setting the initial value of the minimum amplitude variable to be sky;
Second acquisition unit, for obtaining the amplitude that last samples are arrived, obtains the second amplitude;
5th setting unit, if the value for the minimum amplitude variable is sky, sets the minimum amplitude variable
It is worth for second amplitude;
6th setting unit, if being less than the value of the minimum amplitude variable for second amplitude, described in setting most
The value of small magnitude variable is second amplitude.
Further, first modular converter includes:
Default unit, for presetting first frequency and second frequency;The second frequency is twice of the first frequency;
3rd acquiring unit, the corresponding sampling instant of value for obtaining the maximum amplitude variable, obtains crest value and adopts
The sample moment;
4th acquiring unit, the corresponding sampling instant of value for obtaining the minimum amplitude variable, obtains valley value and adopts
The sample moment;
Computing unit, for calculated according to the crest value sampling instant and the valley value sampling instant obtain it is described just
The frequency of string ripple;
First generation unit, if the frequency for the sine wave is identical with the first frequency, generation and binary system
The corresponding binary number of a state of coding;
Second generation unit, if the frequency for the sine wave is identical with the second frequency, generation and binary system
The corresponding binary number of another state of coding.
Further, second modular converter includes:
Converting unit, for changing the binary sequence according to default coding rule into the card information.
Embodiments of the invention one are:
The present embodiment provides a kind of coding/decoding method, comprises the following steps:
S1, speed of being swiped the card according to default minimum and signal amplification factor obtain interference threshold value;
Wherein, the interference threshold value A is less than the minimum peak of useful signal;
For example, carrying out swiping card to 10% amplitude magnetic card using 0.1m/s speed, exist without the amplitude of amplification
3mV, if the multiple of amplifying circuit is 100 times, interference threshold value must be less than 300mV;In the range of less than 300mV,
Interference threshold value can be adjusted according to actual interference situation;
S2, prefixed time interval sampling sine wave corresponding with card information amplitude;
If amplitude monotonic increase described in S3, continuous sampling to default first quantity, and there is amplitude described in one more than described
Interference threshold value, then:
Wherein, as shown in figure 3, collecting N number of (the first quantity) width including B points and C points in a time interval
Value Data, these data monotonic increases, and the corresponding amplitude of C points are more than interference threshold value A, therefore, judge that useful signal is in
The process of rising;
Wherein, magnetic card swipe frequency is generally in 2K~20K or so, for the adc circuit that sample frequency is 400K, a ripple
There are 20 sampled points in the shape cycle, then N values are 5;
S4, the amplitude arrived in real time according to last samples update the value of default maximum amplitude variable;Specially:
The initial value of the maximum amplitude variable is sky;
The amplitude that last samples are arrived is obtained, first amplitude is obtained;
If the value of the maximum amplitude variable is sky, the value for setting the maximum amplitude variable is the first amplitude;
If the first amplitude is more than the value of the maximum amplitude variable, the value for setting the maximum amplitude variable is institute
State first amplitude;
Wherein, when recognizing signal in the process risen, the amplitude arrived in real time according to last samples updates most significantly
It is worth the value of variable, so as to obtain crest value of the useful signal within a cycle;
If amplitude monotone decreasing described in S5, continuous sampling to default first quantity, and the amplitude that arrives of last samples with
The absolute value of the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then:
Wherein, as shown in figure 3, in a time interval continuous acquisition to including D points and E points it is N number of (first number
Amount) amplitude data, these data monotone decreasings, and the value (X points corresponding amplitude) of the corresponding amplitude of E points and maximum amplitude variable
The absolute value of difference be more than twice interference threshold value 2A, the i.e. minimum value more than useful signal from crest value to valley value, because
This, judges that useful signal is in the process declined, then the value that can determine that current maximum amplitude variable is sine wave at this
Crest value in cycle;
S6, the amplitude arrived in real time according to last samples update the value of default minimum amplitude variable;Specially:
The initial value of the minimum amplitude variable is sky;
The amplitude that last samples are arrived is obtained, the second amplitude is obtained;
If the value of the minimum amplitude variable is sky, the value for setting the minimum amplitude variable is second amplitude;
If second amplitude is less than the value of the minimum amplitude variable, the value for setting the minimum amplitude variable is institute
State the second amplitude;
Wherein, when recognizing signal in the process declined, the amplitude arrived in real time according to last samples updates most small size
It is worth the value of variable, so as to obtain valley value of the useful signal within a cycle;
If amplitude monotonic increase described in S7, continuous sampling to default first quantity, and the amplitude that arrives of last samples with
The absolute value of the difference of the value of the minimum amplitude variable is more than interference threshold value described in twice, then:
Wherein, as shown in figure 3, in a time interval continuous acquisition to including F points and G points it is N number of (first number
Amount) amplitude data, these data monotonic increases;But, (F points are corresponding for the value of the corresponding amplitude of G points and current minimum amplitude variable
Amplitude) the absolute value of difference be less than interference threshold value 2A described in twice, therefore, now mistake of the useful signal still in decline
Journey, it is as caused by interference signal that the amplitude data sampled in this time interval, which is in the process risen,;
Continuous acquisition is to N number of (the first quantity) amplitude data including H points and I points in a time interval, these
Data monotonic increase, and the difference of the value (Y points corresponding amplitude) of the corresponding amplitude of I points and current minimum amplitude variable is absolute
Value is more than twice of interference threshold value 2A, therefore, judges that useful signal is in the process risen, then can determine that current minimum amplitude becomes
The value of amount is valley value of the sine wave within this cycle;
S8, the corresponding sampling instant of value according to the maximum amplitude variable and the minimum amplitude variable value are corresponding
Sampling instant, obtains binary number;Specially:
Default first frequency and second frequency;The second frequency is twice of the first frequency;
The corresponding sampling instant of value of the maximum amplitude variable is obtained, crest value sampling instant is obtained;
The corresponding sampling instant of value of the minimum amplitude variable is obtained, valley value sampling instant is obtained;
The frequency for obtaining the sine wave is calculated according to the crest value sampling instant and the valley value sampling instant;
If the frequency of the sine wave is identical with the first frequency, generate corresponding with a binary-coded state
Binary number;
If the frequency of the sine wave is identical with the second frequency, generate corresponding with binary-coded another state
Binary number;
S9, the addition binary number to default binary sequence;
S10, the value for setting the maximum amplitude variable and the minimum amplitude variable value are corresponding initial value;
S11, S3 to S10 is repeated, until continuous sampling is respectively less than to the absolute value for presetting amplitude described in the second quantity
The interference threshold value;
Wherein, if continuous sampling is respectively less than interference threshold value A to the absolute value of M (default second quantity) amplitudes, say
Bright useful signal is received, and stops obtaining the amplitude of useful signal;
Wherein, using slower speed swipe the card produce frequency as 2K magnetic card signal, for sample frequency for 400K ADC electricity
Road, a cycle has 200 sampled points, then M values are 200;
S12, the binary sequence is changed into the card information;
Wherein, the binary sequence is changed into the card information according to default coding rule.
Embodiments of the invention two are:
The present embodiment provides a kind of solution code system, including:
Computing module 1, for swiping the card speed according to default minimum and signal amplification factor obtains interference threshold value;
Sampling module 2, the amplitude for sine wave corresponding with card information of being sampled for prefixed time interval;
First update module 3, if for amplitude monotonic increase described in continuous sampling to default first quantity, and there is an institute
Amplitude is stated more than the interference threshold value, then the amplitude arrived in real time according to last samples updates default maximum amplitude variable
Value;
Wherein, first update module 3 includes:First setting unit, for setting the first of the maximum amplitude variable
Initial value is sky;First acquisition unit, for obtaining the amplitude that last samples are arrived, obtains first amplitude;Second setting unit,
If the value for the maximum amplitude variable is sky, the value for setting the maximum amplitude variable is the first amplitude;3rd
Setting unit, if being more than the value of the maximum amplitude variable for the first amplitude, sets the maximum amplitude variable
It is worth for the first amplitude;
Second update module 4, if for amplitude monotone decreasing described in continuous sampling to default first quantity, and last samples
The absolute value of the amplitude arrived and the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then in real time
The amplitude arrived according to last samples updates the value of default minimum amplitude variable;Wherein, second update module 4 is wrapped
Include:4th setting unit, for setting the initial value of the minimum amplitude variable to be sky;Second acquisition unit, for obtaining most
The amplitude newly sampled, obtains the second amplitude;5th setting unit, if the value for the minimum amplitude variable is sky,
The value for then setting the minimum amplitude variable is second amplitude;6th setting unit, if being less than for second amplitude
The value of the minimum amplitude variable, the then value for setting the minimum amplitude variable is second amplitude;
First modular converter 5, if for amplitude monotonic increase described in continuous sampling to default first quantity, and last samples
The absolute value of the amplitude arrived and the difference of the value of the minimum amplitude variable is more than interference threshold value described in twice, then:Root
According to the corresponding sampling instant of value and the corresponding sampling instant of value of the minimum amplitude variable of the maximum amplitude variable, obtain
Binary number;
Wherein, first modular converter 5 includes:Default unit, for presetting first frequency and second frequency;Described
Two frequencies are twice of the first frequency;3rd acquiring unit, value for obtaining the maximum amplitude variable is corresponding to adopt
At the sample moment, obtain crest value sampling instant;4th acquiring unit, the corresponding sampling of value for obtaining the minimum amplitude variable
At the moment, obtain valley value sampling instant;Computing unit, during for according to the crest value sampling instant and valley value sampling
Carve the frequency for calculating and obtaining the sine wave;First generation unit, if frequency and the first frequency for the sine wave
It is identical, then generate binary number corresponding with a binary-coded state;Second generation unit, if for the sine wave
Frequency is identical with the second frequency, then generation binary number corresponding with binary-coded another state;
Add module 6, for adding the binary number to default binary sequence;
Setup module 7, for setting the value of the maximum amplitude variable and the value of the minimum amplitude variable to be corresponding
Initial value;
Jump module 8, if the absolute value for amplitude described in continuous sampling to default second quantity is dry not less than described
Threshold value is disturbed, then jumps to first update module;
Second modular converter 9, for changing the binary sequence into the card information;Wherein, second conversion
9 pieces of mould includes:Converting unit, for changing the binary sequence according to default coding rule into the card information.
In summary, a kind of coding/decoding method for providing of the present invention and system, by by the situation of change of sinusoidal magnitude with
The minimum amplitude of useful signal is compared, and can be accurately judged between the amplitude uphill process of current sinusoidal ripple and decline process
Conversion be caused by useful signal is in itself or caused by the burr that interference signal is formed, improve calculate useful signal frequency
The accuracy of rate, so as to improve the success rate of decoding.
Embodiments of the invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize this hair
The equivalents that bright specification and accompanying drawing content are made, or the technical field of correlation is directly or indirectly used in, similarly include
In the scope of patent protection of the present invention.
Claims (10)
1. a kind of coding/decoding method, it is characterised in that including:
S1, speed of being swiped the card according to default minimum and signal amplification factor obtain interference threshold value;
S2, prefixed time interval sampling sine wave corresponding with card information amplitude;
If amplitude monotonic increase described in S3, continuous sampling to default first quantity, and there is amplitude described in one more than the interference
Threshold value, then:
S4, the amplitude arrived in real time according to last samples update the value of default maximum amplitude variable;
If amplitude monotone decreasing described in S5, continuous sampling to default first quantity, and the amplitude that arrives of last samples with it is described
The absolute value of the difference of the value of maximum amplitude variable is more than interference threshold value described in twice, then:
S6, the amplitude arrived in real time according to last samples update the value of default minimum amplitude variable;
If amplitude monotonic increase described in S7, continuous sampling to default first quantity, and the amplitude that arrives of last samples with it is described
The absolute value of the difference of the value of minimum amplitude variable is more than interference threshold value described in twice, then:
S8, the corresponding sampling of the value of the corresponding sampling instant of value and the minimum amplitude variable according to the maximum amplitude variable
At the moment, obtain binary number;
S9, the addition binary number to default binary sequence;
S10, the value for setting the maximum amplitude variable and the minimum amplitude variable value are corresponding initial value;
S11, repeat S3 to S10, until continuous sampling arrive amplitude described in default second quantity absolute value be respectively less than described in
Interference threshold value;
S12, the binary sequence is changed into the card information.
2. coding/decoding method according to claim 1, it is characterised in that the S4 is specially:
The initial value is sky;
The amplitude that last samples are arrived is obtained, first amplitude is obtained;
If the value of the maximum amplitude variable is sky, the value for setting the maximum amplitude variable is the first amplitude;
If the first amplitude is more than the value of the maximum amplitude variable, it is described the to set the value of the maximum amplitude variable
One amplitude.
3. coding/decoding method according to claim 1, it is characterised in that the S6 is specially:
The initial value is sky;
The amplitude that last samples are arrived is obtained, the second amplitude is obtained;
If the value of the minimum amplitude variable is sky, the value for setting the minimum amplitude variable is second amplitude;
If second amplitude is less than the value of the minimum amplitude variable, it is described the to set the value of the minimum amplitude variable
Two amplitudes.
4. coding/decoding method according to claim 1, it is characterised in that the S8 is specially:
Default first frequency and second frequency;The second frequency is twice of the first frequency;
The corresponding sampling instant of value of the maximum amplitude variable is obtained, crest value sampling instant is obtained;
The corresponding sampling instant of value of the minimum amplitude variable is obtained, valley value sampling instant is obtained;
The frequency for obtaining the sine wave is calculated according to the crest value sampling instant and the valley value sampling instant;
If the frequency of the sine wave is identical with the first frequency, generation is entered with a binary-coded state corresponding two
Number processed;
If the frequency of the sine wave is identical with the second frequency, generation and binary-coded another state corresponding two
System number.
5. coding/decoding method according to claim 1, it is characterised in that the S11 is specially:
The binary sequence is changed into the card information according to default coding rule.
6. one kind solution code system, it is characterised in that including:
Computing module, for swiping the card speed according to default minimum and signal amplification factor obtains interference threshold value;
Sampling module, the amplitude for sine wave corresponding with card information of being sampled for prefixed time interval;
First update module, if for amplitude monotonic increase described in continuous sampling to default first quantity, and there is width described in one
Value is more than the interference threshold value, then the amplitude arrived in real time according to last samples updates default maximum amplitude variable
Value;
Second update module, if for amplitude monotone decreasing described in continuous sampling to default first quantity, and last samples are arrived
The absolute value of the amplitude and the difference of the value of the maximum amplitude variable is more than interference threshold value described in twice, then real-time basis
The amplitude that last samples are arrived updates the value of default minimum amplitude variable;
First modular converter, if for amplitude monotonic increase described in continuous sampling to default first quantity, and last samples are arrived
The absolute value of the amplitude and the difference of the value of the minimum amplitude variable is more than interference threshold value described in twice, then:According to institute
The corresponding sampling instant of value of maximum amplitude variable and the corresponding sampling instant of value of the minimum amplitude variable are stated, two is obtained and enters
Number processed;
Add module, for adding the binary number to default binary sequence;
Setup module, for setting the value of the maximum amplitude variable and the value of the minimum amplitude variable to be corresponding initial
Value;
Jump module, if the absolute value for amplitude described in continuous sampling to default second quantity is not less than the interference threshold
Value, then jump to first update module;
Second modular converter, for changing the binary sequence into the card information.
7. solution code system according to claim 6, it is characterised in that first update module includes:
First setting unit, for setting the initial value of the maximum amplitude variable to be sky;
First acquisition unit, for obtaining the amplitude that last samples are arrived, obtains first amplitude;
Second setting unit, if the value for the maximum amplitude variable is sky, the value for setting the maximum amplitude variable is
The first amplitude;
3rd setting unit, if being more than the value of the maximum amplitude variable for the first amplitude, described in setting most significantly
The value for being worth variable is the first amplitude.
8. solution code system according to claim 6, it is characterised in that second update module includes:
4th setting unit, for setting the initial value of the minimum amplitude variable to be sky;
Second acquisition unit, for obtaining the amplitude that last samples are arrived, obtains the second amplitude;
5th setting unit, if the value for the minimum amplitude variable is sky, the value for setting the minimum amplitude variable is
Second amplitude;
6th setting unit, it is most small size described in setting if being less than the value of the minimum amplitude variable for second amplitude
The value for being worth variable is second amplitude.
9. solution code system according to claim 6, it is characterised in that first modular converter includes:
Default unit, for presetting first frequency and second frequency;The second frequency is twice of the first frequency;
3rd acquiring unit, the corresponding sampling instant of value for obtaining the maximum amplitude variable, when obtaining crest value sampling
Carve;
4th acquiring unit, the corresponding sampling instant of value for obtaining the minimum amplitude variable, when obtaining valley value sampling
Carve;
Computing unit, the sine wave is obtained for being calculated according to the crest value sampling instant and the valley value sampling instant
Frequency;
First generation unit, if the frequency for the sine wave is identical with the first frequency, generation and binary coding
The corresponding binary number of a state;
Second generation unit, if the frequency for the sine wave is identical with the second frequency, generation and binary coding
The corresponding binary number of another state.
10. solution code system according to claim 1, it is characterised in that second modular converter includes:
Converting unit, for changing the binary sequence according to default coding rule into the card information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710228173.2A CN107038397B (en) | 2017-04-10 | 2017-04-10 | Decoding method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710228173.2A CN107038397B (en) | 2017-04-10 | 2017-04-10 | Decoding method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107038397A true CN107038397A (en) | 2017-08-11 |
CN107038397B CN107038397B (en) | 2019-12-31 |
Family
ID=59534931
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710228173.2A Expired - Fee Related CN107038397B (en) | 2017-04-10 | 2017-04-10 | Decoding method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107038397B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114499698A (en) * | 2020-11-09 | 2022-05-13 | 莱克电气股份有限公司 | Synchronous signal processing method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5712630A (en) * | 1994-07-26 | 1998-01-27 | Matsushita Electric Works. Ltd. | High power moving object identification system |
US6185173B1 (en) * | 1998-07-31 | 2001-02-06 | Cirrus Logic, Inc. | Sampled amplitude read channel employing a trellis sequence detector matched to a channel code constraint and a post processor for correcting errors in the detected binary sequence using the signal samples and an error syndrome |
CN102324012A (en) * | 2011-08-26 | 2012-01-18 | 深圳盒子支付信息技术有限公司 | Magnetic card data reading method, apparatus thereof and mobile POS machine |
CN103117720A (en) * | 2013-01-16 | 2013-05-22 | 东南大学 | Self-adaptation control gain method in magnetic card decoding chip |
CN104463057A (en) * | 2014-12-30 | 2015-03-25 | 福建联迪商用设备有限公司 | Magnetic card decoding method and device |
-
2017
- 2017-04-10 CN CN201710228173.2A patent/CN107038397B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5712630A (en) * | 1994-07-26 | 1998-01-27 | Matsushita Electric Works. Ltd. | High power moving object identification system |
US6185173B1 (en) * | 1998-07-31 | 2001-02-06 | Cirrus Logic, Inc. | Sampled amplitude read channel employing a trellis sequence detector matched to a channel code constraint and a post processor for correcting errors in the detected binary sequence using the signal samples and an error syndrome |
CN102324012A (en) * | 2011-08-26 | 2012-01-18 | 深圳盒子支付信息技术有限公司 | Magnetic card data reading method, apparatus thereof and mobile POS machine |
CN103117720A (en) * | 2013-01-16 | 2013-05-22 | 东南大学 | Self-adaptation control gain method in magnetic card decoding chip |
CN104463057A (en) * | 2014-12-30 | 2015-03-25 | 福建联迪商用设备有限公司 | Magnetic card decoding method and device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114499698A (en) * | 2020-11-09 | 2022-05-13 | 莱克电气股份有限公司 | Synchronous signal processing method, device, equipment and storage medium |
CN114499698B (en) * | 2020-11-09 | 2024-04-19 | 莱克电气股份有限公司 | Synchronous signal processing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107038397B (en) | 2019-12-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110991818B (en) | Load identification method integrating event detection and neural network | |
CN106370096A (en) | Measurement circuit and measuring method of LVDT (Linear Variable Differential Transformer) | |
CN101919695A (en) | Electrocardiosignal QRS complex detection method based on wavelet transform | |
CN103713730B (en) | Aerial gesture identification method and device applied to intelligent terminal | |
CN202710975U (en) | Data acquisition device | |
CN107969152A (en) | Signal transmitting method, signal resolution method, active pen and touch screen | |
CN105046287A (en) | Clustering and fitting method of on-line multi-stroke repeatedly drawn sketch | |
CN103149415A (en) | High precision high frequency sin wave virtual value real-time detection method | |
CN106532969A (en) | Circuit structure realizing FSK signal efficient demodulation in wireless charging device | |
CN107038397A (en) | A kind of coding/decoding method and system | |
CN110376520A (en) | A kind of parameter of electric machine acquisition device, motor and its parameter of electric machine acquisition method | |
CN104463057B (en) | A kind of magnetic card coding/decoding method and device | |
CN103575979B (en) | A kind of method of digitized measurement ac frequency | |
CN105259409B (en) | A kind of frequency power signal computational methods based on zero passage time domain specification | |
CN104112111B (en) | A kind of magnetic stripe card decoding circuit and method | |
CN103902100A (en) | Speed characteristics based stroke partitioning method for intelligent freehand sketching | |
CN103617408A (en) | Magnetic stripe card decoding circuit based on AD sampling | |
CN106612147B (en) | Pulse modulation code identification method | |
CN104083163A (en) | Method for obtaining nonlinearity parameter electroencephalogram mapping | |
CN105054925A (en) | Feature point obtaining and waveform drawing | |
CN102982802A (en) | Vehicle feature recognition algorithm based on real-time coding | |
CN101452520A (en) | Signal processor for receiving wireless radio frequency identification signal and method thereof | |
CN109145857B (en) | Method for extracting curve data from curve graph | |
CN107292095A (en) | It is a kind of based on multiple dimensioned window be threshold value analysis of complexity method | |
CN106936434A (en) | System is corrected based on the code density high-order harmonic wave that FFT is extracted |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20191231 |