LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to output a complex waveform with a sound card

Hi,
 
I'm trying to modulate data using FSK and transmit it from one PC to another via the sound cards.  This involves two applications which I will build, one which modulates on PC 1 and the other which demodulates on PC 2.
 
At the moment I've created an application on PC 1 which modulates then demodulates the signal, using the MT Modulate FSK and MT Demodulate FSK VIs.  I made this application to figure out how to make the modulation VIs work correctly together, the next step is to split this application into two applications and add sound card outputs and inputs to them.
 
The problem I'm having when adding the sound output to the modulating application is that the output of the MT Modulate FSK VI is a complex waveform, whereas the input of the Sound Output Write VI is just 'data'.  At the moment I've unbundled the complex waveform and used just the Y component as the input for Sound Output Write.  In the first instance this appears to work - the application runs and you can hear a digital sounding signal playing through the speakers.  Unfortunately, upon analysis of the output signal, it can be seen that whatever is being output is not a properly modulated FSK signal, but an apparently nonsense signal which will not demodulate successfully.
 
This appears to be because there is some data from the complex signal which is not being used, which is necessary for propery regeneration of the signal.
 
Has anybody tried outputting an FSK modulated signal (or any complex signal) through a sound card before, and if so, how did you pass the data to the sound card successfully?  If nobody has done this before, does anybody have any idea how I might successfully pass the entire complex waveform to the sound card?
 
Many thanks,
 
Andy
0 Kudos
Message 1 of 11
(4,774 Views)
Hi Andy,

The MT Modulate FSK output IQ data (in a complex waveform datatype) this is the basis for upconversion to the RF domain. For more information on IQ data have a look at the tutorial linked bellow:

http://zone.ni.com/devzone/cda/tut/p/id/4805

To actually get real values that you can output via the sound card you will have to perform the upconversion in software. For this you would use the upconversion VI from the digital palette in the Modulation toolkit. With this VI you will have to specify a carrier frequency. As you are outputting through a sound card you will have to take into account its analog bandwidth. With a modern 96KHz sampling sound card you would get 24KHz bandwidth. So a sensible carrier frequency would be 12KHz. Depending on the number of symbols you have you will have to choose the deviation to make sure you stay within the 24KHz bandwidth.


Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 2 of 11
(4,740 Views)
Hi Jon,
 
Many thanks for the helpful response.  I used the upconvert and downconvert VIs and could see that the upconverted datatype could be correctly output through the sound card, and was able to analyse the waveform on another PC by connecting the sound cards together.
 
Before setting up the sound card properly to output and input the modulated signal, I've just connected the upconvert and downconvert VIs directly to each other, so I can establish the correct settings to use for the upconversion/downconversion process to take place.  Unfortunately, I can't seem to get this conversion to work accurately.  I've used a spectral graph to confirm that the centre frequency and bandwidth are accurate.  I've also used polar graphs to display the complex output before upconversion and after downconversion.  When comparing these graphs during runtime it can be seen that they are not identical so there must be something wrong with my upconversion/downconversion process.
 
Would you mind taking a look at my code for me, please?  I've attached a ZIP file containing the LabVIEW project file and all bespoke subVIs required.  The main program is FSKModem.vi.  In the front panel I've included a binary switch which simply changes the input of the demodulation VI from the complex output of the modulation VI to the complex output of the downconversion VI, to demonstrate which settings work correctly with just the modulation and demodulation taking place (no upconversion or downconversion inbetween).
 
Many thanks in advance for your help.
 
Andy
0 Kudos
Message 3 of 11
(4,705 Views)
I think this is to do with the syncronisation between sent and recieved signal. You probably need to set the syncronisation bits on the output and also wire that trough to the demodulation.

I have been having a play about wiht the various settings and will hopefully be able to post something soon.

Regards

Jon B
0 Kudos
Message 4 of 11
(4,690 Views)
I have modified the FSKModem VI and it just about works with Upconversion. It drops one character from the end and adds one to the front but this is a sync/guard problem I think and by playing around with some of the settings you should be able to get round this. Try various settings for the Sync Bits to see the decoded message appear correctly.

Regards

Jon B
0 Kudos
Message 5 of 11
(4,675 Views)
Thanks very much, Jon.  I don't have LabVIEW available to me until Friday, but I'll have a look at it then.  What was it that needed changing, or will I find it apparent when I open the VI?
 
Thanks again,
 
Andy
0 Kudos
Message 6 of 11
(4,674 Views)
I Passed through the modulation settings to the demodulation VI and set up the Sync bits.

Regards

Jon B
0 Kudos
Message 7 of 11
(4,671 Views)
Hi Jon,
 
I just tried your code and it seems to be looking for a VI called 'demodulate mine.vi'.  I can't find this in the .zip file anywhere, could you possibly send this again, please?
 
Many thanks,
 
Andy
0 Kudos
Message 8 of 11
(4,641 Views)
Hi Andy,

Here his the missing sub vi.


Regards

Jon
0 Kudos
Message 9 of 11
(4,558 Views)
Thanks very much, Jon.  With that VI I've managed to tweak the guard bits, like you said, to make the system work.
 
Now I just need to introduce the sound card stuff!
 
Thanks again,
 
Andy
0 Kudos
Message 10 of 11
(4,547 Views)