Trying to create a virtual audio cable output from a software defined radio program

Started by tomb18 7 years ago3 replieslatest reply 7 years ago370 views


I have a question concerning getting a virtual audio cable output in a program I wrote.  A virtual audio cable output is an audio stream where the left channel is the I signal of a software defined radio and the right channel is the Q signal.

I have tried many things to get this to work and have had no success.  It’s mainly not having a  thorough enough knowledge of DSP.

A little background.  My software works as follows:

Acquisition of data from a sound card

Splitting the sound stream into a left and right channel (I and Q signals)

Creating a complex signal from the two channels

Feeding the complex signal into a complex FFT

Plotting the spectrum.  This all works fine.

Now I have been able to create a VAC output when using a software defined radio that uses a sound card.

I can do this a number of ways:


Acquisition of data from the sound card.

Sending this data directly to a sound output class. Typically I sample the input at 192000 kHz and the output is at 48000


Acquisition of data from the sound card

Splitting the sound stream into a left and right channel (I and Q)

Creating a complex signal from the two channels

Converting this complex signal into two real buffers one the left channel and one for the right

Converting these buffers into audio and sending them to the sound output class.


Acquisition of data from the sound card

Splitting the sound stream into a left and right channel

Creating a complex signal from the two channels

Feeding the complex signal into a complex FFT

Taking the output of the FFT and sending it to a complex inverse FFT

Converting the output of the iFFT into left and right audio buffers

Sending this to the audio output class.

All of these methods work for a sound card input.  

However, I want to use a different device that does not use a sound card but rather delivers the data via a programming interface.  In this case, the data is collected at 2,000,000 samples per second.  I collect 16384 samples and send it to my FFT.

Now the plotting works fine.  However if I try method 2 and 3 above I get nothing out.

Any hints?  I am thinking it probably has something to do with the sampling rate?

Now, what about if I take the output of the FFT which shows frequencies from 0 to 2 MHz,  extract only the frequencies from 0 to 192 kHz, feed them into the iFFT and then send it out to the audio output?  Would this work?

Thanks, Tom

[ - ]
Reply by TreefarmerNovember 1, 2017

Dear Tom, You might look into getting an inexpensive Cypress PSoC5_LP development board such as the CY8KIT-059. Can't beat the price. Then use PSoC Creator software (no charge from Cypress) to drag an I2S component onto your Top Design along with a DMA and even a FIR Filter component. Then use the MCU component to write your FFT code. It will take a learning curve to get this going in the software but it would be a very compact one-stop solution -- truly a System on Chip. Cypress has an active user forum with lots of participation. For inputs you can get some tiny MEMS microphones from Adafruit with digital output.

Your sample rate of 2MHz seems out of reach for these devices but I doubt that a sound card gave you that range either. The I2S interface lets you interleave two channels and the PSoC supports up to 64-bit resolution.

Jerry Cogswell

[ - ]
Reply by tomb18November 1, 2017

Well I have made progress.  When I use a device that is sampling at 2,000,000 samples a second I need to downconvert it to 48000 samples per second to get it to work.  Now I found this out by fluke.  

I can send the data packets down to my audio output processing at 48kHz instead of 2MHz.  When I do this, the data is sent out through the audio out correctly but at a rate of 48,000/2,000,000 of the speed of the real time data.  The packets just back up...so if I stop the data acquisition the sound output continues until all the remaining packets are gone.

So instead what I have to do is resample the data so that the data is now at 48kHz instead of 2MHz.

Now, I have no tools in my app to do this in the time domain but I do in the frequency domain.  So I will ask this question in a new thread.

[ - ]
Reply by chalilNovember 1, 2017

looks like, you're assuming L&R can be directly be used as I&Q - not explicitly made any statement about this in your mail - you may want to validate this assumption. 

if you really want to take the advantages of I&Q for your signal processing, they are really need to be orthogonal. typically, the I&Q are obtained by mixing the input with code and sin respectively and then sub-sampled/filtered. once you have this, you can feed this signal to an FFT as complex as you are attempting in #3.