# Patent

## Title
Method and apparatus for estimating and correcting gain and phase imbalance in a code division multiple access system

## Abstract

Gain and phase imbalance is estimated by using an IQ-swapped spreading sequence in addition to a regular spread pilot signal. The IQ-swapped spreading sequence is the spreading sequence whose real and imaginary components are the imaginary and real components of the regular spreading sequence. The gain imbalance can be estimated by a function of the difference between the real component of a regular despread pilot signal and the imaginary component of the IQ-swapped pilot signal. In a similar fashion, the phase imbalance is estimated by a function of the difference between the imaginary component of a regular despread pilot signal and the real component of the IQ-swapped despread pilot signal. A controller such as a DSP (102) uses the gain and phase imbalance estimates to control a gain and phase correction circuit (104). In one embodiment, the correction circuit (104) includes a plurality of multipliers (202–212) and a ROM look-up-table (202) in order to perform the imbalance correction.

## Background
TECHNICAL FIELD
This invention relates in general to the field of radio communications and more specifically to a method and apparatus for estimating and correcting the gain and phase imbalance in a Code Division Multiple Access (CDMA) system.
BACKGROUND
In next generation wireless devices, the direct conversion or Zero Intermediate Frequency (ZIF) architecture is the preferred radio architecture. Direct conversion techniques not only allow for flexible channel spacing and multi-band operation, with filtering performed at baseband. But more importantly, it does not require some components that increase the overall size of a transceiver, particularly those components associated with IF filtering.
The practical implementation of a ZIF radio is by no means trivial. There are a number of design problems associated with the architecture. One of the problems is the amplitude and phase mismatch, also known as IQ (In-phase and quadrature) imbalance problem, in the two arms of a quadrature demodulator. Although this IQ imbalance problem also exists in the superheterodyne receiver, it is more problematic in the direct conversion receiver because the direct conversion receiver requires high baseband gain. The IQ imbalance distorts the received signal quality by introducing additional noise to the signal and confusing receiver signal processing functions such as channel estimation and automatic frequency control.
In a CDMA or spread spectrum communication system based on a direct sequence, it is not trivial to estimate the IQ imbalance because a CDMA signal is very weak compared to ambient interference or noise. And because the receiver sequence despreading operation scrambles the IQ imbalance vector. One prior art approach has used a decision-directed adaptive algorithm in the receiver to correct the distortion of the signal constellation. While a second prior art approach uses a plurality of phase-demodulating ports to oversample the signal in the phase domain. By measuring the correlation among those phase-oversampled signals, the receiver can correct the IQ imbalance by signal reconstruction. Both of these approaches are not designed for direct sequence CDMA signals. In a CDMA system, a spread spectrum signal has a very low signal-to-noise ratio, and the prior art approaches based on adaptive schemes are not robust enough and not usable. These mentioned prior art approaches also add extra cost and/or introduce noise to the system. A need thus exist in the art for a method and apparatus for estimating and correcting the gain and phase imbalance that can overcome some of the problems mentioned above.



BRIEF DESCRIPTION OF THE DRAWINGS
The features of the present invention, which are believed to be novel, are set forth with particularity in the appended claims. The invention, may best be understood by reference to the following description, taken in conjunction with the accompanying drawings, in the several figures of which like reference numerals identify like elements, and in which:
FIG. 1 shows a block diagram of a receiver in accordance with the invention.
FIG. 2 shows a gain and phase correction block in accordance with the invention.
FIG. 3 shows a graph showing mean of the gain offset estimator versus true gain offset.
FIG. 4 shows a graph showing mean of the phase offset estimator versus true phase offset.



DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT
While the specification concludes with claims defining the features of the invention that are regarded as novel, it is believed that the invention will be better understood from a consideration of the following description in conjunction with the drawing figures.
This invention presents a method and apparatus for compensating for the IQ imbalance in a direct sequence CDMA systems by digital signal processing and thus enabling the direct conversion receiver to convert a spread spectrum passband signal to a clean digital baseband signal without incurring much extra noise. This invention eases the IQ offset requirement on RF and analog chips and lowers the cost of a mobile receiver.
Most CDMA systems provide a pilot signal. This invention estimates the gain and phase imbalance by monitoring the constellation of the despread pilot signal because despreading gives processing gain and boosts up the quality of the pilot signal. The pilot constellation is distorted by the gain and phase imbalance. The despread pilot signal is not however sufficient to determine both gain and phase imbalance because the receiver is not aware of the actual pilot strength or amplitude. Given this, the present invention uses the IQ-swapped spreading sequence in addition to the regular spread pilot. The IQ-swapped spreading sequence is the spreading sequence whose real and imaginary components are the real and imaginary components of the regular spreading sequence as shown in the attached figure. As proved in the attached sheet, the gain imbalance can be estimated by a function of the real component of the pilot symbol despread by the normal spreading sequence and the imaginary component of the pilot symbol despread by the IQ-swapped spreading sequence. In a similar fashion, the phase imbalance can be estimated by a function of the pilot symbol despread by the normal sequence and the pilot symbol despread by the IQ-swapped spreading sequence.
Since the IQ imbalance varies extremely slowly, in the preferred embodiment a communication receiver 100 as shown in FIG. 1 includes a controller such as a digital signal processor 102 that averages or filters the estimates over a long period in order to get a good measurement. The digital signal processor 102 uses the estimates to control the correction block 104 using gain and phase error control signals 106. In the preferred embodiment, the correction block 104 performs four real multiplications in essence implementing a 2-by-2 matrix.
Receiver 100 includes an radio frequency and analog front-end section 108 and a digital baseband section 110. The front-end section 108 includes a direct conversion receiver block 112 and an analog-to-digital (A/D) converter 114 which converts the analog output from the direct conversion receiver block 112 and outputs digital signals to the digital baseband section 110 as known in the art.
Gain/Phase Imbalance Correction
To write the quadrature modulation and demodulation concisely, we can represent a complex envelope as a two-dimensional column vector containing the real and imaginary components. Then the CDMA signal spread by a complex spreading sequence at the transmitter baseband output can be represented by the following matrix equation. Here we ignore the channelization code (w) of the pilot signal without loss of generality.

x=Sd,





  x
  =
  
    [
    
      
        
          
            x
            I
          
        
      
      
        
          
            x
            Q
          
        
      
    
    ]
  




is the transmitted chip signal,





  S
  =
  
    [
    
      
        
          
            p
            I
          
        
        
          
            -
            
              p
              Q
            
          
        
      
      
        
          
            p
            Q
          
        
        
          
            p
            I
          
        
      
    
    ]
  




is the spreading sequence matrix, pI and PQ are the real and imaginary part of the complex spreading sequences,





  d
  =
  
    [
    
      
        
          
            d
            I
          
        
      
      
        
          
            d
            Q
          
        
      
    
    ]
  




is the data symbol. For the pilot,





  d
  =
  
    
      [
      
        
          
            1
          
        
        
          
            0
          
        
      
      ]
    
    .
  




The received signal is corrupted by a fading channel and interference.

y=Cx+n, 





  y
  =
  
    [
    
      
        
          
            y
            I
          
        
      
      
        
          
            y
            Q
          
        
      
    
    ]
  




is the received signal,





  C
  =
  
    a
    ⁡
    
      [
      
        
          
            
              cos
              ⁢
              
                
              
              ⁢
              φ
            
          
          
            
              
                -
                sin
              
              ⁢
              
                
              
              ⁢
              φ
            
          
        
        
          
            
              sin
              ⁢
              
                
              
              ⁢
              φ
            
          
          
            
              cos
              ⁢
              
                
              
              ⁢
              φ
            
          
        
      
      ]
    
  




is the fading channel response matrix, a is the channel gain, φ is the channel phase rotation, and n is the interference.

The quadrature demodulator introduces dc offset and gain and phase offset. The real and imaginary parts of the quadrature demodulator output are denoted as follows:





  
    
      y
      dI
    
    =
    
      
        
          g
          I
        
        ⁢
        
          cos
          ⁢
          
            (
            
              -
              
                θ
                2
              
            
            )
          
        
        ⁢
        
          y
          I
        
      
      +
      
        
          g
          I
        
        ⁢
        
          sin
          ⁢
          
            (
            
              -
              
                θ
                2
              
            
            )
          
        
        ⁢
        
          y
          Q
        
      
      +
      
        o
        I
      
    
  
  ,








  
    y
    dQ
  
  =
  
    
      
        g
        Q
      
      ⁢
      
        cos
        ⁢
        
          (
          
            
              π
              2
            
            +
            
              θ
              2
            
          
          )
        
      
      ⁢
      
        y
        I
      
    
    +
    
      
        g
        Q
      
      ⁢
      
        sin
        ⁢
        
          (
          
            
              π
              2
            
            +
            
              θ
              2
            
          
          )
        
      
      ⁢
      
        y
        Q
      
    
    +
    
      
        o
        Q
      
      .
    
  




This quadrature demodulator operation can be represented concisely by the following matrix equation.

yd=ΓΦ(y+o)




  
    Φ
    =
    
      
        Φ
        ⁡
        
          (
          
            θ
            2
          
          )
        
      
      =
      
        
          1
          
            
              cos
              ⁢
              
                θ
                2
              
            
            -
            
              sin
              ⁢
              
                θ
                2
              
            
          
        
        ⁡
        
          [
          
            
              
                
                  cos
                  ⁢
                  
                    θ
                    2
                  
                
              
              
                
                  
                    -
                    sin
                  
                  ⁢
                  
                    θ
                    2
                  
                
              
            
            
              
                
                  
                    -
                    sin
                  
                  ⁢
                  
                    θ
                    2
                  
                
              
              
                
                  cos
                  ⁢
                  
                    θ
                    2
                  
                
              
            
          
          ]
        
      
    
  




  
    Γ
    =
    
      [
      
        
          
            
              g
              I
            
          
          
            0
          
        
        
          
            0
          
          
            
              g
              Q
            
          
        
      
      ]
    
  



Here





  o
  =
  
    [
    
      
        
          
            o
            I
          
        
      
      
        
          
            o
            Q
          
        
      
    
    ]
  




is the DC offset vector, θ is the phase splitter error and gI, gQ are the gains of the real and imaginary components, respectively. For symmetry, the phase splitter error has been distributed equally between I and Q channels. For power conservation, let us assume

gI2+gQ2=2

We can define the gain ratio γ and gain imbalance ε as





  
    γ
    =
    
      
        g
        I
      
      
        g
        Q
      
    
  
  ,
  
    ɛ
    =
    
      γ
      -
      1
    
  




Then, we can represent each gain in terms of γ:





  
    
      g
      I
    
    =
    
      γ
      ⁢
      
        
          2
          
            1
            +
            
              γ
              2
            
          
        
      
    
  
  ,
  
    
      g
      Q
    
    =
    
      
        
          2
          
            1
            +
            
              γ
              2
            
          
        
      
      .
    
  




Now in order to overcome the fading channel represented by a matrix C, the digital signal processor 102 in the receiver corrects the channel phase rotation φ and amplifies the amplitude by the channel gain a, after despreading. Note that other types of weighting than scaling by the channel gain can be used to improve the performance. The quadrature despreading and the channel phase correction and weighting can be represented as

CTSTyd=CTSTΓΦ(CSd+n+o).

Then, ignoring the DC offset (o=0) and assuming the unit channel gain (a=1), we can represent the receiver output yd with the overall system matrix H as follows:

yd=Hd+m, m=CTSTΓΦn, 




  
    
      H
      =
      
        
          
            C
            T
          
          ⁢
          
            S
            T
          
          ⁢
          ΓΦ
          ⁢
          
            
          
          ⁢
          CS
        
        =
        
          
            
              g
              I
            
            ⁢
            
              R
              ⁡
              
                (
                
                  -
                  
                    θ
                    2
                  
                
                )
              
            
          
          +
          
            
              g
              Q
            
            ⁢
            
              R
              ⁡
              
                (
                
                  θ
                  2
                
                )
              
            
          
          +
          
            
              p
              I
            
            ⁢
            
              
                p
                Q
              
              ⁡
              
                [
                
                  
                    
                      
                        
                          
                            (
                            
                              
                                g
                                I
                              
                              +
                              
                                g
                                Q
                              
                            
                            )
                          
                          ⁢
                          sin
                          ⁢
                          
                            θ
                            2
                          
                        
                        -
                        
                          
                            (
                            
                              
                                g
                                I
                              
                              -
                              
                                g
                                Q
                              
                            
                            )
                          
                          ⁢
                          cos
                          ⁢
                          
                            θ
                            2
                          
                        
                      
                    
                  
                  
                    
                      
                        
                          
                            -
                            
                              (
                              
                                
                                  g
                                  I
                                
                                -
                                
                                  g
                                  Q
                                
                              
                              )
                            
                          
                          ⁢
                          cos
                          ⁢
                          
                            θ
                            2
                          
                        
                        -
                        
                          
                            (
                            
                              
                                g
                                I
                              
                              +
                              
                                g
                                Q
                              
                            
                            )
                          
                          ⁢
                          sin
                          ⁢
                          
                            θ
                            2
                          
                        
                      
                    
                  
                
                ]
              
            
          
        
      
    
    ,
    
      

    
    ⁢
    and
  




  
    
      
    
    ⁢
    
      
        R
        ⁡
        
          (
          θ
          )
        
      
      =
      
        [
        
          
            
              
                cos
                ⁢
                
                  
                
                ⁢
                θ
              
            
            
              
                
                  -
                  sin
                
                ⁢
                
                  
                
                ⁢
                θ
              
            
          
          
            
              
                sin
                ⁢
                
                  
                
                ⁢
                θ
              
            
            
              
                cos
                ⁢
                
                  
                
                ⁢
                θ
              
            
          
        
        ]
      
    
  



Note that m is colored noise. If n has white spectrum with variance n0, the covariance matrix of m is equal to

Δm=n0Γ2ΦΦT.

Then, if pI and pQ are uncorrelated as in typical systems, the average value of the despread pilot is given by





  
    
      
        α
        =
        
          
            E
            ⁡
            
              [
              
                H
                ⁡
                
                  [
                  
                    
                      
                        1
                      
                    
                    
                      
                        0
                      
                    
                  
                  ]
                
              
              ]
            
          
          =
          
            
              [
              
                
                  
                    
                      
                        (
                        
                          
                            g
                            I
                          
                          +
                          
                            g
                            Q
                          
                        
                        )
                      
                      ⁢
                      cos
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                
                
                  
                    
                      
                        (
                        
                          
                            g
                            I
                          
                          -
                          
                            g
                            Q
                          
                        
                        )
                      
                      ⁢
                      sin
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                
              
              ]
            
            .
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        1
      
    
  




On the other hand, for the I/Q swapped spreading sequence, the overall system can be represented by the following:

ys=Hsd+m, m=CTSsTΓΦn 




  
    
      H
      s
    
    =
    
      
        
          C
          T
        
        ⁢
        
          S
          s
          T
        
        ⁢
        ΓΦ
        ⁢
        
          
        
        ⁢
        CS
      
      =
      
        
          
            -
            
              g
              I
            
          
          ⁢
          
            
              R
              s
            
            ⁡
            
              (
              
                θ
                2
              
              )
            
          
        
        +
        
          
            g
            Q
          
          ⁢
          
            
              R
              s
            
            ⁡
            
              (
              
                -
                
                  θ
                  2
                
              
              )
            
          
        
        +
        
          
            p
            I
          
          ⁢
          
            
              p
              Q
            
            ⁡
            
              [
              
                
                  
                    
                      
                        (
                        
                          
                            g
                            I
                          
                          +
                          
                            g
                            Q
                          
                        
                        )
                      
                      ⁢
                      cos
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                  
                    
                      
                        -
                        
                          (
                          
                            
                              g
                              I
                            
                            -
                            
                              g
                              Q
                            
                          
                          )
                        
                      
                      ⁢
                      sin
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                
                
                  
                    
                      
                        (
                        
                          
                            g
                            I
                          
                          -
                          
                            g
                            Q
                          
                        
                        )
                      
                      ⁢
                      sin
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                  
                    
                      
                        (
                        
                          
                            g
                            I
                          
                          +
                          
                            g
                            Q
                          
                        
                        )
                      
                      ⁢
                      cos
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                
              
              ]
            
          
        
      
    
  




  
    
      
    
    ⁢
    
      
        S
        s
      
      =
      
        [
        
          
            
              
                p
                Q
              
            
            
              
                -
                
                  p
                  I
                
              
            
          
          
            
              
                p
                I
              
            
            
              
                p
                Q
              
            
          
        
        ]
      
    
  



is the I/Q-swapped spreading sequence matrix,





  
    
      R
      s
    
    ⁡
    
      (
      θ
      )
    
  
  =
  
    [
    
      
        
          
            sin
            ⁢
            
              
            
            ⁢
            θ
          
        
        
          
            cos
            ⁢
            
              
            
            ⁢
            θ
          
        
      
      
        
          
            cos
            ⁢
            
              
            
            ⁢
            θ
          
        
        
          
            
              -
              sin
            
            ⁢
            
              
            
            ⁢
            θ
          
        
      
    
    ]
  




Then, the average of the pilot despread by the I/Q-swapped spreading sequence is given by





  
    
      
        β
        =
        
          
            E
            ⁡
            
              [
              
                
                  H
                  s
                
                ⁡
                
                  [
                  
                    
                      
                        1
                      
                    
                    
                      
                        0
                      
                    
                  
                  ]
                
              
              ]
            
          
          =
          
            
              [
              
                
                  
                    
                      -
                      
                        (
                        
                          
                            g
                            I
                          
                          +
                          
                            g
                            Q
                          
                        
                        )
                      
                    
                  
                  
                    
                      sin
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                
                
                  
                    
                      -
                      
                        (
                        
                          
                            g
                            I
                          
                          -
                          
                            g
                            Q
                          
                        
                        )
                      
                    
                  
                  
                    
                      cos
                      ⁢
                      
                        
                      
                      ⁢
                      
                        θ
                        2
                      
                    
                  
                
              
              ]
            
            .
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        2
      
    
  




From equation (1) and (2), we can express the estimation of mismatch in gain and phase as





  
    
      
        
          
            γ
            ^
          
          =
          
          ⁢
          
            
              
                g
                I
              
              
                g
                Q
              
            
            =
            
              
                
                  α
                  I
                
                -
                
                  β
                  Q
                
              
              
                
                  α
                  I
                
                +
                
                  β
                  Q
                
              
            
          
        
        ,
      
    
  
  
    
      
        
          θ
          ^
        
        =
        
        ⁢
        
          
            
              2
              ⁢
              
                
              
              ⁢
              
                tan
                
                  -
                  1
                
              
              ⁢
              
                α
                Q
              
            
            -
            
              
                β
                I
              
              
                
                  α
                  I
                
                -
                
                  β
                  Q
                
              
            
          
          =
          
            
              -
              2
            
            ⁢
            
              
            
            ⁢
            
              tan
              
                -
                1
              
            
            ⁢
            
              
                
                  
                    α
                    Q
                  
                  +
                  
                    β
                    I
                  
                
                
                  
                    α
                    I
                  
                  +
                  
                    β
                    Q
                  
                
              
              .
            
          
        
      
    
  




Based on the estimated γ and θ, the gain and phase correction block in FIG. 1 implements the following matrix multiplication.





  
    X
    ⁡
    
      (
      
        γ
        ,
        θ
      
      )
    
  
  =
  
    
      
        Φ
        
          -
          1
        
      
      ⁢
      
        Γ
        
          -
          1
        
      
    
    =
    
      
        
          Φ
          ⁡
          
            (
            
              -
              
                θ
                2
              
            
            )
          
        
        ⁢
        
          Γ
          
            -
            1
          
        
      
      =
      
        
          
            1
            /
            
              g
              Q
            
          
          
            
              cos
              ⁡
              
                (
                
                  θ
                  /
                  2
                
                )
              
            
            +
            
              sin
              ⁡
              
                (
                
                  θ
                  /
                  2
                
                )
              
            
          
        
        ⁡
        
          [
          
            
              
                
                  
                    cos
                    ⁡
                    
                      (
                      
                        θ
                        /
                        2
                      
                      )
                    
                  
                  γ
                
              
              
                
                  sin
                  ⁡
                  
                    (
                    
                      θ
                      /
                      2
                    
                    )
                  
                
              
            
            
              
                
                  
                    sin
                    ⁡
                    
                      (
                      
                        θ
                        /
                        2
                      
                      )
                    
                  
                  γ
                
              
              
                
                  cos
                  ⁡
                  
                    (
                    
                      θ
                      /
                      2
                    
                    )
                  
                
              
            
          
          ]
        
      
    
  




ŷd=Xyd

This method lends itself well to the Rake receiver wherein multiple demodulator output are phase-corrected, weighted and combined. A channel estimation algorithm provides an estimation of the channel gain and phase rotation. Each demodulator with index i is associated with a pair of the pilot symbol despread by a normal spreading sequence and the pilot symbol despread by the I/Q-swapped spreading sequence: αi and βi. Then, the maximal ratio combining is applied to each despread pilot pair (αi, βi) from F demodulators:




  
    α
    =
    
      
        
          ∑
          
            f
            =
            1
          
          F
        
        ⁢
        
          
        
        ⁢
        
          α
          i
        
      
      =
      
        [
        
          
            
              
                α
                I
              
            
          
          
            
              
                α
                Q
              
            
          
        
        ]
      
    
  
  ,
  
    β
    =
    
      
        
          ∑
          
            f
            =
            1
          
          F
        
        ⁢
        
          
        
        ⁢
        
          β
          i
        
      
      =
      
        
          [
          
            
              
                
                  β
                  I
                
              
            
            
              
                
                  β
                  Q
                
              
            
          
          ]
        
        .
      
    
  




This maximal ratio combining increases the reliability of the gain and phase mismatch estimation in the presense of multipath fading channel.

The proposed method can be simplified in some applications. For instance, in a closed-loop controlled gain/phase correction wherein only the sign/polarity of the gain/phase error matters, the following signals can be used for driving the error control loop:

{circumflex over (γ)}e=αI−βQ,

{circumflex over (θ)}e=αQ+βI.

Furthermore, the proposed method can be implemented in an iterative way. The gain/phase mismatch estimation relies upon a correct channel estimation while the channel estimation in turn is degraded by the gain/phase mismatch. First, a raw channel estimation is used to estimate the gain/phase mismatch. The gain/phase mismatch is corrected according to the initial estimation. After the correction, the channel response now can be estimated with a better accuracy. Then, the gain/phase mismatch can be estimated with a better accuracy by the improved channel estimation. In this iterative fashion, the gain/phase estimation can be made robust to the channel estimation error.
In an actual implementation of the correction block as shown in FIG. 2, the common gain part can be omitted and the sinusoid can be generated by a look-up table 202. Look-up table 202 can reside in a Read-Only Memory (ROM) or other storage device. The gain and phase correction circuit 104 includes first 120 and second 122 input ports, and four multipliers 202–208 and two adders 210–212. A storage device such as a read-only memory (ROM) 202 has four output ports 214, 216, 218, 220 that provide the correct sinusoid to the respective multipliers 202, 204, 206 and 208, responsive to receiving the estimate signal for the gain 222 and phase 224 imbalance. The corrected I signal 124 is provided on a first output port, while the corrected Q signal 126 is provided in a second ouput port.
In FIG. 3, there is shown a graph showing the mean of the estimator (20*log10E[{circumflex over (γ)}]) versus the true gain offset for a 100 pilot symbol simulation. While FIG. 4 shows a graph highligtening the mean of the phase offset estimator (E[{circumflex over (θ)}]) for a 100 pilot symbol.
While the preferred embodiments of the invention have been illustrated and described, it will be clear that the invention is not so limited. Numerous modifications, changes, variations, substitutions and equivalents will occur to those skilled in the art without departing from the spirit and scope of the present invention as defined by the appended claims.

## Claims

1. A circuit, comprising:
a direct conversion receiver coupled to receive a radio frequency signal and produce an analog signal;
an analog to digital converter coupled to receive the analog signal and produce baseband digital input signals having real and imaginary components; and
a digital baseband circuit, comprising:
first and second input ports for receiving the digital input signals; and
a controller coupled to the first and second input ports for estimating the gain and phase imbalance of the digital input signals, wherein the controller estimates the gain mismatch as;





  
    
      -
      
        γ
        ^
      
    
    =
    
      
        
          g
          I
        
        
          g
          Q
        
      
      =
      
        
          
            α
            I
          
          -
          
            β
            Q
          
        
        
          
            α
            I
          
          +
          
            β
            Q
          
        
      
    
  
  ,




where gI, gQ are the gains of the real and imaginary components of the digital input signals, αI is a pilot symbol despread by a normal spreading sequence and βQ is the pilot symbol despread by an IQ-swapped spreading sequence.

2. A digital baseband circuit as defined in claim 1, wherein the controller comprises a digital signal processor.

3. A digital baseband circuit as defined in claim 1, wherein the controller estimates the phase mismatch as:




  
    
      θ
      ^
    
    =
    
      
        2
        ⁢
        
          
        
        ⁢
        
          tan
          
            -
            1
          
        
        ⁢
        
          
            
              α
              Q
            
            -
            
              β
              I
            
          
          
            
              α
              I
            
            -
            
              β
              Q
            
          
        
      
      =
      
        
          -
          2
        
        ⁢
        
          
        
        ⁢
        
          tan
          
            -
            1
          
        
        ⁢
        
          
            
              α
              Q
            
            +
            
              β
              I
            
          
          
            
              α
              I
            
            +
            
              β
              Q
            
          
        
      
    
  
  ,



wherein αI and αQ are pilot symbols despread by a normal spreading sequence and βI and βQ are pilot symbols despread by an I/Q-swapped spreading sequence.

4. A digital baseband circuit as defined in claim 1, further comprising:
a gain and phase correction circuit coupled to the first and second input ports.

5. A digital baseband circuit as defined in claim 4, wherein the gain and phase correction circuit includes first and second multipliers coupled to the first input port and third and fourth multipliers coupled to the second input port.

6. A digital baseband circuit as defined in claim 5, wherein the gain and phase correction circuit further comprises a look-up-table coupled to the first, second, third and fourth multipliers.

7. A digital baseband circuit as defined in claim 6, wherein the look-up-table comprises a read-only memory (ROM).

8. A digital baseband circuit as defined in claim 4, wherein the controller estimates the phase mismatch as:




  
    
      θ
      ^
    
    =
    
      
        2
        ⁢
        
          
        
        ⁢
        
          tan
          
            -
            1
          
        
        ⁢
        
          
            
              α
              Q
            
            -
            
              β
              I
            
          
          
            
              α
              I
            
            -
            
              β
              Q
            
          
        
      
      =
      
        
          -
          2
        
        ⁢
        
          
        
        ⁢
        
          tan
          
            -
            1
          
        
        ⁢
        
          
            
              α
              Q
            
            +
            
              β
              I
            
          
          
            
              α
              I
            
            +
            
              β
              Q
            
          
        
      
    
  
  ,



wherein αI and αQ are pilot symbols despread by a normal spreading sequence and βI and βQ are pilot symbols despread by an I/Q-swapped spreading sequence; and
the gain and phase correction circuit uses phase and gain estimates to provide a gain and phase correction to the digital input signals.

9. A digital baseband circuit as defined in claim 8, wherein the gain and phase correction circuit applies correction to the digital input signals using the formula:




  
    X
    ⁡
    
      (
      
        γ
        ,
        θ
      
      )
    
  
  =
  
    
      
        
          1
          /
          
            g
            Q
          
        
        
          
            cos
            ⁡
            
              (
              
                θ
                /
                2
              
              )
            
          
          +
          
            sin
            ⁡
            
              (
              
                θ
                /
                2
              
              )
            
          
        
      
      ⁡
      
        [
        
          
            
              
                
                  cos
                  ⁡
                  
                    (
                    
                      θ
                      /
                      2
                    
                    )
                  
                
                γ
              
            
            
              
                sin
                ⁡
                
                  (
                  
                    θ
                    /
                    2
                  
                  )
                
              
            
          
          
            
              
                
                  sin
                  ⁡
                  
                    (
                    
                      θ
                      /
                      2
                    
                    )
                  
                
                γ
              
            
            
              
                cos
                ⁡
                
                  (
                  
                    θ
                    /
                    2
                  
                  )
                
              
            
          
        
        ]
      
    
    .

10. A method for estimating a gain and phase imbalance of digital signals in a direct sequence code division multiple access system, comprising the steps of:
estimating the gain imbalance as follows:





  
    
      γ
      ^
    
    =
    
      
        
          g
          I
        
        
          g
          Q
        
      
      =
      
        
          
            α
            I
          
          -
          
            β
            Q
          
        
        
          
            α
            I
          
          +
          
            β
            Q
          
        
      
    
  
  ,




where gI, gQ are the gains of a real component and an imaginary component of the digital input signals, αI is a pilot symbol despread by a normal spreading sequence and βQ is the pilot symbol despread by an I/Q-swapped spreading sequence; and
estimating the phase imbalance as follows:





  
    
      θ
      ^
    
    =
    
      
        2
        ⁢
        
          
        
        ⁢
        
          tan
          
            -
            1
          
        
        ⁢
        
          
            
              α
              Q
            
            -
            
              β
              I
            
          
          
            
              α
              I
            
            -
            
              β
              Q
            
          
        
      
      =
      
        
          -
          2
        
        ⁢
        
          
        
        ⁢
        
          tan
          
            -
            1
          
        
        ⁢
        
          
            
              α
              Q
            
            +
            
              β
              I
            
          
          
            
              α
              I
            
            +
            
              β
              Q
            
          
        
      
    
  
  ,




where αI and αQ are pilot symbols despread by a normal spreading sequence and βI and βQ are pilot symbols despread by an I/Q-swapped spreading sequence.

11. A method as defined in claim 10, further comprising the step of: using the gain and phase imbalance estimates to correct for the gain and phase imbalance in the digital signals, using the formula:




  
    X
    ⁡
    
      (
      
        γ
        ,
        θ
      
      )
    
  
  =
  
    
      
        
          1
          /
          
            g
            Q
          
        
        
          
            cos
            ⁡
            
              (
              
                θ
                /
                2
              
              )
            
          
          +
          
            sin
            ⁡
            
              (
              
                θ
                /
                2
              
              )
            
          
        
      
      ⁡
      
        [
        
          
            
              
                
                  cos
                  ⁡
                  
                    (
                    
                      θ
                      /
                      2
                    
                    )
                  
                
                γ
              
            
            
              
                sin
                ⁡
                
                  (
                  
                    θ
                    /
                    2
                  
                  )
                
              
            
          
          
            
              
                
                  sin
                  ⁡
                  
                    (
                    
                      θ
                      /
                      2
                    
                    )
                  
                
                γ
              
            
            
              
                cos
                ⁡
                
                  (
                  
                    θ
                    /
                    2
                  
                  )
                
              
            
          
        
        ]
      
    
    .

12. A method as defined in claim 11, wherein the correction of the gain and phase imbalance is performed by a gain and phase correction circuit having a plurality of multipliers, and a look-up-table providing the plurality of multipliers gain and phase offset correction information based on gain and phase imbalance information.

13. A method of estimating an amplitude mismatch in a receiver, comprising the steps of:
(a) determining a real component of a pilot signal despread by a regular sequence;
(b) determining an imaginary component of the pilot signal despread by an I/Q-swapped spreading sequence; and
(c) finding a difference between the real component of the pilot signal despread by the regular sequence and the imaginary component of the pilot signal despread by the I/Q-swapped spreading sequence.

14. A method as defined in claim 13, wherein steps (a) and (b) are performed by a correlator.

15. A method as defined in claim 14, wherein step (c) is performed by a digital signal processor.

16. A method of estimating a phase mismatch in a receiver, comprising the steps of:
(a) determining an imaginary component of a pilot signal despread by a regular sequence;
(b) determining a real component of the pilot signal despread by an I/Q swapped spreading sequence; and
(c) finding the difference between the imaginary component of the pilot signal despread by the regular sequence and the real component of the pilot signal despread by the I/Q swapped spreading sequence.

17. A method as defined in claim 16, wherein steps (a) and (b) are performed by a correlator.

18. A method as defined in claim 17, wherein step (c) is performed by a digital signal processor.