1. Field of the Invention
The present invention relates to a packet detecting circuit and a method thereof, and more particularly to a packet detecting circuit and its method free of any affection caused by a DC offset.
2. Description of Related Art
When a general packet detecting circuit is used to detect a packet, the packet detecting circuit calculates a delay correlation function and an autocorrelation function. Next, the circuit divides the delay correlation function by the autocorrelation function to obtain a packet detecting value, and then compares the packet detecting value with a predetermined threshold value to obtain the packet entry time, so as to achieve the purpose of the packet detection.
However, the portion of the DC offset is also included in the calculation when a packet detecting circuit having a DC offset calculates a delay correlation function and an autocorrelation function, and thus causing an error. Therefore, the packet detecting circuit cannot detect a packet accurately. In a general packet detecting circuit, the delay correlation function is calculated by:
where, Sn is the value of a signal inputted to a packet detecting circuit, Sn+D is the value of a signal inputted to a packet detecting circuit after delaying D sampling points. However, if there is a DC offset, the delay correlation function is calculated by:
where, Rn=Sn+Pn, Rn+D=Sn+D+Pn+D, and Pn and Pn+D are DC offset values. Within a time period, if the DC offset is a constant P0, and the average of the signal is zero, the delay correlation function is calculated by:
Then, Formulas 1 and 3 are compared. Due to the DC offset, it is easy to misjudge the delay correlation function since an extra value of
is generated.
On the other hand, a general packet detecting circuit calculates an autocorrelation function by:
where, Sn+D is the value of a signal inputted in a packet detecting circuit after delaying D sampling points. If there is a DC offset, the autocorrelation function is calculated by:
where, Rn+D=Sn+D+Pn+D, and Pn+D is a DC offset value. Within a time period, if the DC offset is a constant P0, and the average of the signal is zero, the autocorrelation function is calculated by:
Then, Formulas 4 and 6 are compared. Due to the DC offset, the autocorrelation function for the signal will have an extra error
From the description above, the DC offset will cause an error in the calculation of the delay correlation function and the autocorrelation function. To overcome the foregoing technical problem, a method for first eliminating the DC offset of a conventional art is provided to improve the affection of the DC offset to the detection of a packet.
Referring to
Before the packet detecting circuit 10 utilizes the delay correlation function calculating circuit 101 and the autocorrelation function calculating circuit 102 to calculate the delay correlation function, a DC offset eliminator 11 is used to eliminate the DC offset first. In general, the DC offset eliminator 11 is used to prevent the calculation of the delay correlation function calculating circuit 101 and the autocorrelation function calculating circuit 102 from including the DC offset that causes an error and detection inaccuracy of the packet detecting circuit 10. After the DC offset eliminator 11 eliminates the DC offset of the input signal and the calculation of the delay correlation function and the autocorrelation function, the packet detection triggering value calculating circuit 103 determines a packet detection triggering time according to the calculation result of the delay correlation function and the autocorrelation function, and controls the switching unit 104 to output the signal.
However, the packet detecting circuit 10 needs to eliminate the DC offset by the DC offset eliminator 11 for accurately detecting the packet entry time. If the DC offset eliminator 11 fails, the DC offset may not be eliminated. Thus the packet detecting circuit 10 cannot detect the packet entry time accurately.
Besides the foregoing packet detecting circuit 10, some packet detecting circuits eliminate the DC offset by using noises beforehand and start the packet detection. But the DC offset may vary with temperature or other circuits, such that after the packet detection starts, sometimes the DC offset may still exist, and causes a computational error of the delay correlation function and the autocorrelation function, so that the packet detecting circuit cannot detect a packet entry time accurately.
In view of the foregoing shortcoming of the prior art, it is a primary objective of the present invention to provide a packet detecting circuit that is not affected by a DC offset, so that the invention can calculate accurate delay correlation function and autocorrelation function for a signal when existing a DC offset. After that, the packet detecting circuit can detect a packet quickly.
To achieve the foregoing objective, the present invention provides a packet detecting circuit, comprising a delay correlation function calculating circuit, an autocorrelation function calculating circuit, an autocorrelation function DC offset elimination circuit and a packet detection triggering calculating circuit. The delay correlation function calculating circuit receives an input signal and calculates a delay correlation function for the input signal. The delay correlation function calculating circuit comprises an average deduction circuit for deducting an average time period of the input signal. The packet detecting circuit uses an autocorrelation function calculating circuit to receive the input signal, and calculates an autocorrelation function for the input signal; and an autocorrelation function DC offset elimination circuit is used for calculating a DC offset value, and subtracting the DC offset value from the autocorrelation function for the input signal; and the packet detection triggering calculating circuit calculates a packet detection triggering value to detect a packet entry time according to the output values of the delay correlation function calculating circuit and the autocorrelation function DC offset elimination circuit.
The present invention further provides a packet detecting circuit, comprising a delay correlation function calculating circuit, a delay correlation function DC offset elimination circuit, an autocorrelation function calculating circuit, an autocorrelation function DC offset elimination circuit and a packet detection triggering calculating circuit. The packet detecting circuit uses a delay correlation function calculating circuit to calculate an input signal of the delay correlation function, and a delay correlation function DC offset elimination circuit to calculate a first DC offset value, and the first DC offset value is subtracted from the computational result of the delay correlation function calculating circuit. The autocorrelation function calculating circuit calculates the autocorrelation function for the input signal, and the autocorrelation function DC offset elimination circuit calculates a second DC offset value, and subtracts the second DC offset value from the computational result of the autocorrelation function calculating circuit. Finally, the packet detection triggering calculating circuit calculates a packet detection triggering value to detect a packet entry time according to the output values of the delay correlation function DC offset elimination circuit and the autocorrelation function DC offset elimination circuit.
The present invention further provides a packet detecting method, comprising the steps of: receiving a signal; calculating a delay correlation function for the signal, wherein the delay correlation function is produced by deducting an average time period of the signal for calculating an autocorrelation function and a DC offset value, and the autocorrelation function subtracts the DC offset value; and finally computes a packet detection triggering value to detect a packet entry time according to the delay correlation function and after the autocorrelation function subtracts the DC offset value.
The present invention provides a packet detecting method, comprising the steps of: receiving a signal; computing a delay correlation function and a first DC offset value, and subtracting the first DC offset value from the delay correlation function; calculating an autocorrelation function and a second DC offset value, and subtracting the second DC offset value from the autocorrelation function; finally calculating a packet detection triggering value to detect a packet entry time according to the delay correlation function minus the first DC offset value and the autocorrelation function minus the second DC offset value.
To make it easier for our examiner to understand the innovative features and technical content, we use preferred embodiments together with the attached drawings for the detailed description of the invention, but it should be pointed out that the attached drawings are provided for reference and description but not for limiting the present invention.
The present invention uses a concept of variables in statistics to eliminate the affection of DC signal to the packet detecting circuit, such that the packet circuit having a DC offset can precisely calculate the delay correlation function and the autocorrelation function for the signal, and quickly detect a packet entry time.
Referring to
The delay correlation function calculating circuit 201 is used for receiving an input signal, and calculating a delay correlation function for the input signal, and using an average deduction circuit 2011 to deduct an average of the signal, and eliminate the affection of the DC offset to obtain a more accurate delay correlation function.
From Formula 3, the computed delay correlation function of the signal has an extra
due to the DC offset, and thus causes misjudgment easily. Therefore, the delay correlation function of a signal provided by the delay correlation function calculating circuit 201 is calculated by:
where, Rn+i=Sn+i+Pn+i, Rn+D+i=Sn+D+i+Pn+D+i, Pn+i and Pn+D+i are DC offset values, Sn+i is the value of an input signal, Sn+D+i is the value of an input signal after delaying D+i sampling points. Within a time period, the DC offset is a constant P0, and Formula 7 becomes:
If the average of the signal is zero, Formula 8 is equivalent to:
From Formula 9, the result is equivalent to the situation without a DC offset (as shown in Formula 1), and thus the delay correlation function calculating circuit 201 calculates the delay correlation function to effectively eliminates the affection of the DC offset.
In
From Formula 6, an error of extra
occurs during the computation of the autocorrelation function for a signal due to the DC offset. The autocorrelation function DC offset elimination circuit 203 calculates an error caused by the DC offset, and eliminates the error from the autocorrelation function. The autocorrelation function calculating circuit 202 calculates the autocorrelation function by:
where, Rn+D=Sn+D+Pn+D, Sn+D is the value of an input signal after delaying D sampling point, and Pn+D is a DC offset value. The autocorrelation function DC offset elimination circuit 203 calculates a DC offset value by:
In Formula 10, it is assumed that the DC offset within a time period is a constant P0 and the average of a signal is zero, and thus
The result of Formula 12 can eliminate the different terms of Formulas 4 and 6, such that after the autocorrelation function DC offset elimination circuit 203 calculates the DC offset, the DC offset value is deducted from the autocorrelation function as follows:
Therefore, a more accurate autocorrelation function can be obtained by the computational result of the autocorrelation function DC offset elimination circuit 203.
After the delay correlation function calculating circuit 201 and autocorrelation function DC offset elimination circuit 203 produce a delay correlation function and an autocorrelation function, the packet detection triggering value calculating circuit 204 calculates a packet detection triggering value according to the delay correlation function and autocorrelation function produced by the delay correlation function calculating circuit 201 and autocorrelation function DC offset elimination circuit 203 respectively”. Then a packet entry time can be obtained according to the packet detection triggering value for controlling the switching unit 205 to allow the packet to pass through.
Referring to
From Formula 3, an error of extra
occurs in the computation of a signal delay related power value due to the DC offset, and easily produces misjudgments. Therefore, the present invention uses a delay correlation function calculating circuit 301 to receive a signal and calculate the delay correlation function of a signal, and then the delay correlation function DC offset elimination circuit 306 eliminates the affection of the DC offset to the signal delay related power value to obtain a more accurate signal delay related power value.
The delay correlation function calculating circuit 301 calculates the delay correlation function by:
where, Rn=Sn+Pn, Rn+D=Sn+D+Pn+D, Pn and Pn+D are DC offset values, Sn is the value of an input signal, and Sn+D is the value of an input signal after delaying D sampling points.
The delay correlation function DC offset elimination circuit 306 calculates a first DC offset value by:
where, Rn+i=Sn+i+Pn+i, Rn+D+i=Sn+D+i+Pn+D+i, Pn+i and Pn+D+i are DC offset values, Sn+i is the value of an input signal after delaying i sampling points, Sn+D+i is the value of an input signal after delaying D+i sampling points. Assumed that the DC offset value within a time period is a constant P0 and an average of a signal is zero, the first DC offset value is:
The result of Formula 16 is used for eliminating the different terms in Formulas 1 and 3, such that after the delay correlation function DC offset elimination circuit 306 calculates a first DC offset value, the first DC offset value of the delay correlation function obtained by the delay correlation function calculating circuit 301 is eliminated as follows:
From Formulas 14, 15 and 16, the delay correlation function is obtained by the delay correlation function calculating circuit 301, and then the delay correlation function DC offset elimination circuit 306 calculates the first DC offset value, and the first DC offset value is deducted from the delay correlation function, so as to eliminate the affection of DC offset to the delay correlation function.
From Formula 6, an error of extra
occurs in the computation of the autocorrelation function for a signal due to the DC offset. The present invention uses an autocorrelation function DC offset elimination circuit 303 to calculate an error caused by a second DC offset, and then the error is deducted from the autocorrelation function calculated by the autocorrelation function calculating circuit 302. The autocorrelation function calculating circuit 302 receives a signal, and calculates a signal autocorrelation function by:
where, Rn+D=Sn+D+Pn+D, Sn+D is the value of an input signal after delaying D sampling points, and Pn+D is a DC offset value. The autocorrelation function DC offset elimination circuit 303 calculates a second DC offset value by:
In Formula 19, assumed that the DC offset within a time period is a constant P0 and an average of a signal is zero, Formula 20 is derived below:
The result of Formula 20 is used for eliminating the different terms of Formulas 4 and 6, such that after the autocorrelation function DC offset elimination circuit 203 calculates the DC offset value, the DC offset value is eliminated from the autocorrelation function as follows:
The computational result of the autocorrelation function DC offset elimination circuit 303 can give a more accurate autocorrelation function.
After the delay correlation function DC offset elimination circuit 306 and autocorrelation function DC offset elimination circuit 303 produces a delay correlation function and an autocorrelation function, the packet detection triggering value calculating circuit 304 calculates a packet detection triggering value according to the delay correlation function and autocorrelation function produced by the delay correlation function DC offset elimination circuit 306 and the autocorrelation function DC offset elimination circuit 303 respectively. After that, a packet entry time is calculated according to the packet detection triggering value, so as to control the switching unit 305 to pass a packet.
In summation of the description above, the packet detecting circuit of the invention is not affected by the DC offset and can calculate accurate delay correlation function and autocorrelation function without including a DC offset, so that the packet can be detected more accurately. The variation of DC offset caused by other circuits or temperature will not affect the computation of delay correlation function and autocorrelation function by the packet detecting circuit.
Although the present invention has been described with reference to the preferred embodiments thereof, it will be understood that the invention is not limited to the details thereof. Various substitutions and modifications have been suggested in the foregoing description, and others will occur to those of ordinary skill in the art. Therefore, all such substitutions and modifications are intended to be embraced within the scope of the invention as defined in the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
96118987 | May 2007 | TW | national |