Method and apparatus for generating or utilizing one or more cycle-swallowed clock signals

An electronic device is provided for generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals. The device includes a module configured to receive a first clock signal having a first frequency. The module is configured to generate a second clock signal having a second frequency and configured to swallow one or more clock cycles of the first clock signal in generating the second clock signal. The first clock signal has even cycles, and the second clock signal has uneven cycles. The first frequency is greater than the second frequency. The module may include a cycle-swallowing counter. A method and a computer-readable medium are also provided.

BACKGROUND

The subject technology relates generally to electronic devices and clock generation or utilization, and more specifically to methods and apparatus for generating or utilizing one or more cycle-swallowed clock signals.

One approach to generate all of the clock signals needed in modern electronic devices is to employ different phase-locked loops (PLLs) for different clocks, or one PLL for the least-common multiple of the desired clock frequencies as a reference so that one can obtain each of the desired clock signals using frequency dividers. This is impractical from the area/power standpoint. Furthermore, reference frequencies may drift as a result of a frequency drift of a crystal oscillator, temperature variations, and/or supply voltage variations, leading to non-integer division ratios, which are difficult to implement.

SUMMARY

In one aspect of the disclosure, an electronic device is provided for generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals. The device comprises a module configured to receive a first clock signal having a first frequency. The module is configured to generate a second clock signal having a second frequency and configured to swallow one or more clock cycles of the first clock signal in generating the second clock signal. The first clock signal has even cycles, and the second clock signal has uneven cycles. The first frequency is greater than the second frequency.

In a further aspect of the disclosure, an electronic device is provided for generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals. The device comprises a cycle-swallowing counter configured to be clocked by a first clock signal having a first frequency. The cycle-swallowing counter is configured to generate a second clock signal having a second frequency and configured to swallow one or more clock cycles of the first clock signal in generating the second clock signal. The first frequency is greater than the second frequency.

In yet a further aspect of the disclosure, a method is provided for generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals. The method comprises receiving a first clock signal having a first frequency and generating a second clock signal having a second frequency. The first clock signal has even cycle, the second clock signal has uneven cycles, and the second frequency is less than the first frequency. The generating comprises swallowing one or more clock cycles of the first clock signal.

In yet a further aspect of the disclosure, an electronic device is provided for generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals. The electronic device comprises means for receiving a first clock signal having a first frequency and means for generating a second clock signal having a second frequency. The first clock signal has even cycles, the second clock signal has uneven cycles, and the second frequency is less than the first frequency. The means for generating comprises means for swallowing one or more clock cycles of the first clock signal.

In yet a further aspect of the disclosure, a computer-readable medium comprises instructions executable by a processing system in an electronic device. The instructions comprise code for determining a content of a cycle-swallowing counter and determining a second series of data resampled from a first series of data. The second series of data is determined based on the content of the cycle-swallowing counter. The cycle-swallowing counter is configured to receive a first clock signal having a first frequency, configured to generate a second clock signal having a second frequency, and configured to swallow one or more clock cycles of the first clock signal in generating the second clock signal. The second series of data is clocked by the first clock signal, if the first series of data is clocked by the second clock signal, and the second series of data is clocked by the second clock signal, if the first series of data is clocked by the first clock signal. The content of the cycle-swallowing counter is determined based on the first and second frequencies.

DETAILED DESCRIPTION

FIG. 1is an exemplary block diagram of a configuration of a communications system100. The communications system100may include a first access terminal120a, a second access terminal120b, and a third access terminal120c.

An access terminal may be any suitable electronic device such as a wireless telephone, a wired telephone, a laptop computer, a desktop computer, a personal digital assistant (PDA), a data transceiver, a modem, a pager, a camera, a game console, an MPEG Audio Layer-3 (MP3) player, a media gateway system, an audio communications device, a video communications device, a multimedia communications device, a component of any of the foregoing devices (e.g., a printed circuit board(s), an integrated circuit(s), or a circuit component(s)), or any other electronic device. An access terminal may be referred to by those skilled in the art as a handset, wireless communications device, wireless telephone, cellular telephone, wired communications device, wired telephone, user terminal, user equipment, mobile station, mobile unit, subscriber unit, subscriber station, wireless station, mobile radio, radio telephone, or some other terminology.

InFIG. 1, the first access terminal120amay be a wireless telephone, the second access terminal120bmay be a wired telephone, and the third access terminal120cmay be a media gateway system according to one aspect. The communications system100may further include a circuit-switched (CS) domain130, an Internet Protocol multimedia subsystem (IMS) domain150, and a public switched telephone network (PSTN)160. The IMS domain150may overlap with a wide area network (WAN)140, such as the Internet.

The CS domain130may include a base station132, and the IMS domain150may include an access point152. The third access terminal120cmay be included in the CS domain130. Each of the CS domain130and the IMS domain150may also include other well known components for transmitting, receiving and processing signals or other electronic devices, but they are not shown to avoid obscuring the concepts described herein. The access terminal120bmay be connected to the PSTN160or a cable modem (not shown) and coupled to the CS domain130, the IMS domain150, and the WAN140.

A CS domain may be, for example, a cellular domain. A CS domain may support a cellular communications network such as second-generation wireless or cellular technologies (2G), third-generation wireless or cellular technologies (3G), fourth-generation wireless or cellular technologies (4G), cellular code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division multiple access (TDMA), frequency division multiple access (FDMA), orthogonal frequency division multiple access (OFDMA), CDMA 2000 EV-DO, CDMA 2000 1XRTT, Global System for Mobile Communications (GSM), Ultra Mobile Broadband (UMB), or any other suitable cellular technologies. A CS domain130may also support a wired communications network in conjunction with a cellular communications network.

An IMS domain may support a wireless communications network such as a wide area network (WAN), a wireless local area network (WLAN), World Interoperability for Microwave Access (WiMAX), wireless fidelity (Wi-Fi), Institute for Electrical and Electronic Engineers (IEEE) 802.11, Bluetooth-based Wireless Personal Area Network (WPAN), ultra-wideband (UWB), Long Term Evolution (LTE), home radio frequency (HomeRF), or any other suitable wireless communications network. An IMS domain150may also support a wired communications network (e.g., a wired local area network (LAN)) in conjunction with a wireless communications network.

The first access terminal120amay communicate with the second access terminal120busing the CS domain130or the IMS domain150. When the first access terminal120auses the CS domain130, the first access terminal120amay utilize the base station132, which allows the first access terminal120ato communicate with devices within the CS domain130and devices connected to the CS domain130(e.g., the second access terminal120b). When the first access terminal120auses the IMS domain150, it may utilize the access point152, which allows the first access terminal120ato communicate with devices within the IMS domain150and devices connected to the IMS domain150(e.g., the second access terminal120b). While the communications system100has been illustrated with one CS domain and one IMS domain, the communication system100may include multiple CS domains, multiple IMS domains, multiple base stations, multiple access points, multiple PSTNs and/or additional access terminals.

Each of the CS domain130, the IMS domain150, the PSTN160, and the WAN140may include one or more electronic devices. Each of the base station132and the first, second and third access terminals120a,120b, and120cmay be an electronic device or may include multiple electronic devices.

FIG. 2is a conceptual block diagram illustrating an example of an electronic device. An electronic device200includes a processing system202, which is capable of communication with a receiver206and a transmitter208through a bus204or other structures or devices. The receiver206may receive signals from an antenna226, and the transmitter208may transmit signals using an antenna228. It should be understood that communication means other than buses can be utilized with the disclosed configurations. The processing system202can generate audio, video, multimedia, and/or other types of data to be provided to the transmitter208for communication. In addition, audio, video, multimedia, and/or other types of data can be received at the receiver206, and processed by the processing system202.

Software programs, which may be stored in the memory210or the processing system202, may be used by the processing system202to control and manage access to the various networks, as well as provide other communication and processing functions. Software programs may also provide an interface to the processing system202for various user interface devices, such as a display212and a keypad214.

The processing system202may be implemented using software, hardware, or a combination of both. By way of example, the processing system202may be implemented with one or more processors. A processor may be a general-purpose microprocessor, a microcontroller, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a programmable logic device (PLD), a controller, a state machine, gated logic, discrete hardware components, or any other suitable device that can perform calculations or other manipulations of information. The processing system202may also include one or more computer-readable media for storing software. Software shall be construed broadly to mean instructions, data, or any combination thereof, whether referred to as software, firmware, middleware, microcode, hardware description language, or otherwise. Instructions may include code (e.g., in source code format, binary code format, executable code format, or any other suitable format of code).

WhileFIG. 2shows two separate antennas226and228, an electronic device may employ one common antenna for both the receiver206and the transmitter208, or may employ multiple antennas (e.g., each or one of the receiver206and the transmitter208may include more than one antenna). An electronic device may also include other components that are not shown inFIG. 2(e.g., peripheral devices) or may include fewer components than what is shown inFIG. 2. The receiver206and the transmitter208may be combined into a transceiver in another configuration. Some of the functions of the processing system202may be performed by one or more of the other blocks shown inFIG. 2, such as the receiver206and the transmitter208, and some of the functions of the receiver206and/or the transmitter208may be performed by one or more of the other blocks, such as the processing system202. The communications system and the electronic device shown inFIGS. 1 and 2are merely examples, and the subject technology may be practiced in other types of communications systems and other devices.

FIG. 3is another conceptual block diagram illustrating an example of an electronic device. An electronic device300includes a cycle-swallowing counter350. It can receive an increment value, R310, as an input. The cycle-swallowing counter350can also receive a source clock signal320, which is used to clock the cycle-swallowing counter350. The cycle-swallowing counter350may provide, as an output, a target clock signal330, which may be generated based on R310and the source clock signal320. The electronic device300may include some or all of the components shown inFIG. 2, or alternatively, the components shown inFIG. 3may be incorporated into some of the components shown inFIG. 2. For example, the cycle-swallowing counter350may be incorporated into the processing system202, the receiver206, the transmitter208, or some combination thereof.

FIG. 4is a conceptual block diagram illustrating an example of a cycle-swallowing counter. The cycle-swallowing counter350may include a counter460, which may be a modulo-N counter, and a cycle-swallowing block470. The counter460can receive R310, can be clocked using the source clock signal320, and can produce a counter output465. The cycle-swallowing block470may swallow (e.g., omit or eliminate) one or more cycles of the source clock signal320and produce the target clock signal330. The operation of a cycle-swallowing counter is described in detail below.

In one aspect of the disclosure, a cycle-swallowing counter provides a novel and simple but powerful mechanism to generate synchronous clocks and data from a source clock signal whose frequency is not harmonically related to the frequencies of the target clock signals (e.g., the desired frequencies). When the frequency of the source clock signal (source frequency) and the frequencies of the target clock signals (target frequencies) are not harmonically related, the source and target frequencies are, for example, not multiples of each other. Multiple target clock signals may be generated from, for example, a single source clock signal, utilizing multiple cycle-swallowing counters. Each cycle-swallowing counter may generate its corresponding target clock signal. The target clock signals may be digital clock signals.

A cycle-swallowing counter can also correct for potential frequency drifts (sometimes referred to as frequency offsets) present in a source clock signal. For example, the frequency of a source clock signal may drift (or change) with time due to a frequency drift of a crystal oscillator. A cycle-swallowing counter may automatically correct for this frequency drift. It should be noted that the subject technology is applicable to a source clock signal that has a frequency drift, to a source clock that potentially has a frequency drift (e.g., a source clock signal whose frequency may potentially drift), as well to a source clock signal that does not have a frequency drift.

A cycle-swallowing counter may also be used to interpolate digital data from one clock domain to another clock domain with arbitrarily high accuracy.

In modern multi-standard and multi-mode transceivers, often integrated on the same chip, the need invariably arises to efficiently generate different target clocking frequencies from sources (or from a single source), which is not (or cannot be) harmonically related to all the target frequencies. The term “multi-standard” may refer to multiple protocols, such as CDMA, GSM, and global positioning system (GPS). The term “multi-mode” may refer to protocols that are the same standard but different versions of the standard that require different clocking frequencies. An example of multi-mode protocols may include WCDMA 1999 and high-speed downlink packet access (HSDPA) 2003.

Baseband processing of signals is most conveniently performed at some integer multiple of the symbol rate. For example, WCDMA baseband circuitry is clocked at K×3.84 MHz, where K can be 2, 4, 8, 16, etc., while in CDMA, the clocks are K×1.2288 MHz, and GSM/EDGE/GPRS baseband circuitry is clocked at L×270.8333 kHz, where L is as high as 96 or sometimes 192.

In one aspect of the disclosure, a cycle-swallowing implementation provides a simple clock generation mechanism that is efficient because it requires simple hardware (e.g., a counter) that can deal with frequency drifts, and that can lend itself naturally to digital data resampling of arbitrarily good quality.

In one aspect of the disclosure, the frequency of a source clock signal (source frequency) is greater than the frequency of a target clock signal (target frequency) (i.e., the source frequency is higher than the target frequency). In other words, ft arg<fsrc, where ftargis the target frequency, and fsrcis the source frequency. This criterion can be easily achieved on practical designs since more than one submultiples of the clock frequencies are usually sought. In another exemplary configuration, the source frequency is greater than the target frequency, but the source frequency is less than twice the target frequency. In yet another exemplary configuration, the source frequency is greater than the target frequency but less than three times the target frequency. It should be noted that these are merely some illustrative examples, and the subject technology is not limited to these examples.

Functionality of Cycle-Swallowing

As shown inFIGS. 3,4, and5, a cycle-swallowing counter350can be clocked by a source clock signal320, and incremented as calculated below (depending on the target frequency). The cycle-swallowing counter350may simply increment at every clock cycle of the source clock signal320(e.g., clock cycle C shown inFIG. 5), and whenever the counter460overflows (turns over), the cycle-swallowing block470can swallow (e.g., omit or eliminate) a clock cycle (or pulse) of the source clock signal320. In other words, a clock pulse (or cycle) from the target clock signal330is swallowed (e.g., omitted or eliminated), as illustrated inFIG. 5. When one or more clock cycles or pulses of a source clock signal are swallowed, this can be viewed as swallowing one or more clock pulses or cycles from a target clock signal.

In one aspect of the disclosure, a target clock signal can be viewed as the same as a source clock signal, but with several cycles or pulses (ticks) missing. A target clock signal may be viewed as a cycle-swallowed clock signal in that one or more clock cycles or pulses are swallowed (e.g., omitted, eliminated or missing). A target clock signal330has the desired target frequency that does not change with time on the average and is thus constant on the average. The target clock signal can also remain synchronous with the source clock signal320, often a very desirable property for maintaining system time. Depending on the cycle-swallowing mechanism, a target clock signal330can maintain accurate average frequency even as the source clock signal320drifts with a frequency-offset. This is important in practical modems, which need to correct for frequency drifts because of crystal oscillator, temperature and/or supply variations. Furthermore, the content of a cycle-swallowing counter350(e.g., the counter output465) at every time is a number that naturally aids a resampling circuit with arbitrarily good resampling performance, depending on design complexity, as described further in detail later.

Referring toFIGS. 3,4, and5, an exemplary operation of a cycle-swallowing counter is illustrated below. Suppose a source clock signal320has a frequency of 100 (fin=100). The unit of frequency is Hertz (e.g., MHz, GHz, kHz), but since units do not affect the analysis, they are not mentioned in this example. Suppose the desired frequency of a target clock signal330is 70 (fout=70). Then, in this example, N=10, M=7, R=N−M=3. In general, N and M may be the integers whose ratio N/M most closely approximates the ratio of the source and target frequencies (fin/fout). In one example, the smallest possible integers that meet the above criteria may be selected for N and M. In another example, the largest possible integers that meet the above criteria may be selected for N and M, and such selection may be beneficial for fine frequency adjustments. A cycle-swallowing counter350prevents R (which is 3 in this example) out of every N (which is 10 in this example) source clock pulses from making it to the target clock signal (i.e., “swallow” R out of every N cycles of the source clock signal).

FIG. 5illustrates a source clock signal320, a counter output465and a target clock signal330. A cycle-swallowing counter350can be incremented by R (which is N−M=3, in this example) at every tick (or every cycle) of the source clock signal320and overflow at N (which is 10 in this example). The target (or output) clock signal can be verified to have an average frequency equal to M/N (which is 70% in this case) of the source frequency.

Therefore, in this exemplary implementation, the cycle-swallowing counter350has an increment of R=3, and overflows at or above the value of N=10, in which case the counter cycles through the values listed inFIG. 5. The counter460may be simply a modulo-N counter, where N=10 in this example. The starting state of the counter460is irrelevant.

In practical exemplary implementation, instead of seeking a pair of integers N and M such that the rational fraction N/M=fin/fout, and then choosing R=N−M, one may implement a 32-bit counter (i.e., choose N=2^32) and then choose

R=round⁢[232·fin-foutfin],
where finis the source or input (available) frequency, and foutis the target (or output) frequency.

An overflow in a cycle-swallowing counter350can be detected in many different ways. One way is to detect an overflow by determining whether the value of the counter output465is less than the increment value (e.g., R=3 in this example). Another way may be to monitor the values of the counter output465and determine that an overflow has occurred when the current value of the counter output465is less than the previous value of the counter output465. These are simply examples, and the subject technology is not limited to these examples.

Frequency Control

Still referring toFIGS. 3,4, and5, according to one aspect of the disclosure, a cycle-swallowing counter350can easily correct the frequency drift of a source clock signal320, resulting in a frequency-stable target clock signal330on the average. In other words, the frequency of a target clock signal330(target frequency) is, on the average, more stable (or better controlled) than the frequency of a source clock signal320(source frequency). For example, assume that a source clock signal320drifts by 10%, such that its frequency becomes 110 (from 100), then a counter460can be programmed to increment by R=4, and to overflow (modulo-N) at N=11, in order to accommodate the source frequency drift. The average target frequency remains constant, for example, at70. In other words, favg out=M/N·fin, where favg outis the average target frequency, finis the source frequency, M is 7 in this case, and N is 10 in this case.

It should be noted that a frequency drift even for 10 parts-per-million (ppm) (0.001%) may affect the operation of an electronic device because, for example, a frequency drift of 10 ppm can cause a signal to drift into an adjacent frequency channel in which the electronic device is not permitted to operate. Thus, a frequency-stable target clock signal may have, for example, much less than 1 ppm in frequency drift (or frequency offset). In certain sensitive applications, such as GPS, the required clock accuracy is such that drift of even 1 part-per-billion (ppb) (which is 0.001 ppm) may negatively impact performance. Thus, for sensitive applications, the frequency drift amount of a frequency-stable target clock signal may be, for example, less than 1 ppb, 0.1 ppb, or 0.001 ppb, or even less. These frequency drift amounts described above are merely examples, and the subject technology is not limited to these examples.

The frequency drift in a target clock signal can reach zero if an automatic frequency control (AFC) module can estimate the frequency drift in the source clock signal accurately. The frequency stability of a target clock signal can depend on how accurately the AFC module can estimate the frequency drift in the source clock signal. If a source clock signal has a frequency drift, then a target clock signal may have a frequency drift that is less than, or much less than, the frequency drift of the source clock signal, or the target clock signal may have nearly a zero frequency drift or no frequency drift. A frequency-stable clock signal may be referred to as an always-frequency-stable clock signal, an accurately-frequency-controlled clock signal, a tightly-frequency-controlled clock signal, and/or an exactly-frequency-controlled clock signal.

According to one aspect of the disclosure, assuming that the frequency offset has been estimated by, for example, an automatic frequency control (AFC) module (see, e.g., AFC module780inFIG. 7), the handling of frequency offset may proceed, in general, as follows.

Assume that the nominal constants N, M, and R have been determined for a nominal pair of source and target frequencies (fin, fout). Now, assume that the AFC mechanism determines that the available frequency finhas drifted by X ppm, so that the actual source (or available) frequency has become: f′in=fin·(1+X·10−6). In this case, all that needs to be reprogrammed in a cycle-swallowing counter350is, for example, reprogramming N and R as N′ and R′, which can be expressed as the following:
Ne=round└N·X·10−6┘
N′=N+Ne
R′=R+Re

It can be shown that changing the nominal constants N, R, in the way shown above, can maintain a constant target frequency out of the cycle-swallowing counter350. In other words, if an estimate of the frequency offset is available, the cycle-swallowing counter350can be reprogrammed and maintain stable target (or output) frequency (eliminating the drift) in a simple and efficient manner.

In one aspect of the disclosure, the potential or actual frequency drift of a source clock signal can be automatically compensated for in a target clock signal. A cycle-swallowing counter may be configured to adaptively or automatically to correct for the frequency drift in the source clock signal when generating the target clock signal. This may be based on one or more estimates of the frequency drift (or offset) derived from an AFC module.

Functionality of Resampling

Now referring toFIGS. 3-6, in one aspect of the disclosure, a cycle-swallowing counter350can be used to resample data (e.g., digital data). This is possible because the counter content (e.g., a counter output465) at any clock interval can represent the fractional time difference between the ticks of a hypothetical ideal target clock signal630having frequency fout(which is not available) and the ticks of the source clock signal320having frequency fin. Effectively, the content of the cycle-swallowing counter350divided by the overflow limit (N),

τn={3,6,9,2,5,8,1,4,7,0}10,
at any given time can provide the fraction of a hypothetical ideal target clock period Tout=1/fout, by which the source clock signal320ticks (arriving regularly, with period Tin=1/fin) would be displaced, as illustrated inFIG. 6. This is very useful for digital data resampling, because it can establish the timing relationship between the clock signals of existing and desirable (resampled) data.

Still referring toFIGS. 3-6, an exemplary resampling operation is illustrated. In this example, assume again fin=1/Tin=100 and fout=70. Then, as described above, a target clock signal330produced by a cycle-swallowing counter350has an average frequency of fout=70, but its period is uneven and may vary between Tin(unswallowed source clock period) and 2·Tin(swallowed source clock period). However, if an ideal target clock signal630with fout=70 existed, it would tick every

Tout=1/70=107·Tin=NM·Tin
units of time. These hypothetical ticks of the ideal target clock signal630would be displaced from the regular (every Tin) ticks of the source clock signal320by the fractions of Toutindicated by τnabove, as shown inFIG. 6. Furthermore, digital data clocked at the ticks of a real target clock signal330can be viewed as clocked at the ticks of the hypothetical ideal target clock signal630, as there is a one-to-one correspondence (or mapping) between them. The real target clock signal330and the ideal target clock signal630have identical average frequency fout.

Knowledge of the contents of the cycle-swallowing counter350(e.g., τ) enables interpolation of arbitrarily good quality, as the timing relationships between the available (or original) data and interpolated data are exactly known from the contents of the counter c[n] (interpreted as fractions,

FIG. 6illustrates the above example. In one aspect, there is a one-to-one correspondence (or mapping) between the ideal (non-existent) target clock signal630and the real target clock signal330. Using the counter contents c[n] (e.g., a counter output465) to identify the relative positions in time of available data and desired (or interpolated) data, one can perform any interpolation (e.g., linear, polynomial, or any other).

Interpolation can be performed in either direction knowing only the contents c[n] of the cycle-swallowing counter350. Two exemplary processes are described below.(1) Resample data clocked by (or riding on) a real target clock signal330to data clocked by (or riding on) a source target clock signal320. Data clocked by the real target clock signal330can be viewed as data clocked by (or riding on) the ticks of the hypothetical ideal target clock signal630. This resampling process may occur during a data transmission operation—for example, resampling digital data prior to sending the data to a digital-to-analog converter (DAC) clocked by an even-clocking-cycle, but potentially frequency-offset source clock signal. An exemplary resampling operation is illustrated inFIG. 7. In a transmit baseband processor770, data may be originally clocked by a real target clock signal330. A resampler760may resample the data clocked by the real target clock signal330to data clocked by a source clock signal320. This data may then be sent to a DAC740clocked by the source clock signal320. As described above, a target (cycle-swallowed) clock signal330may have uneven cycles but can be automatically frequency controlled, thereby eliminating the effects of frequency offset present in a source clock signal320.(2) Resample data clocked by (or riding on) an even-cycled but potentially frequency-offset source clock signal320to data clocked by (or riding on) an uneven-cycled, cycle-swallowed but “accurately-frequency-controlled” target clock signal330. While the interpolator design may differ, the timing information needed for interpolation can be provided (e.g., solely) by the contents of a cycle-swallowing counter350. This resampling process may occur during a data receiving operation—for example, resampling data after an analog-to-digital conversion operation is performed by an analog-to-digital converter (ADC), which may require even clocking to avoid spurs and is clocked by an even-cycle, but potentially frequency-offset source clock signal. An exemplary resampling operation is illustrated inFIG. 8. After an ADC840, which is clocked by a source clock signal320, performs an analog-to-digital conversion, a resampler860may resample data clocked by the source clock signal320to data clocked by a target clock signal330.

In one aspect of the disclosure, even cycles may refer to, for example, clock cycles of a signal that have an approximately equal time duration, or clock cycles of a signal in which the time elapsed between any two consecutive ticks of the signal is approximately constant. In another aspect, even cycles may have time-varying frequency drift. In yet another aspect, even cycles may have time-varying frequency drift, where the amount of drift per cycle is substantially less than the duration of the cycle. In yet another aspect, the frequency of a signal having even cycles may vary slowly. In yet another aspect, even cycles may refer to, for example, approximately even cycles. In one aspect of the disclosure, uneven cycles may refer to, for example, clock cycles of a signal that have one or more unequal time intervals between certain consecutive ticks of the signal. In another aspect, when a second signal is generated by, or based on, swallowing (e.g., omitting or eliminating) one or more cycles of a first signal, then the second signal can be viewed as having uneven cycles. In yet another aspect, uneven cycles may refer to, for example, substantially uneven cycles. Resampling data can be sometimes referred to as translating, transforming, or converting data.

Exemplary Interpolation of Data: Linear Interpolation

In one aspect of the disclosure, an exemplary linear interpolation of data in both directions using the contents of a cycle-swallowing counter is illustrated below. The functionality of the cycle-swallowing and linear interpolation relationships can be described in the following pseudo-code.

For Every Tick of a Source Clock Signal:

n := n+1;// this index is not cycle-swallowed, original (source) clockc[n] = (c[n−1] + R) modulo N;if( c[n] > c[n−1])// if the counter has not overflownm := m+1;// no cycle-swallowing, target clock signal must tickendif// otherwise, the counter overflowed, cycle is swallowedif x-data is available and y-data is desired:// resample data from trgt_clk to src_clk, i.e., from target clock signal tosource clock signaly⁡[n]=x⁡[m]·(1-c⁡[n]N)+x⁡[m-1]·c⁡[n]N;elseif y-data is available and x-data is desired:// resample data from src_clk to trgt_clk, i.e., from source clock signal totarget clock signalx⁡[m]=y⁡[n-1]·(1-c⁡[n-1]M)+y⁡[n]·c⁡[n-1]M;endifendfor

The values N, M and R in the pseudo code shown above may be N, M and R as described above with reference toFIGS. 3,4and5, where the average target frequency may be M/N of the source frequency. n may be the index of a source clock signal320, m may be the index of a target clock signal330, y[n] may be the data clocked by (or riding on) on the source clock signal320, and x[m] may be the data clocked by (or riding on) the target clock signal330.

Referring back to the exemplary operation shown inFIG. 6, if data is resampled from a first clock domain (e.g., the source clock signal320) into a second clock domain (e.g., the target clock signal330), then data is clocked by the clock signal of the second clock domain (e.g., the target clock signal330) after the resampling. In addition, the data in the second clock domain may be determined from the data in the first clock domain by performing a linear (or any other) interpolation between two adjacent data in the first clock domain as follows: For example, the datum at the first tick of the source clock signal320may appear as the datum at the first tick of the target clock signal330. The datum at the second tick and the datum at the third tick of the source clock signal320may be used to linearly interpolate the datum at the second tick of the target clock signal330. The datum at the third tick and the datum at the fourth tick of the source clock signal320may be used to linearly interpolate the datum at the third tick of the target clock signal330. The datum at the fifth tick and the datum at the sixth tick of the source clock signal320may be used to linearly interpolate the datum at the fourth tick of the target clock signal330. Because there is an overflow at the fifth tick of the source clock signal320, no interpolation is performed between the datum at the fourth tick and the datum at the fifth tick of the source clock signal320. The pseudo-code presented above illustrates this operation.

If data is resampled from a second clock domain (e.g., the target clock signal330) into a first clock domain (e.g., the source clock signal320), then data is clocked by the clock signal of the first clock domain (e.g., the source clock signal320) after the resampling. In addition, the data in the first clock domain may be determined from the data in the second clock domain by performing a linear interpolation between two adjacent data in the second clock domain. The pseudo-code presented above illustrates this operation.

The linear interpolation operation described above is just one exemplary scheme and can be implemented with only one multiplier in hardware according to one exemplary configuration. It should be noted that multiple multipliers and/or other components may be utilized in another configuration. In one aspect, the timing relationship between ticks of a source clock signal (even-period, but potentially with frequency-offset) and ticks of a target clock signal with the desired average frequency (even corrected for frequency-offset) can be provided by the contents of the cycle-swallowing counter c[n] at any point in time. In one aspect, this timing information is the only pre-requisite for any interpolation method. In another aspect, other information can be used as pre-requisite for an interpolation method.

Interpolation techniques other than linear interpolation (e.g., polynomial or other non-linear techniques) can be pursued at the expense of, for example, higher complexity. Such other interpolation techniques may be performed based on the contents of a cycle-swallowing counter (e.g., c[n], τ). Such techniques may also be based on data at two or more adjacent or non-adjacent ticks of the clock signal from which the data is being resampled. For example, data from more than two ticks of a first clock signal from which the data is being resampled can be used to determine the resampled datum at a given tick of a second clock signal. In this case, a delay can be added so that data from more than two ticks can be collected. These are merely some examples, and the subject technology may utilize other interpolation schemes.

Utilization of a Cycle-Swallowed Clock Signal in Transmit or Receive Operation

FIG. 7is a conceptual block diagram illustrating an example of a hardware configuration for an electronic device utilizing a cycle swallowing counter for resampling data during a transmit operation. An electronic device700may include an amplifier (AMP)710, a mixer720, an analog anti-aliasing filter (AAF)730, a digital-to-analog converter (DAC)740, a resampler760, a transmit baseband processor770, and a cycle-swallowing counter350. The resampler760may include an interpolator765configured to interpolate data using the contents of the cycle-swallowing counter350. The interpolator765may be linear or non-linear. The resampler760may resample a series of data from one clock domain to another clock domain.

In the transmit baseband processor770, data may be clocked by a target clock signal330. The resampler760may receive a source clock signal320and a target clock signal330. The resampler760may receive the data from the transmit baseband processor770and resample the data clocked by the target clock signal330to data clocked by a source clock signal320. The data outputted by the resampler760may be sent to the DAC740, which is clocked by the source clock signal320. The signal output from the DAC740may be sent to the analog AAF730, the mixer720(where the signal is mixed with a transmit local oscillator (TxLO) signal and up-converted) and then to the AMP710. The signal may then be transmitted to another electronic device outside the electronic device700using, for example, the antenna228shown inFIG. 2.

The electronic device700may include some or all of the components shown inFIG. 2, or alternatively, the components shown inFIG. 7may be incorporated into some of the components shown inFIG. 2. For example, the cycle-swallowing counter350inFIG. 7may be incorporated into the processing system202, the transmitter208, or some combination thereof. The AMP710, the mixer720, the analog AAF730, and the DAC740may be implemented in the transmitter208. The resampler760and the transmit baseband processor770may be implemented in the processing system202, the transmitter208, or some combination thereof.

FIG. 8is a conceptual block diagram illustrating an example of a hardware configuration for an electronic device utilizing a cycle swallowing counter for resampling data during a receive operation. An electronic device800may include a low noise amplifier (LNA)810, a mixer820, an analog anti-aliasing filter (AAF)830, an analog-to-digital converter (ADC)840, a digital lower pass filter (LPF)850, a resampler860, a receive baseband processor870, an automatic frequency control (AFC) module880, and a cycle-swallowing counter350. The resampler860may include an interpolator865configured to interpolate data using the contents of the cycle-swallowing counter350. The interpolator865may be linear or non-linear.

The LNA810may receive a signal from an electronic device outside the electronic device800through an antenna such as the antenna226inFIG. 2. The signal may be then mixed down by the mixer820using a receive local oscillator (RxLO). The signal may be sent to the analog AAF830and then to the ADC840, which is clocked by a source clock signal320. The output of the ADC840may be sent to the digital LPF850. The resampler860may then take the data clocked by the source clock signal320and convert it to data clocked by a target clock signal330. The data clocked by the target clock signal330may be processed by the receive baseband processor870using the target clock signal330. The resampler860may the source clock signal320and the target clock signal330.

The AFC module880may detect the frequency drift, and in response to the detection, the AFC module880may estimate the amount of the frequency drift in the source clock signal320. The estimated information may be sent to a processor (e.g., a processing block in the processing system202inFIG. 2) that can generate values N′ and R′ described above. The cycle-swallowing counter350inFIG. 8may receive values N, M and R, or values N′, M and R′. In addition, the cycle-swallowing counter350inFIG. 7for the transmit operation may receive values N, M and R, or values N′, M and R′. The values N′ and R′ are derived from the estimated information generated by the AFC module880inFIG. 8. The process described in this paragraph may be performed automatically. In one aspect, the AFC module880may automatically determine the amount of the frequency drift in the source clock signal320.

The electronic device800may include some or all of the components shown inFIG. 2, or alternatively, the components shown inFIG. 8may be incorporated into some of the components shown inFIG. 2. For example, the cycle-swallowing counter350inFIG. 8may be incorporated into the processing system202, the receiver206, or some combination thereof. The LNA810, the mixer820, the analog AAF830, and the ADC840may be implemented in the receiver206. The digital LPF850, the resampler860, the receive baseband processor870, and the AFC module880may be implemented in the processing system202, the receiver206, or some combination thereof.

FIGS. 7 and 8illustrate exemplary utilization of a cycle-swallowed target clock signal and the associated resampling operation in a transmitter and in a receiver. In these exemplary operations, at least two clock domains are maintained: one is an analog clock domain for analog processing (e.g., using a source clock signal320), and one is a digital clock domain for digital processing (e.g., using a target clock signal330). The source clock signal320may have even-clocking-cycles but may tend to drift in frequency with time. The target clock signal330may have uneven-clocking-cycles due to clock pulse (or clock cycle) swallowing but may be tightly frequency controlled. That a target clock signal has uneven clock cycles does not affect baseband processing or digital processing if the integrity of the data is maintained at the resampler760and860. The integrity of data can be maintained by, for example, utilizing a data interpolation scheme described above. That a target clock signal can be accurately frequency controlled (no drifting) is a highly desirable property. As discussed above, a target clock signal can be accurately frequency controlled based on information, for example, from the automatic frequency control (AFC) module880shown inFIG. 8.

It should be noted that the subject technology may have multiple clock domains (e.g., more than two clock domains), where each clock domain has a different clock frequency. In one example, there may be one or more analog clock domains and one or more digital clock domains.

According to one aspect of the disclosure, a simple and efficient mechanism is provided with a cycle-swallowing counter that can generate a frequency or frequencies of one or more desired clock signals that are not necessarily harmonically related to the frequency or frequencies of the one or more available source clock signals. In another aspect, a cycle-swallowing counter can be utilized to generate a frequency or frequencies of one or more target clock signals that are (or can be) harmonically related to the frequency or frequencies of the one or more source clock signals. In such a case, the cycle-swallowing operation can be viewed as a frequency division.

In yet another aspect, a cycle-swallowing mechanism may be viewed as a mechanism that enables generation of a second clock domain (which is, for example, frequency-controlled, but with possibly uneven cycles) from a first clock domain (which is, for example, frequency-drifting, but with approximately even-duration clock cycles) and that enables resampling of data (e.g., transition of data) from one clock domain to another clock domain. Each of the clock domains may include one or more clock signals.

In yet another aspect, the constants N and M governing the relationship between the two frequencies can be chosen to approximate any frequency arbitrarily well, and to correct any frequency drift (frequency offset). In one aspect, a cycle-swallowing counter may be used to transform a source clock signal that tends to drift in frequency into an accurately frequency controlled target clock signal such that the target clock signal is more frequency stable than the source clock signal. The source frequency may be, for example, not less than the target frequency. Furthermore, the contents of a cycle-swallowing counter can support arbitrarily good digital data interpolation. A cycle-swallowing counter described herein may be very useful for the efficient design of modern multi-mode and multi-standard transceivers (possibly integrated) using a single frequency source for all target clock signals needed.

According to one aspect, very simple digital circuitry (e.g., a suitable counter) may be used to radically reduce the complexity and to derive clocking rates that are multiples of different fundamental symbol rates (and thus harmonically unrelated), as happens in modern multi-mode, multi-standard transceivers, which are becoming increasingly common in the marketplace. This multi-mode clock generation utilizing a cycle-swallowing counter can easily correct for frequency drift (or frequency offset) commonly present in clock sources and can aid with seamless digital data resampling from one clock domain to another.

While examples of the constants N and M are described above, it should be noted that N and M may be selected (or pre-selected or predetermined) in many different ways. In this regard, the constant R can be pre-selected or predetermined. As another example for determining N and M, suppose the source frequency is 70 MHz, and the target frequency is 61.44 MHz (i.e., 16×3.84 MHz), then N may be selected to be 7000, and M may be selected to be 6144. As an alternative, N may be selected to be 875, and M may be selected to be 768.

As yet another example for determining N and M, suppose the source frequency is 1,000,001 Hz, and the target frequency is 1,000,000 Hz, then N may be selected to be 1,000,001, and M may be selected to be 1,000,000. In this case, one cycle out of every 1,000,001 cycles is swallowed.

FIGS. 9A and 9Billustrate an exemplary method of generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals according to one aspect of the disclosure. The method may be performed by an electronic device. The method comprises a process910for receiving a first clock signal having a first frequency. The first clock signal has even cycles. The method further comprises a process920for generating a second clock signal having a second frequency. The second clock signal has uneven cycles, and the second frequency is less than the first frequency. The process920comprises a process925for swallowing one or more clock cycles of the first clock signal.

FIG. 10is a conceptual block diagram illustrating an example of an electronic device for generating or utilizing one or more cycle-swallowed clock signals derived based on one or more first clock signals according to one aspect of the disclosure. An electronic device1000comprises a module1010for receiving a first clock signal having a first frequency. The first clock signal has even cycles. The electronic device1000further comprises a module1020for generating a second clock signal having a second frequency. The second clock signal has uneven cycles, and the second frequency is less than the first frequency. The module1020comprises a module1025for swallowing one or more clock cycles of the first clock signal.

Furthermore, the electronic device1000may comprise other components shown inFIG. 7or8. For example, the electronic device1000may comprise a module for interpolating data from a domain of the first clock signal to a domain of the second clock signal (e.g., the resampler860or the interpolator865) or a module for interpolating data from a domain of the second clock signal to a domain of the first clock signal (e.g., the resampler760or the interpolator765).

FIG. 11is a conceptual block diagram illustrating an exemplary computer-readable medium according to one aspect of the disclosure. A computer-readable medium1100comprises instructions executable by a processing system in an electronic device. The instructions comprise code1110for determining a content of a cycle-swallowing counter and code1120for determining a second series of data resampled from a first series of data. The second series of data is determined based on the content of the cycle-swallowing counter. The cycle-swallowing counter is configured to receive a first clock signal having a first frequency, configured to generate a second clock signal having a second frequency, and configured to swallow one or more clock cycles of the first clock signal in generating the second clock signal. The second series of data is clocked by the first clock signal, if the first series of data is clocked by the second clock signal, and the second series of data is clocked by the second clock signal, if the first series of data is clocked by the first clock signal. The content of the cycle-swallowing counter is determined based on the first and second frequencies. In one aspect of the disclosure, code1110and code1120may be implemented in hardware.

Those of skill in the art would appreciate that the various illustrative functions including, for example, blocks, modules, elements, components, methods, and algorithms described herein may be implemented in hardware, software, firmware, or any combination thereof. Various functions may be arranged differently (e.g., arranged in a different order, or partitioned in a different way) all without departing from the scope of the subject technology.

If the functions are implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer.

According to one aspect of the disclosure, a computer-readable medium is encoded or stored with instructions and is a computing element, which defines structural and functional interrelationships between the instructions and the rest of the system, which permit the instructions' functionality to be realized. Instructions may be executable, for example, by an electronic device or by a processor of an electronic device. Instructions can be, for example, a computer program including code. A computer-readable medium may comprise one or more media. The term computer may be understood to include a machine.