[linrad] Re: Sampling speed.

2006-12-18 Thread Alberto di Bene

Leif Asbrink wrote:


My concern is non-integer rate conversion. A soundcard
that actually samples at 3.072 MHz and sends 48 kHz to 
the PC has to be down-sampled by 1.088435 times to 
produce 44.1 kHz. If it were properly done in the PC it 
would be perfectly OK, but judging from my experiment,

the Windows device driver is not very accurate.

My problem: How come that the computers do not ask
"do you really want a rate conversion ?" when the user
sets a speed that will cause a non-integer conversion?


In Windows you can choose the compromise between quality of the resampling and 
resources utilized for that.
Click on Control Panel | Sound and Audio Devices | Audio | Advanced | Performance  and in the bottom part of the panel 
you are now in, you will find a slider labeled "Sample rate conversion quality". It is advisable to keep it at its 
extreme right, the best quality.


Anyway in Winrad I coded a non-integer resampling routine using the method of interpolation on a windowed sinc. The 
results seems to be quite good, the spurs generated by the resampling are usually between -90 and -100 dBc (if I recall 
correctly). I wonder which algorithm does use Windows. The interpolation is quite fast, the CPU used is minimal.


73  Alberto  I2PHD


#
This message is sent to you because you are subscribed to
 the mailing list .
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
Send administrative queries to  <[EMAIL PROTECTED]>



[linrad] Re: Sampling speed.

2006-12-18 Thread Leif Asbrink
Hi John, Alberto and All,

Integer rate conversion is simple on the digital side.
One would typically sample at say 64x48kHz = 3.072 MHz
(with 12 bits) 

A very simple anti-alias filter will suppress the signals
around 3.072 MHz that will alias down to audio frequencies.
A digital filter that cuts at about 24 kHz will ensure that
signals at say 34 kHz are well suppressed.
One can then down-sample by 64 and get a signal at 48 kHz 
with 16 bits.
  
> >If you have a sound card sampling at 48khz with no anti-aliasing
> > filter, and you have a tone spurious or otherwise coming into that card at
> > 38khz the sampled data will have a tone at 10khz in its output that did
> > NOT EXIST at its input.
The highest frequency is 24 kHz. Going all the way up to 34
would give an alias at 14 kHz. A digital filter can easily
suppress by 100 dB so this should not cause any problem.

> Yes, that's right, but are you sure they don't have an anti-alias filter at 
> all ? Probably, given the fixed sampling 
> frequency of 48 kHz, they have just a fixed, simple RC network. If you don't 
> need to switch the filter along with the 
> sampling frequency, you can build it simply and cheaply with just a few 
> passive components.

With a very simple filter one can expect the 3 MHz signals to
be suppressed by only 30 dB. One can expect the anti-alias filter
to have 3 dB at say 100 kHz. HIFI enthusiasts want zero phase
shift all the way up to 24 kHz.

In a direct conversion radio this could be disastrous but it
is very easy to correct with some filtering.

With music sources one can expect signals around 3 MHz to be
really weak so it is reasonable that manufacturers save
a couple of cents by not making the anti-alias filter better.

My concern is non-integer rate conversion. A soundcard
that actually samples at 3.072 MHz and sends 48 kHz to 
the PC has to be down-sampled by 1.088435 times to 
produce 44.1 kHz. If it were properly done in the PC it 
would be perfectly OK, but judging from my experiment,
the Windows device driver is not very accurate.

My problem: How come that the computers do not ask
"do you really want a rate conversion ?" when the user
sets a speed that will cause a non-integer conversion?

Presumably a 48 kHz soundcard would be properly converted 
to 24 kHz by the PC while conversion to 22.1 kHz would
be questionable.



73

Leif / SM5BSZ

#
This message is sent to you because you are subscribed to
  the mailing list .
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
Send administrative queries to  <[EMAIL PROTECTED]>



[linrad] Re: Sampling speed.

2006-12-18 Thread Alberto di Bene

John Harrison, NI1B wrote:

Hi All,

   If you have a sound card sampling at 48khz with no anti-aliasing
filter, and you have a tone spurious or otherwise coming into that card at
38khz the sampled data will have a tone at 10khz in its output that did
NOT EXIST at its input.


Yes, that's right, but are you sure they don't have an anti-alias filter at all ? Probably, given the fixed sampling 
frequency of 48 kHz, they have just a fixed, simple RC network. If you don't need to switch the filter along with the 
sampling frequency, you can build it simply and cheaply with just a few passive components.


73  Alberto  I2PHD
.


#
This message is sent to you because you are subscribed to
 the mailing list .
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
Send administrative queries to  <[EMAIL PROTECTED]>



[linrad] Re: Sampling speed.

2006-12-18 Thread John Harrison, NI1B

Hi All,

   If you have a sound card sampling at 48khz with no anti-aliasing
filter, and you have a tone spurious or otherwise coming into that card at
38khz the sampled data will have a tone at 10khz in its output that did
NOT EXIST at its input.

   Thus the name aliasing. It is MUCH simpler and cheaper to have the
audio chip provide anti-aliasing than to build multipole L-C filters!!
Thus my comment about ISA cards being useful because they have the filters
built into the chip!

   Happy holidays to all,
   john


On Mon, 18 Dec 2006, Alberto di Bene wrote:

> John Harrison, NI1B wrote:
> > Hi All,
> > 
> >   The one REAL change in recent (PCI) sound cards seems to be that the
> > input low pass filter AKA anti-aliasing filter HAS BEEN ELIMINATED on
> > many (all?) of the cheaper PCI sound cards.
> 
>   This probably was done because the cheap AC'97 compliant chipsets found on 
> the mainboards, or in the less expensive 
> PCI sound cards do sample at a _fixed_ rate of 48 kHz, so the anti-aliasing 
> filter is now fixed, no need to adjust it 
> when changing sampling speed. The other sampling speeds are produced by 
> Windows itself, as said by Leif, by a software 
> downsampling routine, and the anti-aliasing filtering is also done in 
> software, before the downsampling.
> This under Windows. Under Linux, I don't know...
> 
> 73  Alberto  I2PHD
> 
> 
> 
> #
> This message is sent to you because you are subscribed to
>   the mailing list .
> To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
> To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
> To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
> Send administrative queries to  <[EMAIL PROTECTED]>
> 


#
This message is sent to you because you are subscribed to
  the mailing list .
To unsubscribe, E-mail to: <[EMAIL PROTECTED]>
To switch to the DIGEST mode, E-mail to <[EMAIL PROTECTED]>
To switch to the INDEX mode, E-mail to <[EMAIL PROTECTED]>
Send administrative queries to  <[EMAIL PROTECTED]>