LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert waveform data to IQ data?

I am currently doing a project which requires me to acquire baseband signals (downconverted from RF signals) from typical PC soundcards and demodulate them (both AM and FM). I am considering to use existing example called "Sound Input Read.vi" to acquire the signal from the soundcard and I have Modulation Toolkit to help me perfrom demodulation. However the datatype of the output signal of Sound Input Read.vi is an array of waveforms, and if I want to use "MT Demodulate AM.vi" or "MT Demodulate FM.vi" provided by the Modulation Toolkit, I will have to convert the baseband signal that is stored as an array of waveforms to a more complicated form which includes the complex data array (I/Q data).I do not know how to achieve this conversion. And all I have is simply baseband signals from the soundcard.
In the file named "Direct-Conversion Receiver.vi", I need some means of conversion and demodulation in the case structure, and that is what I am struggling with. Thank you.

Download All
0 Kudos
Message 1 of 9
(16,544 Views)

Hello liuzhao_hh,

 

The data you are feeding into the Demodulate AM/FM is in the incorrect format. The cluster should contain a value for:

 

T0: t0 specifies the trigger (start) time of the acquired signal.

 

Dt: dt specifies the time interval between data points in the acquired signal.

 

Y:  specifies the complex-valued time-domain data array. The real and imaginary parts of this complex data array correspond to the in-phase (I) and quadrature-phase (Q) data, respectively.

 

Where I/Q:

 

I/Q data is an alternative method of describing the magnitude and phase data of a signal.

A sinusoidal wave can be written in polar coordinate form as shown in the following equation:

 

f(t) = Acos(2ft + φ)

 

where:

 

A is the amplitude

 

2πf is the frequency

 

φ is the phase

 

A sinusoidal wave can also be represented in a complex Cartesian coordinate system by its real and complex components such that the in-phase (I) component can be written as

 

I(t) = Acos(φ)cos(2πft)

 

and the quadrature (Q) component can be written as

 

Q(t) = Asin(φ)sin(2πft)

 

You can find the functions for dealing with imaginary, real, conversions etc located in the numeric pallet, there are also further math functions available in the mathematics pallet, see image below:

 

Forum.png 

 

Regards

Andrew George @ NI UK
0 Kudos
Message 2 of 9
(16,482 Views)

Dear Andy,

 

but how can I convert the modulated FM data into IQ format in Labview?

 

Best regards 

Angel

0 Kudos
Message 3 of 9
(14,254 Views)

Hi,

This post was written in 2011 so it might be that you won't get a response from Andy.G as he might not be using the forum anymore. I would recommend creating a separate post in the future.

Now regarding your question about I and Q data.. What function are you trying to use the IQ data as an input for? I and Q data is essentially just Real and Imaginary data, so there is a number of ways to perform the conversion depending on your needs.

Could you specifiy what is the data type that you have your FM data in and what function are you trying to use it as an input to?

Kind Regards,

Applications Engineer
National Instruments UK & Ireland

0 Kudos
Message 4 of 9
(14,197 Views)

Dear Marius,

 

thanks a lot for your help!

 

I have aquired samples from a time signal by using a DAQmx. This is a low freequency FM signal and I want to demodulate it by using labview with the use of I Q data format. 

 

 

Best regards

Angel

0 Kudos
Message 5 of 9
(14,135 Views)

Dear MArius,

 

this is the part of my vi wher I have my doubt!

 

 

Best regards

Angel

0 Kudos
Message 6 of 9
(14,132 Views)

Hi,

You said that you have an FM modulated signal, is the obtained signal correct straight after it comes out of the DAQmx Read.vi? What is the source of the signal?

Are you receiving a signal that was upconverted before it reached the DAQ device or are you only receiving an FM modulated signal? Could you tell me more about the application describing what happens to the signal from generation to the point you obtain it through the DAQmx Read.vi?

Finally, you said you are receiving an already modulated FM signal and then I see that you are trying to upconvert it which means that you are preparing it to be sent out from an antenna. To demodulate a signal you would either downconvert it and then demodulate the signal or if there was no carrier frequency involved and you only happened to send over an FM modulated waveform then just the demodulation step would suffice.

To determine how to best provide the correct input to your function I would recommend creating a constant at the input terminal to see what the input should contain and then see if you can manipulate your data to conform to that format or whether you actually have the right data for the demodulation function.

Attached see a very basic FM modulation and demodulation example in software.

Hope this clears it up a bit.

Kind Regards,



Applications Engineer
National Instruments UK & Ireland

0 Kudos
Message 7 of 9
(14,104 Views)

Dear Andy,

 

can I convert time domain data into complex  IQ data in labview?

 

Is there a vi in labview to do that?

 

Best regards 

Angel

0 Kudos
Message 8 of 9
(14,049 Views)

The problem with what you're asking for is that you're trying to make two sets of data from one. You're trying to add information you don't have.

 

But, since the OP is dealing with FM data, we might be able to make some reasonable assumptions. We're going to use the polar to complex function to calculate the I and Q. All we need is the amplitude and the phase.

 

1) I'll make the assumption that the amplitude is constant. That's the goal of FM right? Hopefully it's a good aproximation for your live signal. We'll use the RMS*sqrt(2)

2) We need the phase so we can use arcsine. Unfortunately, when you go just over the peak of your sinusoid, arcsine doesn't have any knowledge of prior measurements. It's going to assume you've stopped at the peak and are going backwards over your sinusoid. To be honest, in reality, you don't actually know that you aren't. You could have a little gremlin in your box that's messing with your polarization at the top of your sinewave. You might be going back down the other way but you can't tell because you only have the real part of the signal. If you had IQ data, you'd know which way we were going and you could calculate sqrt(I2 + Q2) to get the amplitude at every point. So lets assume that's not happening—we'll have to do some processing to "unwrap" the phase with the For loop.

 

Real FM to I and Q.png

 

If we had an AM signal, the amplitude wouldn't be constant. We'd probably have to use a sliding RMS window or something like that.

If we had a PM signal, I'm guessing we'd have some trouble with positive phase assumption. You'd have to look for jumps in the phase from arcsine.

Message 9 of 9
(13,695 Views)