Sample Rate Synchronization between VAC and Vista/Win7 Sound...
Sample Rate Synchronization between VAC and Vista/Win7 Sound Devices
| System Dependencies
| Minimum PowerSDR Version:
| Applicable Hardware:
|| All FlexRadio Systems SDRs
Content provided by: FlexRadio Systems Engineering
Explanation of the Problem
When transferring an audio stream between two software process such as PowerSDR and a digital mode application using VAC (virtual audio cables) one consideration is sampling rate conversions at different steps in the audio signal path. Ideally your source and destination sampling rates would be the same resulting in no sampling rate conversions. Unfortunately this ideal situation does not exist therefore you must take this process of sample rate conversion into consideration when setting up PowerSDR to transfer audio to a third-party application.
With the introduction of Vista and Win7, Microsoft changed the behavior of sound devices where the user has more control of the low-level parameters and the default sampling rate parameter was set for playing CD music at 44.1 KHz. In addition, the ability to control the low-level parameters from third-party programs like VAC has been limited. The end result of these changes is that Windows is forcing an un-necessary and detrimental sampling rate down-conversion in the PowerSDR<->VAC<->digital mode program signal path which results in additional system resource overhead, added latency and audio artifacts that show up as unwanted sidebands or harmonics that the digital mode sound card program's DSP filtering does not remove.
It is best to illustrate this situation with an example. When operating digital modes, you are transferring audio from PowerSDR to a digital mode program like Fldigi via VAC "cables". It is a common de facto practice to set the VAC sampling rate in PowerSDR to 48 KHz which is a natural multiple of the audio sampling rates PowerSDR operates at normally (48, 96 & 192 KHz). From a operational standpoint, it is much "cleaner" to down or up-convert sampling rates that are even multiples so that audio buffers align on natural boundaries, eliminating buffers that are only partially full of actual audio data. In the case of VAC, the 48 KHz sampling rate is equal to or an even multiple of the possible the PowerSDR audio sampling rates.
The VAC cable which is used to transfer the audio streams between PowerSDR and the third-party digital mode application is a Windows sound device and it will adjust the audio steam parameters (sampling rate, bit depth and number of channels) at each end point of the VAC cable to match the applications audio stream parameters. For example, in PowerSDR if you set the VAC sampling rate to 48 KHz and have the Mono/Stereo check box unchecked, then the audio stream parameters are 48 KHz, 16-bit depth, single channel. The other end of the VAC audio cable that connects to the third-party digital mode application also has audio steam parameters that should be the same as PowerSDR. In this case either VAC or the third-party digital mode application itself will change the characteristics of the audio stream to match the other end point of the VAC cable.
In the case of Fldigi, you can configure its "sound card" settings, which in this case are the audio steam parameters of the connected Windows sound device or VAC cable. Now it gets a little more complicated. The "modems" or the DSP software that performs the modulation/demodulation of a specific sound card digital mode operates at a different sampling rate than that of the connected "sound card. In the case of Fldigi, the modems operate at 8 KHz, which is a multiple of most legal sampling rates and therefore does not usually have problems with partially filled audio buffers. So in the aforementioned example, the following is a representation of the audio stream signal path in regards to the audio steam parameters.
[PowerSDR, IQ: 48KHz, 24 bit, 2 channel] <-> [PowerSDR, VAC I/O: 48 KHz, 16-bit, 1 channel] <-> [VAC Cable-1, end point1: 48 KHz, 16-bit, 1 channel]==[VAC Cable-1, end point2: 48 KHz, 16-bit, 1 channel] <-> [Fldigi Sound card interface: 48 KHz, 16-bit, 1 channel]==[Fldig modem: 8 KHz, 16-bit, 1 channel]
As you can see, ignoring the PowerSDR audio sampling rate, there is only one sampling rate conversion that happens during this process which is "inside" Fldigi at the modem stage. This represents a sampling rate conversion scenario which is about as ideal as you can get.
With Vista and Win7, Microsoft change some of the default behaviors of their sound devices, of which VAC cables are Windows Sound devices, abet they are virtual rather than physical like a sound card. One of these changes was to set the default audio device parameters of all sound devices to 44.1 KHz, 16-bit, 2 channel (stereo) and VAC can not over-ride the defaults. The result is an audio stream signal path tha now looks like the following
[PowerSDR, IQ: 48KHz, 24 bit, 2 channel] <-> [PowerSDR, VAC I/O: 48 KHz, 16-bit, 1 channel] <-> [VAC Cable-1, end point1: 44.1 KHz, 16-bit, 2 channel]==[VAC Cable-1, end point2: 44.1 KHz, 16-bit, 2 channel] <-> [Fldigi Sound card interface: 48 KHz, 16-bit, 1 channel]==[Fldig modem: 8 KHz, 16-bit, 1 channel]
As you now see we have three sampling rate conversions instead of one and to make things a lot worse, the conversions are not natural multiples or divisors so we have introduced inefficiencies in the transfer of data at the buffer level. The result of this operation is the additional system resource overhead, added latencyand audio artifacts that show up as unwanted sidebands or harmonics that the DSP filtering does not remove mentioned above. All of which is detrimental to the operation of digital modes with PowerSDR and your software defined radio.
So how do we fix this problem? We do it by changing the default audio parameters of the Windows sound device, which in this case are the VAC cables used to transfer audio to and from PowerSDR and the third-party digital mode programs.
Changing the Default Sound Device Parameter for VAC Cables
The following procedure will describe how to change the default Windows sound device parameter from 44.1 KHz, 16-bit, 2 channels to an optimal configuration for PowerSDR using VAC for audio transfer of 48 KHz, 16-bit 1 channel.
Setting the PowerSDR VAC Parameters
1. Open the VAC setup tab in PowerSDR: Setup->Audio->VAC
2. Set the following VAC Parameters (the other parameters may need to be set specific to the sound card application you are using
a.) Sampling Rate: 48000
b.) Mono/Stereo: The Stereo check box is unchecked
Changing the Default Sampling Rate for a Windows Sound Device
Note: Make sure PowerSDR and any digital mode programs are not running
1. Click on the Windows Start button and Select the Control Panel option
2. Click on the Hardware and Sound category
3. In the Sound sub-category, select Manage Audio Devices
4. In the Playback tab, locate the first VAC cable, it should be labeled as Line 1, Virtual Audio Cable. Right click on it and select Properties from the menu.
5. Click on the Advanced tab
6. Click on the drop down box in the Default Format section. Select "2 channel, 16 bit, 48000 Hz (DVD Quality)"
7. In the Exclusive Mode section, check both boxes; "Allow applications to take exclusive control of this device" and "Give exclusive mode applications priority".
8. Click on the OK button
9. Repeat steps 5-6 for all of the VAC cables in the Playback tab
10. Select the Recording tab.
11. In the Recording tab, locate the first VAC cable,it should be labeled as Line 1, Virtual Audio Cable. Right click on itand select Properties from the menu.
12. Click on the Advanced tab
13. Click on the drop down box in the Default Format section. Select "2 channel, 16 bit, 48000 Hz (DVD Quality)"
14. In the Exclusive Mode section, check both boxes; "Allow applications to take exclusive control of this device" and "Give exclusive mode applications priority".
15. Click on the OK button
16. Repeat steps 5-6 for all of the VAC cables in the Recording tab
This KB article may reference additional files that are available on the FlexRadio Systems web site Downloads page. Please use the URL(s) below to download the referenced materials.
An Adobe Acrobat Reader may be required to open the file.You can download Adobe Acrobat from here.
KB Source Document(s):
Add Your Comments
Last Modified:Friday, March 2, 2012
Last Modified By: Administrator
Rated 3 stars based on 11 votes.
Article has been viewed 19,179 times.