A METHOD TO COMPENSATE FOR THE TRUNCATION ERROR IN A SAMPLED SIGNAL AND A DEVICE FOR CARRYING OUT THE METHOD

Abstract: A method for compensating the truncation error occurring in a sampled signal during processing in a digital filter. The mean error et is calculated for the filter, and before filtering the signal +et is added if the signal is positive and -et is added if the signal is negative. A device for carrying out the method is also described.

Description: A METHOD TO COMPENSATE FOR THE TRUNCATION ERROR IN A SAMPLED SIGNAL AND A DEVICE FOR CARRYING OUT THE METHOD TECHNICAL FIELD The present invention relates to a method and apparatus wherein a sampled signal with a given number of bits, e.g. 16 bits, is compensated for the error in the signal occuring when the signal has been truncated towards a lower value after multiplication. Such an operation is generally performed in a digital filter. BACKGROUND ART In a digital filter, particurlarly one included in a subscriber line audioprocessing circuit (SLAC), calculations are carried out on a sampled signal. Each signal sample is represented as a digital word in linear code. The number of bits/word depends o the dynamic range required by the filter. Multiplications with digital coefficients are performed in the calculations in the filter. The result of a multiplication normally contains , more bits than the available word length, and the result must therefore be rounded off or truncated. By rounding off is intended here that the digital value is given a new value lying nearest over or under the original value, according to the same rules as those for decimals. By truncation is intended here magnitude truncation, i.e. the digital value is given a new value, the amount of which is always under the amount of the original value (truncation towards zero). If rounding off is used there is a risk of self-oscillation in the digital filter if this is of the infinite impulse reponse type, i.e. filter where the signal is fed back. If magnitude truncation is used, the filter can be constructed so that the risk of self-oscillation is removed, since the digital values are continually rounded off towards zero. Truncation is furthermore easier to realize than rounding off. However, magnitude truncation resluts in that the signal will always be somewhat too small, due to truncation errors in the calculations. This particur- larly affects the low signal levels where the truncation error is not negligible OMPI compared with the signal amplitude. In the accompanying Figure 1, an analogue, signal 1 is illustrated, and in this example it is sinusoidal. It has been sampled to give the sample values s.^..., which constitute the input signal to a digital filter. The output signal from the filter is illustrated in Figure 2. Apart from the desired changes in the signal caused by filtering, the sample values s.s * .-. have been given a somewhat lower value that that of the nominal signal 1 due to truncations in the filter. The (dashed) analogue signal 2 corresponding to the truncated sample values s^**-*-* ιs thus less than the signal 1. It is previously known to increase the number of bits/word so that the effect of truncation errors will be as small as possible. Many bits/word result in a more complicated circuit, however, since registers, stores and calculating units, i.e. arithmetic logic units (ALU), must be made large. On the appended drawing, Figure 3 illustrates the amplification A in a filter as a function of the signal level. The number of bits/word (16,17,18 or 19 bits/word) has been given as a parameter. DISCLOSURE OF INVENTION The object of the present invention is to provide a method and a device which will compensate the error occurring in the truncation of a digital signal having a given number of bits/word, the signal being processed in a digital filter. In accordance with the invention, the mean truncation error for the filter which processes the signal is calculated, this error being added to the positive input sample of the filter, and subtracted from the negative input samples. The invention is characterized as disclosed in the following claims. BRIEF DESCRIPTION OF DRAWINGS The invention will now be described in detail with reference to the accom¬ panying drawings, Figures 1 and 2 are diagrams of a sinusoidal, sampled signal before and after truncation in a digital filter; Figure 3 illustrates the amplification in a digital filter as a function of the input signal level for different word lengths; OMPI tA Figures 4 and 5 are diagrams corresponding to the diagrams in Figures 1 and 2. and are intended to illustrate the method in accordance with the invention; Figure 6 is a block diagram of a conceivable realization of the method in accordance with the invention; Figure 7 is the same diagram as in Figure 3, but the inventive method has now been used on the filter input signal. BEST MODES FOR CARRYING OUT THE INVENTION Figures 1, 2 and 3 have been explained hereinbefore in conjunction with the background art. Figure 4 is a time chart illustrating how, in accordance with the inventive method, an amount +e fc is added to the positive signal samples s. So." and a negative amount -e fc is added to the negative signal samples S,,SΛ... . No correction is added to the signal sample s, which is zero. Figure 5 is a diagram of the output signal from the digital filter. Since the correction e has been selected equal to the mean truncation error, the output signal samples follow on an average the desired nominal output signal 3. Figure 6 is a block diagram for a possible embodiment of a device included in a subscriber line audioprocessing circuit (SLAC), for example, and carries out the method according to the invention. A sampled signal is obtained at the input a, this signal not yet having been processed in any digital filter and is not truncated. This signal is to be taken to a main transmission filter 1 for filtering as is described in the patent application PCT/US80/00754, for example. The input a is connected to the first input of a digital adder circuit 2 and a digital sensing unit 4, which conventionally senses the polarity of the incoming signal at the input a. The block 3 is illustrated here as a simple memory unit, which stores the values +e and -e in digital form, the value +e. being obtained at the output b, and the value -e fc at the output b«. Since the values +e fc are generally represented by more than one bit, b^ and b represent the output from two bus lines. The block 5 is a controllable switch, e.g. a muliplexer, which connects the output b, or b« to the second input of the adder circuit 2 in response to the output magnitude (0 or 1) obtained at the output of the sensing unit 4. If this unit senses positive polarity in the input signal at the input a, a binary "one" is sent to the switch 5 and this connects the output b-. to the second input of the adder circuit 2. On the other hand, if a negative polarity is sensed, a binary OMPI WIPO "zero" is sent and the switch is controlled so that the output b- is connected to * the second input of the adder circuit. A value +e fc is thus added to the incoming sampled signal, which is then taken to the digital filter 1. A calculation is performed in the filter with the aid of multipliers and adding circuits and truncations are carried out, an output signal being obtained having a signal sample illustrated in Figure 5, as well as the resulting analogue counterpart, curve 3. Figure 7 is a diagram of the filter amplification as a function of the input signal level, when the compensating circuit according to Figure 6 is connected such as to precede the filter. In comparison with the amplification according to Figure 3, it will be seen that the same amplification properties are achieved with 16 bits/word in the latter case with the inventive method as if about 19 bits/word were used without the inventive method being utilized. The improvement in the amplification linearity thus corresponds to a word length of several bits, and according to the above this gives simpler calculating circuits. The compensating circuit according to Figure 6 is illustrated in the form of a block diagram for the purpose of explanation and constitutes a possible embodiment. In practice, the various blocks (memory unit, adding circuit, switches) are realised with IC technique in the arithmetical unit ALU of the subscriber line circuit. In order that compensation for the truncation error may be kept simple, the magnitude e fc should be an integral number in the ALU. This generally results in that the compensation will not be entirely optimum.

Claims: CLAIMS 1. A method of compensating for the error which, in a digital signal with a given number of bits, occurs be truncation in a digital filter, particurlarly magnitude truncation, the signal being positive or negative relative to a given zero level, characterized in that when the signal is positive a positive first value (e is added to the signal, this value corresponding to a mean truncation error, and when the signal is negative a negative second value is added to the signal. 2. Method as claimed in claim 1, characterized in that said first and said second values (+e fc and -e are equal in amount. 3. Method as claimed in claim 1 and 2, characterized in that neither of said values is added to the digital signal when it is zero. 4. Device for carrying out the method according to claims 1-3, characterized by a memory unit (3) which stores, and via both its outputs sends a first positive and a second negative value (+e and -e , by a sensing unit (4) for sensing the polartiy of a sampled signal applied to a digital filter (1), and by a switching unit (5) connected to the first input of an adding circuit (2), the second input of which receives said signal and which has its output connected to the input of the filter (1). OMPI "

Inventors: DALQVIST INGEMAR ERIK, ERIKSSON GUNNAR ANDERS, DALQVIST, INGEMAR, ERIK, ERIKSSON, GUNNAR, ANDERS
Applicants: ERICSSON TELEFON AB L M, TELEFONAKTIEBOLAGET LM ERICSSON
Application year: 1984
Main classification: H03M13
IPC codes: G06F7, H03H17