Call Search
     

New to Ham Radio?
My Profile

Community
Articles
Forums
News
Reviews
Friends Remembered
Strays
Survey Question

Operating
Contesting
DX Cluster Spots
Propagation

Resources
Calendar
Classifieds
Ham Exams
Ham Links
List Archives
News Articles
Product Reviews
QSL Managers

Site Info
eHam Help (FAQ)
Support the site
The eHam Team
Advertising Info
Vision Statement
About eHam.net

   Home   Help Search  
Pages: [1]   Go Down
  Print  
Author Topic: Implementing phase shift for Image rejection?  (Read 5063 times)
VA2FSQ
Member

Posts: 511




Ignore
« on: January 24, 2014, 05:41:27 PM »

HI,
I know there is a number of algorithms for adjusting the phase relationship between the i and q signals.  I was wondering if it is possible to do so by introducing a sampling delay between the two channels when the audio is digitized?
What other simple techniques could be done?
Thanks
Logged

VA2FSQ
PJ2BVU
Member

Posts: 115




Ignore
« Reply #1 on: January 25, 2014, 06:55:32 AM »

Visit http://dxatlas.com/Dev/

Scroll down to the DSP section, the last item is I/Q Balance Correction which the Delphi (Pascal) source code for automatic estimation and correction of the I/Q balance error in the QSD-based SDR receivers. Part of the Rocky project.
Note: I did not look at it, I just noticed it while looking for something else.

Jean-Claude PJ2BVU
Logged
W6RMK
Member

Posts: 659




Ignore
« Reply #2 on: January 25, 2014, 08:29:29 AM »

Yes you can adjust the timing of the sampling, but that's kind of a pain in most systems, because you tend to drive all the sampling off the same clock (either sampling I/Q simultaneously, or alternately).

You can also do it by implementing a delay (using any of a variety of interpolation schemes) in the digitized path.

One thing you want to decide is if you need a phase shift or a time delay across the audio band. 

If you're compensating for the imperfect 90 degree phase shift in the RF path, over a small band (e.g. a few tens of kHz), the RF phase error is typically fairly constant, so you want a phase shift in the I/Q, which you can adjust as the RF frequency changes (it's hard to keep 90 degree quadrature over a decade bandwidth)

But if you're adjusting for imperfect 90 degrees in the I/Q path (e.g. the low pass filters before the ADC or after the DAC) you probably want something more like an equalizer that adjusts for timing skew (phase shift a linear function of frequency) or filter non-ideal behavior (phaseshift changing rapidly near poles of the filter).  A FIR equalizer is a pretty general solution, depending on the performance you need.

Note that getting 40dB image rejection requires fairly good performance. The phase error has to be less than arcsin(0.01) or 1/2 degree.  The gain balance has to be within 1% for the same reason.
Logged
VA2FSQ
Member

Posts: 511




Ignore
« Reply #3 on: January 25, 2014, 04:29:40 PM »

Hi
Thanks for the answers.
It's not an issue for the amplitude  imbalance, I've got that down as far as I can.  But the phase imbalance is different.
In the software I am using there is the possibility to delay the I or Q by samples, (1 or more) or by milliseconds in the digital domain. I probably need to delay by microseconds, and I'm not sure it will work at that level of granularity although a 1 sample delay at 192kHz is about 5 microseconds.
I also heard that for small imbalances in phase you an inject a very small amount of the Q signal into the I signal.  Not sure how to implement this though.

The interesting thing, is with my software I can get at least 40db down with the Elecraft KX3 using only amplitude balancing.  Using an LP-Pan the best I can do is about 20b.  However, if I do shift the I/Q signals by one sample, then there is another drop of about 10db going from 0 to one.  This implies that perhaps the channels are skewed by 1 sample (sampling at 192kHz), irrespective of an actual phase shift.

Lots of fun and lots of learning!  One wouldn't know an equation to vary the phase for the Q channels by any chance?
Thanks, Tom

Logged

VA2FSQ
W6RMK
Member

Posts: 659




Ignore
« Reply #4 on: January 26, 2014, 10:28:49 AM »

It's not unusual for there to be a timing skew between the channels.  Have you got an oscilloscope or can borrow one?  Play a sinewave through both channels at the same time and it will be instantly obvious.

As far as adding some of I or Q to the other to do a phase shift... that works for a sine wave, where you're sending cos(2*pi*f*t) to I and sin(2*pi*f*t) to Q and you want to shift the phase a bit (e.g. cos(a+b) = cos(a)cos(b)-sin(a)sin(b)... if a is 2*pi*f*t and b is the desired phase shift, you can see that you can get it by adding a bit of I and a bit of Q (e.g. cos(b) of I and sin(b) of Q)

However, it doesn't necessarily work as a general thing for a broadband signal: most systems don't have constant phase error over frequency: they have a time delay (which requires a variable amount of that cos(b),sin(b) term, because phase varies with frequency) or some other non-matched behavior (most often at high or low frequencies, because of component tolerances)

There are fairly simple FIR interpolators that can do a "fractional sample delay".  However, most of them  have a range of delays around half the filter length.  Say you have a filter that is 5 taps long, and you can adjust the taps to make the delay anything between 2 and 3 samples.  So you'll need the same thing in both sides, to match the delays.
Logged
VA2FSQ
Member

Posts: 511




Ignore
« Reply #5 on: January 27, 2014, 07:29:27 PM »

Hi,
Thanks for the answer, but it will take a while to digest.  It's been a while since my physics and math courses...none the less, that never stopped me before.
So as a starting point, would you consider this reference as appropriate?
http://dsp.stackexchange.com/questions/4709/phase-shifting-of-50hz-signal/4715#4715

So apart from the linear interpolation, I would have a pair of fir lowpass interpolators and vary one so as to have fractional time delays?

Thanks, Tom
Logged

VA2FSQ
W6RMK
Member

Posts: 659




Ignore
« Reply #6 on: February 02, 2014, 07:41:32 AM »

Yes. that's one way to do it.

If you look up "interpolators" that might help too..

Do you have an overall latency requirement?  a scheme with FFTs can also work: you take an FFT of the input signal, multiply it by the frequency response (amplitude and phase) you want, then inverse FFT. This might be faster, computationally, but is tricky.

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!