Based on facsimile modulation/demodulation recommendation FSK demodulation method V.21
Technical field
The present invention relates to a kind of frequency shift keying (frequency-shift-key, be called for short FSK) demodulation method, be specially a kind ofly, belong to communication modulation-demodulation technique field based on facsimile modulation/demodulation recommendation FSK demodulation method V.21.
Background technology
According to (the International Telephone andTelegraph Consultative Committee of international telephone and telegraph Advisory Board, abbreviation CCITT) V.21 the facsimile modulation/demodulation recommendation in the suggestion (sees accompanying drawing 5), it is used for transmitting the binary code control signal, and V.21 modulator-demodulator is that the transmission rate of using in the public switched telephone network is the standardization duplex modulator-demodulator of 300 bauds (Baud).Group-three facsimile apparatus (be present general facsimile type, claim the G3 facsimile machine, same group-two facsimile apparatus is called for short the G2 facsimile machine) adopts half-duplex mode communication, is used to transmit binary control signal (signaling-information).Use the characteristic frequency of second channel in the V.21 suggestion: mark adopts Fa=1650Hz, and spacing adopts Fz=1850Hz.V.21 the modulator-demodulator of group-three facsimile apparatus adopts method of synchronization work, needn't be provided at transmission and keep required signal synchronously when stopping.The method of FSK modulation is adopted in this modulation suggestion.But V.21 only provide modulator approach in the suggestion, do not provided demodulation method and concrete demodulation implementation method, can correct demodulation meet the V.21 demodulation method of the modulation signal of suggestion so will design.
Because the V.21 middle message transmission rate of facsimile modulation/demodulation recommendation is lower, therefore should adopt with low cost, simple and easy to do method demodulation as far as possible.Along with the maturing of frequency shift keying demodulation mode, the most frequently used method is the coherent demodulation method at present, as shown in Figure 1:
The signal that receives is at first carried out bandpass filtering, the signal of the frequency range that is required according to the rules.Here bandwidth should be made as 300HZ~3400HZ, multiply each other with two corresponding frequency local carriers (cosw1 and cosw2) together then, leach the signal of two frequencies again by low pass filter, by commutator pulse to the signal judgement of sampling, thereby reach the purpose of demodulation.This method is applicable to digital signal, also is applicable to the realization of software, and demodulation method is simple, amount of calculation is less, but for synchronous requirement than higher, this is owing to want to judge digital signal, will be strict accomplish Phase synchronization, this is a difficult point.Stationary problem (carrier synchronization and bit synchronization) is the difficult point problem of demodulation techniques.
Summary of the invention
Main purpose of the present invention is to overcome in the past and is difficult to the shortcoming that realizes in the FSK demodulation that realizes synchronously, the present invention proposes a kind of FSK demodulation method that meets V.21 suggestion that simply is easy to realize, this demodulation method has been avoided carrier synchronization and bit synchronization, has simplified the implementation method of demodulation greatly.
The present invention has adopted discrete Fourier transform (DFT) (Digital Fourier transformation, be called for short DFT) and the method for the energy value of all frequencies in calculated rate territory, discrete Fourier transform (DFT) wherein is with non-normalized discrete Fourier transform (DFT) (Non-unity Digital Fourier transformation, abbreviation NDFT) Ge Zeer (Goertzel) computational methods in, this is an improved method of discrete Fourier transform (DFT).FSK demodulation method proposed by the invention both can be realized with hardware circuit or integrated chip, also can realize with software, and the software realization is generally flexible than the hardware realization, cost is low.
Basic ideas of the present invention:
V.21 demodulator adopts Ge Zeer (Goertzel) computational methods of non-normalized discrete Fourier transform (DFT) to carry out frequency domain transform and calculates the energy of corresponding effective frequency among the FSK, utilize the different sizes of corresponding effective frequency energy value to judge the digital signaling zero or 1 of modulation signal representative, thereby finish demodulation.This method is converted to frequency-region signal with time-domain signal, does not need to consider the phase information of frequency-region signal, only is concerned about the amplitude of frequency-region signal, has just avoided the asynchronous problem of phase place.
The concrete technical scheme that the present invention takes is as follows:
A kind of based on facsimile modulation/demodulation recommendation FSK demodulation method V.21, be the modulated signal code stream that receives as input, carry out demodulation process, it meets the V.21 demodulation part of facsimile modulation/demodulation recommendation, the signal code stream here is actual to be the signaling code stream.Its method step is: receiving terminal carries out demodulation with the signaling code stream of receiving, the signaling content according to demodulation is come out produces corresponding signaling, and this signaling modulated and transmits, to finish the work of shaking hands of facsimile signal.The invention is characterized in, adopted non-normalized discrete Fourier transform (DFT) (Non-unity Digital Fouriertransformation in the demodulation method, be called for short NDFT) Ge Zeer (Goertzel) computational methods calculate the energy of corresponding frequency, judge digital signaling zero and 1 in the corresponding digital code stream by the energy of corresponding frequency.Among the present invention, the Ge Zeer computational methods of NDFT are converted to frequency-region signal to the time-domain signal of input, do not consider the phase information of frequency-region signal, have avoided relating to the nonsynchronous problem of phase place.Only by the amplitude information of frequency-region signal, calculate the energy of frequency-region signal, the fsk signal frequency that relatively detects needs by this energy further demodulates the corresponding digital code stream.
Be specially: by the amplitude information of frequency-region signal, calculate the energy of frequency-region signal, the fsk signal frequency that relatively detects needs by this energy further demodulates the corresponding digital code stream, and this method specifically may further comprise the steps:
1) read in the sample value of modulated facsimile control signal, every N sample value is carried out energy and is calculated; Step and method that energy calculates are:
V.21 two effective carrier frequency points in the modulation suggestion are 1850Hz, 1650Hz, calculate each effective frequency energy value respectively.The method of the corresponding effective frequency energy of described calculating is specially the Ge Zeer computational methods of non-normalized discrete Fourier transform (DFT):
The formula of Ge Zeer computational methods is:
Sampled point length (or number) is defined as for the discrete Fourier transform X (k) of the input time-domain signal x (n) of N:
In the following formula: n=0,1 ..., N-1; K=0,1 ..., N-1; X (N)=0;
Because e
J (the kN of 2 π/N)=1, so (1) formula also can be write as
Be convenience of calculation, establishing sampled point length is the equation y of N
k(n) be following equation:
(3) in the formula, m=0,1 ..., n; N=0,1 ..., N-1; K=0,1 ..., N-1; X (N)=0; According to (1) and (2) formula, when n=N, y
k(N) value is identical with the discrete Fourier transform expression formula (2) of x (n); That is to say that discrete Fourier transform value X (k) can be expressed as: when n was N, x (n) process linear filter was the output valve y behind the first order pole filter
k(N); Consider the needs of practical application, further become difference form corresponding to following formula (3):
y
k(n)=e
j(2π/N)ky
k(n-1)+x(n) (4)
Here (4) formula also is a discrete time system model, y
k(n) the current output valve of expression system, y
k(n-1) the expression system is in the output valve in the previous moment, and the current input value of x (n) expression system, n=O, 1 ..., N-1; K=0,1 ..., N-1; Y (1)=0 is arranged, i.e. the y of n<0 o'clock here
k(n) value all is 0.It is as follows that above (4) formula is carried out Z-transformation:
Y
k(z)=Y
k(z)z
-1e
j(2π/N)k+X(z), (5)
Y wherein
k(z)=Z[y
k(n)], X (z)=Z[x (n)],
Can obtain from (5) formula
In (6) formula, pole location is arranged
Comprised a complex coefficient, very inconvenient when realizing.Therefore, utilize second order complex conjugate limit
Filter replaces following formula (4), and it is as follows to obtain structural formula:
?V
k(z)=z[v
k(n)] (7)
Carrying out inverse Z-transform from (7) formula can obtain having only the difference equation of a real coefficient as follows:
Here (8) formula also is a discrete time system equation, n=0 wherein, and 1 ..., N-1; X (N)=0; K:O, 1 ..., N-1; v
k(n) be the current output valve of system, v
k(n-1) be the output valve in the previous moment of system, v
k(n-2) be system's output valve in preceding two moment, x (n) is the current input value of system; V wherein
k(1)=0, v
k(2)=0 is illustrated in the moment less than 0, and system's output valve is 0; Can know from above (6) formula and (7) formula:
Y
k(z)=V
k(z)(1-z
-1e
-j(2π/N)k),(9)
Like this, when calculating X (k), only have a complex coefficient as follows:
Only need to consider the amplitude information of discrete Fourier transform in the method, and needn't consider its phase information; Can further handle (11) formula, to remove complex coefficient:
| X (k) |
2It is exactly the energy value of our the relevant frequency that needs.With the time domain range value x (n) of N signal sampling point to be demodulated (n=0 wherein, 1 ..., N-1), correlated frequency point value k (k representative two frequency f 1=1850Hz V.21 of being provided with, f2=1650Hz) these two above-mentioned formula of parameter substitution (8) can calculate v by iteration
k(N-1) and v
k(N).Again with v
k(N-1) and v
k(N) substitution formula (12), thus calculate the frequency domain energy of the correlated frequency point of setting; Use following formula (8) and (12), just can from input time-domain signal x (n), extract the spectrum energy information of relevant frequency.
2) judge that according to the size of calculated frequency domain energy value the binary digital signal code element of this modulation signal representative is 0 or 1; If at the energy (E1850) at the 1850Hz place energy (E1650) greater than the 1650Hz place, then this modulation signal judgement is 0, otherwise this modulation signal judgement is 1;
3) if signals sampling point value to be demodulated does not finish with regard to repeating step 1), step 2); Otherwise, finish demodulation.
The advantage of demodulation method of the present invention:
1) the present invention has overcome the stationary problem in the demodulation, is important practical problem in the communication system synchronously, also is a difficult problem.Generally comprise bit synchronization and carrier synchronization synchronously in the signal transmission.When adopt the coherent detection method separate the timing receiving terminal need provide one with the coherent carrier of transmitting terminal modulated carrier with the frequency homophase, obtaining of this coherent carrier just is called carrier synchronization.Again because a string often signal element sequence of signal, separate timing and need know the start-stop moment of each code element, like this in the sampling judgement, receiving terminal just can produce a commutator pulse as the sampling judgement, the termination of it and receiving symbol should be alignd constantly, this process is exactly bit synchronous process, has only finished carrier synchronization and bit synchronization and could correctly demodulate digital signal.Yet, in our demodulation method, do not adopt the coherent demodulation method, do not adopt the method for sampling judgement pulse yet, therefore avoided carrier synchronization and bit synchronization, simplified the implementation method of demodulation greatly.
2) demodulation method of the present invention with software implement simple and flexible, adaptability is strong, cost is low.This demodulation method also can be realized with hardware.
Description of drawings
Fig. 1: FSK coherent demodulation method
Fig. 2: based on FSK demodulating algorithm flow chart V.21
Fig. 3: High-Level Data Link Control (HDLC) frame structure
Fig. 4: FSK real data (data that actual reception arrives in channel)
Fig. 5: Jian Yi parameter V.21.
Embodiment
Describe present embodiment in detail below in conjunction with accompanying drawing:
Digital signal detection often adopts discrete fourier transform method, and the time-domain signal of input is converted to frequency-region signal.The Ge Zeer computational methods of non-normalized discrete Fourier transform (DFT) have advantage: the first, and data of its input just can be calculated a parameter, have so just saved the lot of data memory space.The second, it allows to adopt the sample window of random length, comes the Fourier transform of the arbitrfary point in calculated rate territory.Therefore, the Ge Zeer computational methods have the requirement that better flexibility adapts to frequency.The different sizes of utilizing the Ge Zeer computational methods to calculate corresponding frequency energy value are judged the digital signaling zero or 1 of modulation signal representative, thereby have finished demodulation.Concrete method flow is seen the accompanying drawing 2 in the Figure of description.
The formula of Ge Zeer computational methods is:
Sampled point length (or number) is defined as for the discrete Fourier transform X (k) of the input time-domain signal x (n) of N:
In the following formula: n=0,1 ..., N-1; K=0,1 ..., N-1; X (N)=0;
Because e
J (the kN of 2 π/N)=1, so (1) formula also can be write as
Be convenience of calculation, establishing sampled point length is the equation y of N
k(n) be following equation:
(3) in the formula, m=0,1 ..., n; N=0,1 ..., N-1; K=0,1 ..., N-1; X (N)=0; According to (1) and (2) formula, when n=N, y
k(N) value is identical with the discrete Fourier transform expression formula (2) of x (n); That is to say that discrete Fourier transform value X (k) can be expressed as: when n was N, x (n) process linear filter was the output valve y behind the first order pole filter
k(N); Consider the needs of practical application, further become difference form corresponding to following formula (3):
y
k(n)=e
j(2π/N)ky
k(n-1)+x(n)(4)
Here (4) formula also is a discrete time system model, y
k(n) the current output valve of expression system, y
k(n-1) the expression system is in the output valve in the previous moment, and the current input value of x (n) expression system, n=0,1 ..., N-1; K=0,1 ..., N-1; Y (1)=0 is arranged, i.e. the y of n<0 o'clock here
k(n) value all is 0.It is as follows that above (4) formula is carried out Z-transformation:
Y
k(z)=Y
k(z)z
-1e
j(2π/N)k+X(z),(5)
Y wherein
k(z)=Z[y
k(n)], X (z)=Z[x (n)],
Can obtain from (5) formula
In (6) formula, pole location is arranged
Comprised a complex coefficient, very inconvenient when realizing.Therefore, utilize second order complex conjugate limit
Filter replaces following formula (4), and it is as follows to obtain structural formula:
Carrying out inverse Z-transform from (7) formula can obtain having only the difference equation of a real coefficient as follows:
Here (8) formula also is a discrete time system equation, n=0 wherein, and 1 ..., N-1; X (N)=0; K=0,1 ..., N-1; v
k(n) be the current output valve of system, v
k(n-1) be the output valve in the previous moment of system, v
k(n-2) be system's output valve in preceding two moment, x (n) is the current input value of system; V wherein
k(1)=0, v
k(2)=0 is illustrated in the moment less than 0, and system's output valve is 0; Can know from above (6) formula and (7) formula:
Y
k(z)=V
k(z)(1-z
-1e
-j(2π/N)k),(9)
Like this, when calculating X (k), only have a complex coefficient as follows:
Only need to consider the amplitude information of discrete Fourier transform in the method, and needn't consider its phase information; Can further handle (11) formula, to remove complex coefficient:
| X (k) |
2It is exactly the energy value of our the relevant frequency that needs.Use following formula (8) and (12), just can from input time-domain signal x (n), extract the spectrum energy information of relevant frequency.
The concrete stream of present embodiment demodulation method is as shown in Figure 2:
1) read in the sample value of modulated facsimile control signal, every N sample value is carried out energy and is calculated; Step and method that energy calculates are:
V.21 two effective carrier frequency points in the modulation suggestion are 1850Hz, 1650Hz, calculate each effective frequency energy value respectively.The method of the corresponding effective frequency energy of described calculating is specially the Ge Zeer computational methods of non-normalized discrete Fourier transform (DFT).With the time domain range value x (n) of N signal sampling point to be demodulated (n=0 wherein, 1 ..., N-1), correlated frequency point value k (k representative two frequency f 1=1850Hz V.21 of being provided with, f2=1650Hz) these two above-mentioned formula of parameter substitution (8) can calculate v by iteration
k(N-1) and v
k(N).Again with v
k(N-1) and v
k(N) substitution formula (12), thus calculate the frequency domain energy of the correlated frequency point of setting; Use following formula (8) and (12), just can from input time-domain signal x (n), extract the spectrum energy information of relevant frequency.
2) judge that according to the size of calculated frequency domain energy value the binary digital signal code element of this modulation signal representative is 0 or 1; If at the energy (E1850) at the 1850Hz place energy (E1650) greater than the 1650Hz place, then this modulation signal judgement is 0, otherwise this modulation signal judgement is 1;
3) if signals sampling point value to be demodulated does not finish with regard to repeating step 1), step 2); Otherwise, finish demodulation.
Test result:
V.21 modulation is proposed to be used in the binary system control signaling of modulation facsimile posting.The fax control procedure of binary code all adopts High-Level Data Link Control (High level Data Link Control, abbreviation HDLC) frame structure is (as accompanying drawing 3, annotate: the flag bit of HDLC frame structure is 0x7E, address bit is 0xFF, and control, fax control, facsimile message, Frame Check Sequence all are uncertain, determine according to the facsimile of reality).HDLC-procedure is a kind of bit-oriented link control procedure, and these rules make the monitoring function of communicating pair represent order and response to certain bit combination that the other side sends separately by both sides, can well adapt to interactive operation.Basic HDLC structure is made up of a plurality of frames, and every frame is divided into some fields, the confirmation that this structure provides sign, error checking and correction and correctly receives information for frame.
Accompanying drawing 3 has provided a HDLC frame structure, and it is made up of leader, flag sequence, address field, control field, information field (being divided into FCF facsimile control field and FIF facsimile information field), Frame Check Sequence etc.
When one section FSK modulating data (figure such as accompanying drawing 4) that typically meets V.21 suggestion that receives from actual channel of input.This segment data is the data of one section intercepting, can see clearly that from accompanying drawing 4 density degree of each several part of these data is different, and the frequency of the part of dredging as can be known through frequency detecting is 1650Hz, and the frequency of close part is 1850Hz.
These data are as follows through this demodulation method demodulation result:
011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111001111110011111100111111011111111110000001100001000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000001111010000110011000100111110001010001011111100111111001111110
Further adopt hexadecimal representation as follows:
7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E
7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E?7E
FF
C0?C2?04?04?04?04?04?04?04?04?04?04?04?04?04?04?04?04?04?1E?86?62?7C
51
7E?7E?7E
According to the facsimile rules in the CCITT suggestion T.30, front end is several 0x7E (01111110) (number of the number of the 0x7E that the G3 facsimile machine demodulation of different brands obtains and the G3 facsimile machine of the same brand 0x7E that repeatedly demodulation obtains during repeated call can be different slightly for flag bit in the above data sequence, the number of 0x7E is 41 in this segment data), ensuing 0xFF (11111111) is an address bit, the centre is control field 0xC0 (11000000 successively, 0xC2 (11000010), information field 0x04 (00000100) etc., middle signaling is different at every turn, will be (for example according to concrete facsimile posting, the number difference of facsimile machine, used fax-rate all can not cause on an equal basis the difference of the code stream that demodulation comes out) come fixed, 0x7E (01111110) appears again being masked as at last, this meets the binary system HDLC frame structure of the T.30 communication control procedure regulation of CCITT suggestion fully, and this is one section typical representative data.The FSK modulating data that other that adopts intercepting meets V.21 suggestion also has similar results after with this method demodulation, so the correctness and the validity of this demodulation method can be described.
Obtain modulation signal after adopting existing modulator approach to modulate the above-mentioned binary signal, send to the G3 facsimile machine and carry out the demodulation checking, G3 facsimile machine feedback result is correct.
Through checking, on the facsimile machine of different brands repeatedly the different pieces of information sequence obtained of repeated call carry out the above mediation modulation treatment of separating, the result is correct and meet above characteristics.
In addition, the software that designs according to this demodulation method carries out V.21 signal demodulation test on the cdma mobile communication base station system, and the result is correct.