Sound card with out-of-sync samples

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Sound card with out-of-sync samples

Chris_g3wie
I have a Creative SBLive SB0490 USB sound card which samples at 24bit resolution and 96KHz. I find that I'm unable to adjust the image rejection to better than 30 - 35dB across a 80KHz band. Eventually a memory cell fired and I recalled that this is one of those sound cards where the L and R channels are displaced by 1 sample, which could well be the cause. How complex a task is it likely to be to add a sample offset correction option to quisk? (Or should I just go and buy an E-MU0202)

73 Chris g3wie
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

ahlstromjc
Administrator
This is a well known problem, and Quisk has a #define for it: FIX_H101.  See the top of sound_alsa.c.  I have been meaning to put this into the config file, so if you have problems, let me know and I will change the implementation.

Jim
N2ADR
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

Chris_g3wie
Thanks for the information, Jim. Ideally it would be in a config file, but a note in the documentation would probably be sufficient.

I have compiled 3.4.13 both with and without the #define H101 and whilst it makes a difference to the phase adjustment slider positions, it doesn't improve the image rejection which I can sum up as follows:

SBLive sampling at 96K; Softrock 4.9MHz on the IF

Test 1: Adjust phase with image and wanted signal at opposite ends of the display ~70KHz apart, image can be reduced to >-90dB. Change input signal frequency so wanted signal moves to the other end of the display, the image is now -35dB

Test2: Adjust phase with image and wanted signal close to the sound card zero in the display centre so image is >-90dB. Change input signal frequency so it's at either end of the display, the image is now -37dB

Is this what I should expect, given that the correction is for a single frequency?

73 Chris G3WIE
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

ahlstromjc
Administrator
The #define FIX_H101 sets a one sample delay on the Q channel.  Maybe you need a delay on the I channel.  I will make a new version next week with all three options in the config file.

Jim
N2ADR
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

ahlstromjc
Administrator
In reply to this post by Chris_g3wie
Today's new Quisk has a config file option channel_delay to control the one-sample delay.  The old #define FIX_H101 is still implemented for backward compatibility, so to use the new feature, remove the #define.  Then set channel_delay to the channel that needs the delay (probably 0 or 1).  If you are not sure of the channel, reset the amplitude and phase corrections to zero, and try both.

The amplitude correction works by changing the Q amplitude, and the phase correction adds a fraction of Q to I.  Perhaps this should be changed.  Or a variable correction can be implemented in the hardware file.  I am looking into both.

Jim
N2ADR
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

Leigh L. Klotz Jr WA5ZNU
Administrator
ahlstromjc wrote
The amplitude correction works by changing the Q amplitude, and the phase correction adds a fraction of Q to I.  Perhaps this should be changed.  Or a variable correction can be implemented in the hardware file.  I am looking into both.
I've noticed that it's hard to adjust the phase and amplitude parameters in the pop-up dialog.
If you pick a value, restart quisk, and then edit again, it's hard to get back to zero.
Sometimes zero isn't a choice in the steps of the cursor movement.
Perhaps a zero button would make sense.

Leigh/WA5ZNU
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

Chris_g3wie
That was quick, Jim!

Apologies for delay, Nabble seems to have stopped emailing me.

I've just tried 3.4.14:

- with channel_delay = -1    image suppression is as before ie -30 or 35 dB
- with channel_delay = channel_delay_i or channel_delay_q    image suppression is about -5 dB and the phase adjustments make no visible difference out to about +/- 0.3

I reverted to -1 and once phase corrections are reset I can get the previous 30 - 35 dB suppression. Perhaps my sound card hasn't got the delay, after all? If that is the case, should I expect better than 30 - 35dB image suppression?

Chris G3WIE
Reply | Threaded
Open this post in threaded view
|

Query softrock problem...

Chris_g3wie
Before you do anything else, I'm now wondering if this isn't a softrock problem. I tried the Rocky program under bindows as it has a +/- 1 sample adjuster and also calculates and displays the phase/amp corrections on-the-fly. That shows about zero image rejection under all conditions of sample delay correction and doesn't seem to find sensible values for phase/amp correction.

It's not a simple short as (with Quisk) I tried feeding both inputs to the sound card from just the Q o/p from the softrock and I get 0dB image rejection as you'd expect. That's different to what I get with channel_delay = -1 where I can null the image to >70dB over a narrow range and 30 dB elsewhere

I will do some more measurements and see what I come up with. Any ideas in the meantime welcome...

Chris G3WIE

Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

Leigh L. Klotz Jr WA5ZNU
Administrator
In reply to this post by Chris_g3wie
It looks like the SB0490 has been EOL'd.  Is there a replacement?
I'd like to buy one for testing.  There are a few SB0490 for $25-$50 on eBay, but if there's a replacement new item I'd like to investigate that instead.  FWIW I'm not using a Softrock so that would be another data point.

Leigh/WA5ZNU
Reply | Threaded
Open this post in threaded view
|

Re: Query softrock problem...

ahlstromjc
Administrator
In reply to this post by Chris_g3wie
Hi,

I now have an RxTx Ensemble (thanks to Sid Boyce) so now I can participate in these tests.  I used my M-Audio Audiophile 24/96 card with the Ensemble, and I know it needs no sample delay.  I also have a home brew signal generator based on an AD9954.

I set Quisk to a fixed frequency on 40 meters and varied the RF signal from band edge to center.  I could null the image into the noise at any frequency, but when I changed the signal generator frequency, the image came back.  Changing from band edge to center (or vice versa) raised the image to about -50 dB.

Then I remembered that VK6JBL wrote code for Quisk which provides better I/Q balancing.  He is active on the Yahoo SoftRock40 group.  I looked at the code, and it works by varying the correction with VFO frequency.  The code was published as a patch for Quisk, but I don't know its current state.  Since the Quisk VFO does not change in this test, the VK6JBL patch would not help, but it is possible to vary the correction with tuning frequency and wind up with a clean received signal.

Here is a reference on much more complicated I/Q balance corrections:
             http://www.qsl.net/ik1xpv/dsp/pdf/aiqben.pdf

It looks like I should add the VK6JBL code to Quisk, or at least provide hooks to allow others to write more complicated I/Q balance corrections.

Quisk will also require I/Q balance corrections for transmit.  These corrections are different from the receive corrections, and are tedious to make without a spectrum analyzer.  My Anritsu MS2670A died in a power line surge, and I don't know where to get it fixed.

Jim Ahlstrom
N2ADR
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

ahlstromjc
Administrator
In reply to this post by Leigh L. Klotz Jr WA5ZNU
Yes, I have had complaints about the sliders.  I will have a fix for this in the next release.

Jim
N2ADR
Reply | Threaded
Open this post in threaded view
|

SB0490, and image rejection measurement

Chris_g3wie
In reply to this post by Leigh L. Klotz Jr WA5ZNU
I got the SB0490 some while back, so I'm not surprised it's been EOL'd. It was cheap and purports to do 24 bit and 96Ksps.

After my previous post in this thread, I remembered I made another SDR once to take on holiday - a 10MHz Firefly. This has its own detector and I/Q output, so removes the Softrock from the equation. I dug it out just now and tried it with Quisk and also with Rocky. Here's the results. I sampled at 48Ksps as Rocky/bindows doesn't seem to behave as I'd expect at 96K:

With Quisk I get the same results as with the Softrock if/K2 - image rejection of >70 dB at a spot frequency, rising to 30 - 35dB at the other end of the band. Delaying I or Q reduces the rejection effectively to zero.

With Rocky and its auto-correction I get better than 55 dB over a ~40kHz band when sampling at 48K. Delaying I or Q again reduces the rejection to zero.

I then made a rough measure of the frequency span over which uou get better than 40 dB of suppression. In Rocky I did this by clearing its phase measurement table, letting it start its auto-correct and stopping after it had taken a single measurement at a single frequency. In both Quisk and Rocky, this span is about 20KHz

My summary:
- The SB Live 0490 doesn't, after all, have an I - Q sample time delay
- Quisk's image rejection is typical of what you can expect with a single point calibration

Is there any way a table of measured values can be fed back into Quisk to increase the span of good image rejection? The help file mentions this, but in the context of multiband operation

Chris G3WIE
Reply | Threaded
Open this post in threaded view
|

Re: SB0490, and image rejection measurement

Chris_g3wie
... I took a long time to write that last post, measuring as I went, and didn't see the posts from Jim before I hit the Post button.

I'll have a look at the references. I also have a good friend who is far more knowledgeable than I am in DSP at the sort of frequencies we are using here, and will get his views on efficient ways of compensating.

73 Chris G3WIE
Reply | Threaded
Open this post in threaded view
|

Re: SB0490, and image rejection measurement

Leigh L. Klotz Jr WA5ZNU
Administrator
My eBay SB0490 arrived.  It worked right off.  However, I can only get 48KHz sampling.
If I select 96 KHz I get blanks.

The specs say it does 48KHz in 5.1 and 96 KHz in "stereo", but alsamixer doesn't offer such a choice.

Leigh/WA5ZNU
Reply | Threaded
Open this post in threaded view
|

Re: SB0490, and image rejection measurement

Leigh L. Klotz Jr WA5ZNU
Administrator
cat /proc/asound/card2/stream0

I tried hw:2,6 but it froze; only hw:2,0 does doesn't freeze at 96KHz but it gives no data.

Reply | Threaded
Open this post in threaded view
|

Re: SB0490, and image rejection measurement

Chris_g3wie
Hmm, similarly it just worked for me, but also on 96K. I used

name_of_sound_capt = "hw:1"

in ~/quisk_conf.py

cat /proc/asound/card1/stream0 showed this

catted.txt

I'm still running Ubuntu 10.04 with kernel 2.6.32-17 generic. I have 10.10 ready for upgrade but not got there yet

Chris G3WIE
Reply | Threaded
Open this post in threaded view
|

Re: Sound card with out-of-sync samples

ahlstromjc
Administrator
In reply to this post by Chris_g3wie
There is an option in your config file to fix this.  Look for "channel_delay" and set it to the channel that needs the delay.

Jim
N2ADR