Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW A/D..how to store data in a PC

Hi,
I am relatively new to using LabVIEW simulation. My group and I have a project in SDR (Software Defined Radio). We are trying to simulate the whole system in LabVIEW before using any DAQ. Right now, I generated an AM modulated signal plus RN-noise, generated RN by itself. Then, extracted the Is (in-phase) and Qs (quadrature) of each signal.  Thus, I have 4 analog signals that need to be converted to digital data and be stored into a PC. Once they are in a PC, then we can manipulate them (amplitude/phase adjustment, filtering, and eventually demodulating and subtracting the AM+RN - RN to get a clean audio signal at the end basically.

I am not sure how to A/D my signals, how to specify the resolution and other parameters in the ADC, and how to store them as an array in the PC?

Thank you
0 Kudos
Message 1 of 9
(4,050 Views)
 

Hello alsafaj,

Based on the description of your application I would suggest that you consider the NI Modulation Toolkit for LabVIEW. This toolkit includes analog and digital modulation functions and sounds like something that would definitely help you with your development. To find out more, I would recommend that you examine the NI Modulation Toolkit for LabVIEW product page.

To answer your immediate questions about analog to digital conversion and saving to PC, it would be helpful to have a little more information about your current configuration and requirements. What format is your data? Do you have an array of numeric values? Is it an Analog Waveform? You can use Build Waveform from the Waveform Function palette to create an Analog Waveform using a t0, delta t and Y values. This allows you to build an analog signal out of the start time, the time between samples and the amplitude of the samples respectively. Once you have constructed an Analog Waveform there is a VI called Analog to Digital.vi that you should be able to use. This VI is also located in the Waveform Function palette and allows you specify ADC parameters including resolution, range and data format.

Saving data to your PC can be accomplished in a number of ways. The File I/O Function palette offers a variety of formats for data storage, including binary files, text files, spreadsheet files and TDM format. TDM is a National Instrument's defined format that allows for quick formatting and organization of files. If you are interested in learning more about TDM, there is a great document on our website here. The quickest and easiest way to write your data to a file would probably be through the Write to Measurement File Express VI. You can find more information about this VI in the LabVIEW Help file or online here. I hope this information has been helpful.

 

Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 2 of 9
(4,022 Views)
Dear NI Engineer,

I would like to see an application of how to use IQ or IF modulators just like the ones in this page http://zone.ni.com/devzone/cda/tut/p/id/3013#toc2. I want to convert my I's and Q's to digital signals, do amplitude and phase adjustments in the digital domain and then convert it back to analog to have noise cancellation. I don't have a modulation toolkit.
Thanks
0 Kudos
Message 3 of 9
(3,976 Views)
Hello alsafaj,

I'm still a little confused about what you're trying to do. It sounds to me like you are trying to modify the sine/cosine representations of your In-Phase & Quadrature data to implement phase shifts & amplitude modulation. Is this correct? What is still unclear to me is how you are representing your data. It would help if you could specify the data type you are using. From my previous post, could you answer these questions:

"What format is your data? Do you have an array of Numeric values? Is it an Analog Waveform?"

You should be able to determine the data type of a wire by enabling the Context Help (Press Ctrl+H) and hovering your mouse over the wire. The Context Help window should display information about the wire.

Once you have determined information about the type of the data it will be easier to explain how to modulate this data. When you say that you "want to convert my I's and Q's to digital signals, do amplitude and phase adjustments in the digital domain ..." I assume that you have the I/Q waveforms that represent a digital bitstream, is this correct? Amplitude and phase modulation are not performed on the digital bitstream itself, but on the analog signal that represents this bitstream. So, I am guessing that you have some data type that represents this analog signal with numeric values. Now, you would like to implement phase & amplitude changes in this data. Is this correct?

If that is the case, you would need to parse the waveforms to identify the individual symbols. Once you have the I/Q waveform for each symbol you could implement some sort of logical rotation of the decimal values to implement a phase shift. Amplitude changes can be implemented by simply multiplying the waveform by a scaling factor. I would be more detailed about these options, but I want to make sure that this is the correct interpretation of your application. Could you confirm this information and provide the additional details outlined above?


Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 4 of 9
(3,954 Views)
Okay. I hope I can answer your questions and explain my application more accurately.
The first question:
- It sounds to me like you are trying to modify the sine/cosine representations of your In-Phase & Quadrature data to implement phase shifts & amplitude modulation. Is this correct? That's correct.
- What format is your data? Do you have an array of Numeric values? Is it an Analog Waveform?
The format of my data is analog waveforms. I don't have an array of numeric value.
-
I assume that you have the I/Q waveforms that represent a digital bitstream, is this correct?
I have the I's and Q's in the form of analog waveforms. I would like to convert them to digital bitstream or array os numeric value to be stored in the PC!
Let me talk about the whole application:
I have two function generators: One function generator produces a cosine wave plus random noise (Signal + Noise), the other produces random noise alone (Noise). For each signal, I and Q signals will be extracted using a "SDR-1000" box that's "Software Defined Radio HW". Now I have 4  signals that should go into a 4-CH DAQ to be converted to digital representation before they go to the PC. Assuming there's some kind of phase delay between the two signals in the real time and we want to align them so we can have a proper noise cancellation before they are demodulated and converted back to the analog domain to hear the minimized noisy signal.

It may still sound confusing to you and unclear.

bare with me and let me know if you need additional info. i'll try to come up with specific questions. Is there anyway I can upload my application.vi on here or somewhere, so you can have a look?

Thanks,
Ahmed
0 Kudos
Message 5 of 9
(3,950 Views)
Hello Ahmed,

I think I've got a better understanding of the specifics of your application. One thing to note is that the analog waveform data type actually contains the array of numeric values. You can use the Get Waveform Component function to access the array of numeric values for this waveform, as seen in the example below.

Once you have the array of numeric values you will need to parse the I & Q data into individual symbols. The symbol length is the number of data points in your waveform that represent one digital symbol. You will need to determine this parameter based on your modulation parameters, but in general it should be equal to one period of your I/Q waveform multiplied by your sample rate in samples per second (assuming that one digital symbol is represented by each period of the I/Q wave). Or, in a formula:

Symbol Length=(1/fI/Q) * Sample Rate
   where fI/Q=the frequency of your I/Q waveforms and Sample Rate=1/Δt from the analog waveform

The result of this operation should be the number of samples that represent one symbol. You can then use this number to separate your I/Q data into individual symbols. The code below will create an array of symbols by parsing the I/Q waveforms. The first for loop indexes through the numeric array of the analog waveform and adds each symbol to a new array given the symbol length parameter that you have determined. This new array contains an entry for each symbol in the I/Q waveforms. Alternately, you could perform phase shifts & amplitude scaling on the entire waveform by skipping this step and simply wiring your numerical array into the for loops described in the next section.

Given the array of symbols you can scale the amplitude by multiplying each symbol by a scaling factor. The upper for loop in the example demonstrates this operation. You can then perform a phase shift by rotating the numeric array the number of places equal to the phase shift. For example, if you had an array of 360 points and you want to shift by 90 degrees, you would rotate by -90 places to place the first 90 points in the array at the end of the array. You need to invert the number of places to shift because, by default, the shift moves values from the end of the array to the front. The lower for loop in the example demonstrates this operation.



This example should demonstrate the key concepts you are attempting to utilize in your application.

Message Edited by Matt A on 04-11-2007 11:24 AM


Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 6 of 9
(3,934 Views)
Matt,

Thanks so much for the assistance. I think what you provided is what I needed. When I tried to build it "the VI in the .jpg file you attached" on my own, I had troubles
I don't think I need the modultion toolkit to build that. Is there anyway you can comment on every block with the name so I can search easily or attach a real .vi file.

Thanks,
 
0 Kudos
Message 7 of 9
(3,889 Views)
Most functions are named except for the Build Array in the first loop and the Rotate 1D Array in the phase shift loop. I trust you don't need help finding the basic numeric functions.
Message 8 of 9
(3,885 Views)
Hello Ahmed,

You do not need the Modulation Toolkit to create the functionality that I posted in my example. Dennis' post should have answered your questions about the VI names, but if you are still confused about any of the operations let me know.


Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 9 of 9
(3,859 Views)