Controlling asynchronous conversion between analog and digital parameters
The present invention relates to a method for controlling a PCM-codec which converts incoming analog signals to PCM words transmitted at a first clock frequency and which converts at a second clock frequency incoming PCM words to outgoing analog signal samples wherein at least one of the two conversion types is achieved by means of an approximation operation and the clock frequencies have approximately equal period lengths. The invention also relates to apparatus for performing the method. 
     Such converting methods are known and in particular the required A to D (analog to digital) and D to A (digital to analog) converters respectively are described in articles entitled &#34;Conversion A/D &amp; D/A&#34; reported during &#34;Journees d&#39;electronique 1973&#34; and published by &#34;Ecole polytechnique federale de Lausanne&#34;. These articles also discussed linear and logarithmic coding and decoding curves respectively for establishing coding relations between the analog signal samples and the PCM words. 
     There are direct conversion methods according to which the incoming information is converted owing to the characteristic curve directly to the outgoing information, and there are approximation methods according to which the characteristic curve is scanned by means of an approximation program until a curve interval is found whose analog signal amplitude and PCM word respectively agree with the incoming information. Constructively direct D to A conversions are achieved easier than direct A to D conversions. A simple and quick reacting direct D to A converter is described in the Swedish Patent Application No. 7510801-9. The above cited articles also describe A to D approximation methods wherein each approximation step includes a direct D to A conversion. One of the methods is called successive approximation which will hereinafter be dealt with in detail. 
     The above mentioned summary of prevalent conversion methods makes clear that there are PCM codec types which include apparatus which is used both for A to D and for D to A conversions. For example both the conversion types (A to D and D to A) use an approximation logic network in order to generate coding characteristics, or a D to A converter working according to the direct method. 
     An object of the present invention is to control such a PCM codec so that there is no redundant equipment without requiring synchronous operation conditions. A synchronously controlled multi-channel codec described in German published application No. 2432976 has a common clock signal generator for controlling in parallel a number of binary counters each associated with an A to D and D to A converter for each of the channels, one A to D and one D to A conversion operation being executed during each time slot in parallel, i.e., with separate equipments. In German published application No. 2333299 there is shown a synchronously controlled one-channel codec having a common function generator for scanning a conversion characteristic curve which is used in parallel for A to D and D to A conversion. A synchronously controlled PCM codec described in German published application 2518277 comprises a common D to A converter which in alternating order is used for A to D and D to A conversions. 
     None of these known codec apparatuses would, however, work satisfactory during so called plesiochronous operation conditions where the clock frequencies of the two converting types have the same nominal value, around which are allowed constant or varying deviations within determined limits. Independent of which of the clock frequencies periodically is higher or lower than the other, the present invention contemplates that one conversion type will be carried out at a time and never in parallel with the other conversion type. Thus in designing a suitable codec type which utilizes the same kind of equipment for A to D and D to A conversion no redundant equipment is needed because the same equipment which at a time takes part in the first type of conversion is used, in spite of plesiochronous conditions, at another time in the second type of conversion. 
    
    
     The present invention the characteristics of which appear from the claims and which achieves such advantageous qualifications without the disadvantageous side effects such as loss of information will now be described by means of the accompanying drawing. 
     In the drawing, 
     FIG. 1 shows a block diagram of an apparatus for carrying out the invention, 
     FIGS. 2 to 4 show different embodiments of a control unit for the apparatus of FIG. 1, and 
     FIG. 5 shows a control unit which controls a PCM codec provided with a common direct D to A converter. 
    
    
     FIG. 1 shows an analog input memory AM/in receiving incoming analog signals a/in in order to take analog signal samples as/in. The sampings are periodically performed under control of timing or clock pulses tAD intended for AD conversions. The pulses are obtained from a first clock pulse generator PG/AD which generates pulses at the above-mentioned first clock frequency. The analog signal samples are transferred from the input memory AM/in to a first input of an analog comparator AC. An approximation logic unit AL which is zero set by means of a zero pulse zp is stepped by means of stepping pulses sp, in order to generate, during a time interval between two successive stepping pulses, an analog signal amplitude a and its, according to a conversion curve, associated digital word d. This stepping principle is indicated by means of a register R from which the amplitude obtained during a time interval is transferred to a second input of the analog comparator AC which generates a difference signal ds. The approximation logic unit AL continues the approximation process or transmits a final signal fs. In an A to D conversion the final signal activates the transfer of the digital word d registered in the register R to a digital output memory DM/out from which a PCM pulse train pt/out is transmitted by means of timing pulses tAD/out generated by first clock pulse generator PG/AD. If the PCM words are transmitted serially, the frequency which determines the output timing pulses tAD/out will be a multiple of the frequency which determines the input clock or timing pulses tAD/in. If the PCM words are transmitted in parallel form, the input and output timing pulses are synchronous except for a possible but constant phase displacement between the pulses which is inserted for adapting the output time to the operation time needed for the conversion process. 
     According to FIG. 1 each of the two conversion types are carried out in a completely corresponding way. A second clock pulse generator PG/DA generates, in known manner from an incoming PCM pulse train pt/in, for D to A conversions the required timing or clock pulses tDA/in, by means of which a digital input memory DM/in is controlled in order to buffer store incoming PCM words d/in. The digital word d obtained during an approximation step and registered in said register R is compared with the buffer stored PCM word by digital comparator DC whose output emits the difference signal ds which controls the approximation logic unit AL. In a D to A conversion a final signal activates the transfer of the registered analog-signal amplitude a to an analog output memory AM/out. The memory emits an outgoing analog signal sample as/out via a gate in response to an output timing pulse tDA/out generated by the second clock pulse generator PG/DA. This timing disregarded a possible phase displacement and is synchronous in comparison with the input timing pulses tDA/in. 
     The output memories DM/out and AM/out would be unnecessary, if the conversion operations are such and are controlled in such a manner that said final signals fs always occur synchronously with the incoming timing pulses of the respective conversion type. 
     The general codec equipment shown in FIG. 1 is provided with a result memory RM whose inputs and outputs are connected to the approximation logic unit AL which is assumed to generate, during each approximation time interval, such intermediate results which make it possible that after a pause to resume the approximation process without repeating previously performed steps. The pause begins when an interruption signal IS interrupts the transmission of the intermediate results from the approximation logic unit via an AND-gate G1 to the result memory. The pause ends when a continuing signal cs opens an AND-gate G2 for transfer of the intermediate results from the result memory RM to the approximation logic unit AL which during the pause has been idle of carrying out another approximation operation. 
     The codec equipment according to FIG. 1 is provided with gate devices G3, G4 and G5, G6, which are controlled by means of conversion type signals cAD and cDA so that the approximation logic unit AL and the register R take part in the A to D and D to A conversion operations, respectively. Dependent on the conversion methods, each conversion type needs maximally a number of time intervals. However in spite of plesiochronous conditions it is possible to use the same approximation logic unit AL and register R for both operation types, if the allowed tolerance limits of the clock frequencies, time intervals and maximal numbers of time intervals are so related to each other that the time required for at least one conversion operation of each type is less than the time between two successive sampling or timing pulses intended for one of the operation types. 
     The approximation logic unit AL according to FIG. 1 obtains the stepping pulses sp from an AND-gate G7 of a time interval generator TU. The means for obtaining two-successive-stepping-pulses-limited time intervals is achieved by a single-shot element SSE1. The input of element SSE1 is activated via an OR-gate OR1 by either a zero pulse zp, or a continuing signal cs, or by pulse trailing edges generated of the single-shot element via AND-gate G7 on the assumption that the approximation logic unit does not transmit the final signal fs. According to the shown common principle each zero pulse zp or continuing signal cs starts the generation of a time interval when a possible present time interval is ended. Obviously the time interval generator TU can also be constituted of a step pulse generator started and stopped in a corresponding way. Hereinafter in connection with FIG. 5 there will be described how such stepping pulses and time intervals are achieved by means of a timing frequency multiple which is generated by one of the clock pulse generators. 
     The codec equipment according to FIG. 1 is controlled by means of a control unit CU which receives the pulses tAD/in and tDA/in coming from the clock pulse generators PG/AD and PG/DA and the final signals fs coming from the approximation logic AL unit. The unit generates the conversion type signals cAD and cDA, the zero pulses zp, and the interruption and continuing signals IS and cs. FIGS. 2 to 4 show three embodiments control unit CU which receive timing pulses t1 and t2 generated by the clock pulse generators and transmit conversion type signals c1 and c2. The designations 1 and 2 are used in order to distinguish between the two conversion types. If for example the designation 1 is chosen for A to D conversion operations, the timing pulses t1 are the above-mentioned timing pulses tAD/in, and the conversion type signals c1 are the above-mentioned signals cAD so that the approximation logic unit AL takes part in an A to D conversion operation. Similarly the designation 2 would be associated with D to A conversions. 
     FIG. 2 shows a first embodiment of the control unit CU which comprises two notification units NU1 and NU2 whose outputs are connected to the respective conversion type flip-flops FF1 and FF2. The notification units NU1 and NU2 each comprise an AND-gate G8 and a flip-flop FF3, the one input of which receives the timing pulses and the second input of which is connected to the output of the AND-gate G8 which constitutes the output of the notification unit. AND-gate G8 is arranged for preventing the conversion type flip-flop belonging to the same conversion type from being put in its one stable state a by means of a respective timing pulse if the flip-flop associated with the second conversion type is already in the corresponding state a. The final signal fs resets an a-set type flip-flop. If the timing pulses t1 and t2 coincide and if therefore type flip-flops FF1 and FF2 are set to a-state simultaneously, a doubling protection unit DP prevents a coincidence of the conversion type signals c1 and c2. The doubling protection unit DP comprises AND-gates G9 and G10 which, in the coincidence case, stops the type signal c1, notifies via an OR-gate OR2, again an operation of the type 1 and resets, via an OR-gate OR3, the type flip-flop FF1. This first embodiment forces varying waiting times before a conversion operation is allowed to start. Therefore, the zero pulses zp transmitted via an OR-gate OR4 and consequently also the final signals fs generated by the approximation logic unit are not in synchronism with the respective timing pulses. The memories AM/in, DM/in, AM/out and DM/out in order to buffer store the incoming and outgoing information are consequently indispensable codec parts. A result memory, however, is not needed, because this first embodiment generates no interruption and continuing signals. 
     FIG. 3 shows a second embodiment of the control unit which in correspondence with the first embodiment comprises two conversion type flip-flops FF1 and FF2, a notification unit NU2 and an OR-gate OR4. In this second embodiment each timing pulse t1 always immediately releases a zero pulse zp and a conversion type signal c1. If it is assumed that the conversion method determined by means of the designation 1 consists of a constant number of time intervals, as for example the above mentioned successive approximation method, synchronism is obtained between the timing pulses t1 and respective final signals fs. Thus it follows that the output memory for buffer storing respective outgoing information is dispensible. In a respective direct conversion method the input memory for buffer storing respective incoming information would, furthermore, be unnecessary. 
     The second embodiment also includes a delay device DD connected to the notification unit NU2. The delay unit DD emits for each timing pulse t1 two pulses which, in relation to this timing pulse, are delayed in such a way that the first pulse delayed by a time dt1 occurs when the type signal c1 absolutely has ceased, and that the other pulse delayed by a time dt2 occurs when a type signal c2 generated in response to the said first delayed pulse absolutely has ceased. The type signals c2 and associated zero signals zp arise if a conversion of type 2 is notified by means of a timing pulse t2. The time interval generator TU is in this connection so dimensioned that each period determined by the timing pulses t1 embraces as many time intervals which at the most are needed for one type 1 operation and two operations type 2. If the timing pulses t2 have a higher frequency than the timing pulses t1, furthermore, the above-mentioned pre-requisite has to be fulfilled, i.e., that an operation of each type is embraced in a period determined by the timing pulses t2. In spite of plesiochronous conditions, the type signals c1 and c2 can for this second embodiment never coincide. Therefore, the doubling protection unit described in connection with FIG. 2 is unnecessary. The conversion operations of type 2 are exposed to varying waiting times, consequently, the controlled codec equipment has to be provided with respective buffer memories. 
     FIG. 4 shows a third embodiment of the control unit which like the first embodiment comprises two conversion type flip-flops FF1 and FF2, a notification unit NU1, a doubling protection unit DP and OR-gates OR2, OR3 and OR4. A present operation of the type 2 prevents the type flip-flop FF1 from being put in the stable state a, and the doubling protection unit prevents both type flip-flops from being put simultaneously in the stable state a. In this third embodiment each timing pulse t2 always immediately releases a zero pulse zp and a conversion type signal c2. The AND-gate G9 of the doubling protection unit DP achieves an interruption of an already begun operation of the type 1 because the type flip-flop FF1 is reset via the OR-gate OR3 and a continuation of the interrupted operation is notified via the OR-gate OR2. An interruption unit IU for generating the above-mentioned interruption and continuing signals IS and cs comprises a reversing switch which, in FIG. 4, is constituted of two AND-gates G11 and G12. The switch has its input connected to the output of the notification unit NU1 and its outputs transmit a continuing signal cs and a zero pulse zp respectively in dependence of the state a and b respectively of an interruption flip-flop FF4. The flip-flop FF4 generates an interruption signal IS, when it is set to the a-state by means of an AND-gate G13 which is activated by a timing pulse t2 occurring during a present operation of type 1. The continuing signal cs sets the interruption flip-flop to the b-state. 
     FIG. 5 shows a PCM codec which comprises a direct converting D to A converter DAC for, on the one hand, converting the PCM words d/in incoming via the activated AND-gate G5 to outgoing analog samples as/out via the activated AND-gate G6, and for, on the other hand, participating in a so called successive approximation process. For this purpose, the AND-gates G3, G4 and G14 are activated and an analog comparator AC is used for comparing the analog signal sample as/in from an input memory AM/in with an approximation amplitude and for generating a nullification signal ns if the sample is less than the approximation amplitude. Further an approximation register AR has bit positions which are step-by-step set to &#34;1&#34; by means of a significance counter SC but are reset to &#34;0&#34; during a respective step if a D to A conversion of the contents of the approximation register causes a nullification signal ns. It should be noted that each A to D time section in the successive approximation includes a put-to &#34;1&#34; phase, a D to A conversion phase, a comparison phase and a proof phase, while the entire D to A conversion operation consists only of one D to A conversion phase which requires only a part of a single A to D time interval. 
     The control unit CU shown in FIG. 5 is a modification of the third embodiment described in connection with FIG. 4, the D to A conversion having priority in relation to the A to D conversion and care having been taken to the time relations between the phases. Each timing pulse tAD/in obtained from the clock pulse generator PG/A to D and intended for notifying an AD conversion at the notification unit NU/AD, connects the most significant bit position of the approximation register AR to the significance counter SC. Step pulses sp achieve successive significance value reductions. When the processing of the lowest significant bit position is finished, the significance counter SC transmits a final signal fs for controlling the transfer of the PCM word outgoing to the digital output memory DM/out and for resetting the conversion type flip-flop FF/AD. The D to A conversion operation needs neither a zero pulse sp, step pulses nor a final signal, fs. Furthermore its type flip-flop for generating the type signal cDA and controlling of said notification unit NU/AD is replaced by a D to A single-shot element SSE/DA which generates a &#34;1&#34; state during the direct D to A conversion phase. A doubling protection means is not needed and the interruption unit consists of an AND gate G15 which in the doubling and interruption case generates a repetition signal rs which replaces the above-mentioned interruption and continuing signals. While the significance counter SC and the approximation register AR are used only for the AD conversion operations no result memory is needed. When the significance counter SC receives the repetition signal rs the next following step pulse entails no significant value reduction. In this way the preferential D to A conversion takes over an already begun A to D conversion time interval and the interrupted approximation step is repeated in the following time interval. 
     According to FIG. 5 the step pulses sp are obtained by means of a clock frequency multiple which is generated by the clock pulse generator PG/AD so that each timing pulse tAD/in coincides with a step pulse. 
     If the codec equipment shown in FIG. 5 is to be controlled by means of the second embodiment second control unit, the A to D conversion type is allotted to the type designation 1 and the clock pulse generator PG/AD is again used for generating the timing pulses t1 coinciding with a step pulse. The delay device DD is constituted suitably of a counter started by means of the timing pulses t1 and stepped by means of the step pulses sp. The counter is provided with two outputs, the activations of which achieve the delay times dt1 and dt2. The designation 2 in FIG. 3 is allotted the D to A conversions which, without zero pulses and final signals, are controlled by means of a D to A single-shot element which replaces the conversion type flip-flop FF2.