[hpsdr] Mercury sampling rate
Alberto I2PHD
i2phd at weaksignals.com
Sat Apr 12 10:42:11 PDT 2008
Alex, VE3NEA wrote:
>
> Hi Alberto and others,
>
> Resampling by a factor that is an integer power of two can be implemented
> more efficiently than resampling by an arbitrary rational factor, using a
> so-called octave resampler. This resampler is based on a half-band filter,
> that is, a filter whose cutoff frequency is exactly 1/2 of the Nyquist
> frequency. The even coefficients of a properly designed half-band filter are
> zeros and thus the number of required multiplications is reduced by a factor
> of 2. The source code of my octave resampler used in Rocky, Faros and CW
> Skimmer is available at (http://www.dxatlas.com/dev). This resampler is used
> to quickly convert between the 3/6/12/24/48/96/192 kHz sampling rates. The
> only place in my software where a rational-factor polyphase resampler is
> used is the interface with SDR-IQ because this radio has a non-standard
> sampling rate.
>
> All modern soundcards, including the on-board ones, support the sampling
> rate of 48 kHz. The choice of a standard sampling rate in Mercury was a
> smart decision that can result in more efficient signal processing in the
> software.
>
> 73 Alex VE3NEA
Hi Alex,
thanks for your message and the pointer. But there is still one thing that I can't understand how you can accomplish
without the use of a rational factor resampler. The scheme you pictured is fine, and it would work perfectly if the
sampling rate of the sound cards were perfect. But it isn't... When you produce the output audio to be sent to the sound
card, you maybe encounter a card where the nominal 11025 Hz are actually 11026 or 11027... the effect of this is that if
you produce output buffers based on the nominal sample rate, sooner or later you will find yourself in a situation of
buffer starvation, with a consequent click in the audio.
What I do in Winrad is to have a FIFO for the output buffers, and monitoring the degree of filling of this FIFO I change
slightly the downsampling ratio (maybe of a factor of only 0.001) so to keep this number constant, avoiding overflows or
underflows. This is the only way I have found to cope with sound cards with a non exact sampling rate.
If I disable the adjustment of the resampling factor, depending on the card I will end in a sequence of clicks, maybe
not immediately, but after a few minutes. But sooner or later it will happen.
I don't how you did manage this problem in Rocky. Maybe there is a way simpler than mine, and I would be quite
interested in knowing it. TNX.
73 Alberto I2PHD
1208022131.0
More information about the Hpsdr
mailing list