An embodiment of the present invention includes a technique to calibrate receiver and transmitter in a communication system. N digitized samples I(n) and Q(n) are stored. The N digitized samples represent in-phase and quadrature (I-Q) components, respectively, of a down-converted signal from a receiver. The I-Q components are generated from a quadrature demodulator or modulator having I-Q imbalance. Phase and gain adjustment constants are computed from the N digitized samples to compensate for the I-Q imbalance using a closed form solution.