The present invention relates generally to digital systems, and specifically to a system and method for mitigating frequency mismatch in a receiver system.
A received analog signal, such as a frequency modulated (FM) audio signal, can be received and decoded at a receiver system. The receiver system can sample the analog signal at a fixed rate that can be converted to a required sampling rate before being transmitted from a digital interface, such as an integrated interchip sound (I2S) interface. The digital interface sampler can convert the audio samples sampled at a given sampling frequency to a given supported output frequency. As an example, the samples can be read by a host device (e.g., a host codec) at a rate that is different from the sampling frequency of the digital interface sampler. This can happen due to the relative frequency error between frequency references (e.g., reference crystals). This causes mismatch in the read and write rates and causes overflow or underflow of the digital data samples, such as in a first-in first-out (FIFO) buffer. The overflow and/or underflow that can occur based on the frequency reference mismatches can cause degradation of signal-to-noise ratio (SNR) of the resulting digital signal.
One embodiment of the invention includes a receiver system. The system includes a receiver that generates digital data samples corresponding to an analog signal at a sampling frequency associated with a first frequency reference and a host codec that reads the digital data samples at a read frequency associated with a second frequency reference. The system also includes a first-in first-out (FIFO) buffer that buffers the digital data samples via write commands associated with the receiver and read commands associated with the host codec. The FIFO buffer can have a current pointer state that is based on the relative write and read commands. The system further includes a frequency controller that calculates a frequency offset between the sampling frequency and the read frequency based on a rate of drift of the current pointer state relative to a predetermined calibration threshold and adjusts the sampling frequency based on the frequency offset.
Another embodiment of the present invention includes a method for substantially reducing a signal-to-noise ratio of a received audio signal. The method includes generating digital data samples corresponding to the received audio signal and writing the digital data samples to a FIFO buffer via write commands at a sampling frequency associated with a first frequency reference. The method also includes reading the digital data samples from the FIFO buffer via read commands associated with a host codec at a read frequency associated with a second frequency reference, the FIFO buffer having a current pointer state that is based on the relative write and read commands. The method also includes calculating a frequency offset between the sampling frequency and the read frequency reference based on an amount of time taken for the current pointer state to achieve a predetermined calibration threshold. The method further includes adjusting the sampling frequency to maintain the current pointer state within a predetermined pointer state range based on the frequency offset.
Another embodiment of the present invention includes an audio receiver system. The system includes a receiver configured to generate digital data samples corresponding to a received audio signal at a sampling frequency associated with a first frequency reference and a host codec configured to read the digital data samples at a read frequency associated with a second frequency reference based on an integrated interchip sound (I2S) interface. The system also includes a first-in first-out (FIFO) buffer configured to buffer the digital data samples via write commands associated with the receiver and read commands associated with the host codec. The FIFO buffer can have a current pointer state that is based on the relative write and read commands. The system further includes a calibration component configured to determine a difference count value corresponding to a difference between relative occurrence of write commands and read commands, to calculate a frequency offset between the sampling frequency and the read frequency reference based on calculating a number of write commands until a predetermined calibration threshold is reached from the current pointer state based on the difference count value, and to adjust the sampling frequency based on the frequency offset.
The present invention relates generally to digital systems, and specifically to a system and method for mitigating frequency mismatch in a receiver system. The receiver system can include a receiver configured to receive an analog signal, such as an audio signal, and to generate digital data samples via a sampler at a sampling frequency that is based on a first frequency reference. The digital data samples can be written to a first-in first-out (FIFO) buffer via write commands. The digital data samples can be read from the FIFO buffer via read commands associated with a host device, such as a host codec, at a rate that is based on a second frequency reference. As an example, the read commands can be implemented based on an integrated interchip sound (I2S) interface. Therefore, the FIFO buffer can have a current pointer state that is based on the write commands relative to the read commands.
The receiver system can also include a calibration component that is configured to calculate a frequency offset between the sampling frequency and the second frequency reference and to adjust the sampling frequency based on a rate of change of the current pointer state resulting from the frequency offset relative to a predetermined calibration threshold. The calibration component can calculate an average count value that corresponds to a moving block average of a difference between relative occurrence of write commands to the FIFO and read commands from the FIFO. The calibration component can thus compare the average count value to the calibration threshold to determine when to initiate adjustment of the sampling frequency, and to calculate the frequency offset based on determining an amount of time that it took for the current pointer state to reach the calibration threshold based on a sample count value corresponding to a total number of write commands. Thus, the sampling frequency can be changed based on the frequency offset. In addition, the calibration component can be configured to add a digital bias to the calculated frequency offset, such as to move the current pointer state to within optimal thresholds that define an optimal set of pointer states.
The receiver system 10 includes a receiver 12 that receives an analog data signal ANLG. As an example, the analog data signal ANLG can be an audio signal, such as an FM modulated data signal, that is received via a wired connection or a wireless connection (e.g., from an antenna). The receiver 12 includes a digital sampler 14 that is configured to generate digital data samples associated with the analog data signal ANLG. In the example of
The receiver system 10 also includes a codec 20 that can operate as a host device with respect to the receiver 12. The codec 20 is configured to initiate read commands to read the digital data samples from the FIFO buffer 18. As an example, the codec 20 can be configured to initiate the read commands based on an integrated interchip sound (I2S) interface. In the example of
The FIFO buffer 50 is demonstrated in the example of
The FIFO buffer 50 also includes a read pointer RPNTR that is demonstrated in the example of
As a result of the operation of the write pointer WPNTR and the read RPNTR, the FIFO buffer 50 thus operates as a queue to store the digital data samples that are input to the FIFO buffer 50 prior to being read by the codec 20. Therefore, at a given time, the FIFO buffer 50 has a current pointer state that is defined as a difference between a current position of the read pointer RPNTR and a current position of the write pointer WPNTR with respect to the cells 52 of the FIFO buffer 50. Therefore, the current pointer state can be indicative of the number of digital data samples that are currently stored in the FIFO buffer 50.
If the sampling frequency at which the digital sampler 14 generates and provides the digital data samples SMPL_W to the FIFO buffer 50 is approximately the same as the read frequency at which the codec 20 reads the digital data samples SMPL_R from the FIFO buffer 50, then the current pointer state will not substantially change over time. However, a mismatch sampling frequency and the read frequency will result in a gradual drift of the current pointer state in one of a positive or negative direction. For example, if the sampling frequency is greater than the read frequency, then the current pointer state will drift in a positive direction (i.e., toward the cell “F”), which can result in an overflow of the digital data packets, such that one or more of the digital data packets can be dropped from the FIFO buffer 50 before it is read by the codec 20. Similarly, if the sampling frequency is less than the read frequency, then the current pointer state will drift in a negative direction (i.e., toward the cell “0”), which can result in an underflow of the digital data packets, such that one or more of the digital data packets is skipped by the codec 20. Such overflow and/or underflow of the digital data packets can result in a reduction of signal-to-noise ratio (SNR) of the resulting signal that is decoded by the codec 20, with the reduction in SNR being proportional to the magnitude of the frequency mismatch between the sampling frequency and the read frequency.
The FIFO buffer 50 also includes a predetermined pointer state D/2, a high bias threshold THHB, a high calibration threshold THHC, a low bias threshold THLB, and a low calibration threshold THLC. In the example of
The high bias threshold THHB, demonstrated at the cell “9”, and the low bias threshold THLB, demonstrated at the cell “5”, can define a range of cells 52 within which the current pointer state (e.g., the read pointer in the example of
The high calibration threshold THHC, demonstrated at the cell “C”, and the low calibration threshold THLC, demonstrated at the cell “2”, can be associated with respective maximum and minimum acceptable cells 52 that define a risk of overflow or underflow, respectively, of the FIFO 50. As an example, the high and low calibration thresholds THHC and THLC can correspond to relative predetermined or programmable offset values corresponding to an offset from an initial pointer state, such as the current pointer state from initialization of the receiver system 10 (e.g., the predetermined pointer state D/2), or the current pointer state after a calibration procedure. Thus, in the example of
If the current pointer state (e.g., the read pointer in the example of
Referring back to the example of
As a result, the receiver system 10 can substantially mitigate degradation of SNR for a receiver system with non-uniform frequency references with respect to both the receiver 12 and the host device (i.e., the codec 20). In addition, as described in greater detail herein, the calibration of the receiver system 10 to set the calibration frequency to be approximately equal to the read frequency can be interrupt based, such that it may only be performed when necessary. The receiver system 10 can thus dynamically track frequency changes efficiently and at lower power, as opposed to receiver systems that implement a common frequency reference for the receiver and host device. Furthermore, as described in greater detail herein, by maintaining the current pointer state of the FIFO buffer 18 approximately near the predetermined pointer state D/2, the receiver system 10 can be substantially resistant to substantially instantaneous sample jitters.
In the example of
The calibration component 104 also includes a frequency controller 110. At initialization of the frequency controller 110, the frequency controller 110 can be loaded with a default frequency offset of zero PPM. After operation of the receiver system 100 commences, the up/down counter 106 provides the average count value 109 to the frequency controller 110 via a signal AVG_VL and a total sample count value corresponding to the total write commands to the frequency controller 110 via a signal SMPL_CNT. In addition, the frequency controller 110 receives the current pointer state, demonstrated in the example of
The frequency controller 110 can be configured to compare the average count value AVG_VL to the threshold, such as one of the high and low calibration thresholds THHC and THLC, directly. For example, the average count value AVG_VL can be compared with the offset value from the initial pointer state (i.e., an offset of +/−5 in the example of
In response to the initiation of a calibration procedure, the frequency controller 110 is configured to calculate a frequency offset corresponding to a difference between the sampling frequency and the read frequency based on the sample count value SMPL_CNT and the current pointer state PNTR. As an example, the frequency controller 110 can determine the number of write commands (i.e., the sample count value SMPL_CNT) that occurred until the average count value AVG_VL reached the threshold, such as one of the high and low calibration thresholds THHC and THLC. Thus, the amount of time corresponding to the sample count value SMPL_CNT can thus correspond to the frequency offset. In the example of
The frequency offset can thus be provided via the feedback signal FDBK that is provided to the receiver 12 to change the sampling frequency of the digital sampler 14 in response to the initiation of the calibration procedure. As an example, the sampling frequency of the digital sampler 14 can be adjusted by an amount that is approximately equal to the frequency offset to substantially mitigate the frequency mismatch between the sampling frequency and the read frequency. In addition, the frequency controller 110 can be configured to move the current pointer state PNTR to within an approximate optimal cell location in the FIFO buffer 102, such as based on adding a digital bias to the frequency offset.
The frequency controller 150 includes a first comparator 152. The first comparator 152 is configured to compare an absolute value of the average count value AVG_VL with a calibration threshold THC. The calibration threshold THC can correspond to both the high calibration threshold THHC and the low calibration threshold THLC arranged equally and oppositely with respect to the predetermined pointer state D/2 in the example of
The frequency controller 150 also includes a frequency offset estimator 154 that is activated in response to the interrupt signal INTRPT. The frequency offset estimator 154 is configured to receive the absolute value of the average count value AVG_VL, the calibration threshold THC, the current pointer state PNTR, and the sample counts SMPL_CNT and to determine an amount of time that has elapsed since a last hardware reset (e.g., previous interrupt initiating calibration procedure, hardware activation, etc.) before the average count value AVG_VL reached the calibration threshold THC. As an example, the rate of drift associated with the current pointer state PNTR can be indicative of the frequency offset in PPM, as indicated by the average count value AVG_VL and the sample counts value SMPL_CNT. As an example, the sample counts value SMPL_CNT can define a time interval during which the average count value AVG_VL indicates a drift of the current pointer state with respect to the mismatch between occurrence of a write commands and read commands. Therefore, in response to the interrupt signal INTRPT, a current frequency offset FrequencyOffset between the sampling frequency and the read frequency can be calculated as follows:
FrequencyOffset=Sign*Thresh/Sample Count Equation 1
Accordingly, based on the sampling frequency of the digital sampler 14 and the number of write commands having occurred before the average count value AVG_VL drifted to the calibration threshold THC, the frequency offset estimator 154 can estimate the frequency offset in PPM between the sampling frequency and the read frequency. The frequency offset estimator 154 can thus provide the current frequency offset to the digital sampler 14 via the feedback signal FDBK.
By way of example, after initialization of the calibration procedure, the calibration threshold THC can be reprogrammed as offset from the initial pointer state (i.e., the current pointer state immediately after the calibration procedure), such as to redefine the high and low calibration thresholds THHC and THLC relative to the initial pointer state. Thus, after the calibration procedure, additional calibration can subsequently be performed, such as at each instance of the interrupt signal INTRPT, as described above. As an example, the current frequency offset that is calculated in Equation 1 can be added to a previous frequency offset between the sampling frequency and the read frequency to set the sampling frequency to be approximately equal to the read frequency. The calibration component 100 can thus be programmed with the sufficient configuration information to begin monitoring the relative read and write commands, such as to perform another calibration operation at a later time, if necessary. Accordingly, the calibration component 100 can be configured to correct frequency offset estimation errors and/or changes in the frequency offset.
Upon correction of the sampling frequency by the frequency offset via the feedback signal FDBK, the sampling frequency should thus be approximately equal to the read frequency. As a result, the write commands and the read commands should occur at approximately the same frequency, such that drift of the current pointer state PNTR should be substantially mitigated. However, if the current pointer state PNTR is located in the FIFO buffer 50 at a cell 52 that is near one of the high or low calibration thresholds THHC or THLC after the sampling frequency is adjusted by the frequency offset, the FIFO buffer 50 could still be at risk for an overflow or underflow condition, respectively, or could allow for a triggering of the interrupt signal INTRPT by the first comparator 152. Therefore, the frequency controller 150 can be configured to implement phase correction for the current pointer state PNTR by moving the current pointer state PNTR to within a predetermined pointer state range, such as between the high and low bias thresholds THHB and THLB.
The frequency controller 150 includes a second comparator 156. The second comparator 156 is configured to compare the current pointer state PNTR with both the high bias threshold THHB and the low bias threshold THLB to determine if the current pointer state PNTR is outside of the predetermined pointer state range. If the current pointer state PNTR is greater than the high bias threshold THHB or less than the low bias threshold THLB, then the current pointer state PNTR is not within the predetermined pointer state range. In response, the second comparator 156 is configured to generate a digital bias, demonstrated in the example of
As an example, the second comparator 156 can continuously monitor the current pointer state PNTR relative to both the high and low bias thresholds THHB and THLB, such that the digital bias BIAS can be deactivated or reset upon the current pointer state PNTR being less than the high bias threshold THHB or greater than the low bias threshold THLB. As another example, the digital bias BIAS can be deactivated upon the current pointer state PNTR being approximately equal to the predetermined pointer state D/2 or a range of cells around the predetermined pointer state D/2 that is more narrow than the range of cells between the high and low bias thresholds THHB and THLB. The magnitude of the digital bias BIAS static, or can be based on the comparison of the current pointer state PNTR with the high and low bias thresholds THHB and THLB, such that the digital bias BIAS can have a magnitude that is proportional to the distance of the current pointer state PNTR from the predetermined pointer state D/2. Furthermore, as yet another example, in response to activation of or conclusion of the phase correction of the current pointer state PNTR, the calibration threshold THC can be reprogrammed as corresponding to offsets from the current pointer state either during or after conclusion of the phase correction. Accordingly, the phase correction of the current pointer state PNTR can ensure that the FIFO buffer 50 continuously operates more efficiently within the predetermined pointer state range.
It is to be understood that the receiver systems 10 and 100, the FIFO buffer 50, and the frequency controller 150 are not intended to be limited to the examples of
In view of the foregoing structural and functional features described above, a methodology in accordance with various aspects of the present invention will be better appreciated with reference to
At 208, a frequency offset between the sampling frequency and the read frequency is calculated based on an amount of time taken for the current pointer state to achieve a predetermined calibration threshold. The frequency offset can be based on determining a count value associated with a difference between write commands and read commands over the time interval. Therefore, an amount of time, such as a corresponding to a number of write commands at the sampling frequency, which the current pointer state drifted to a threshold can be determined. At 210, the sampling frequency is adjusted to maintain the current pointer state within a predetermined pointer state range based on the frequency offset. The maintaining of the current pointer state to between the optimal thresholds can also be based on a digital bias that is added to the frequency offset to move the current pointer state toward the predetermined pointer state.
What have been described above are examples of the invention. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the invention, but one of ordinary skill in the art will recognize that many further combinations and permutations of the invention are possible. Accordingly, the invention is intended to embrace all such alterations, modifications, and variations that fall within the scope of this application, including the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
3157/CHE/2011 | Sep 2011 | IN | national |