04-30-2013 09:27 PM - edited 04-30-2013 09:35 PM
Problem: Generated Pulse waveform is distorted when I deliver the signal to the output port in the DAQmx.
Environment: Windows XP sp3 (32bit), Visual Studio 2010 sp1, NI-Measurement Studio 2010
Device: NI - DAQmx PCI 6251
Analog Input: 1.00MS/s multi-channel (aggregate)
Analog Output: 2 Channel 2.00MS/s
Reference Example: AO_ContGenVoltageWfm_IntClk / AI_ContAcqVoltageSamples_IntClk
Generated Pulse:
1) AO0 = Square Waveform /0-5V / 8KHz / 0.5㎲/sample / sample 50% Duty
2) AO1 = Square Waveform /0-5V / 8KHz / 0.5㎲/sample / (Reverse Image)
Description: I’d like to deliver the waveform stream satisfied with specified constraints to the 2 channel output port in the DAQmx. To verify accuracy of the generated waveform, I did an electrical wiring from the Analog output channel (2 channels) to the Analog Input channel (2 channels) in DAQmx. As a result of this experiment, I could get a result which has signal distortion. Since the waveform has to satisfy with both high frequency (8KHz) and very short moment interval time (△t = 0.5㎲/sample) between samples, I cannot handle some parameters of the function in the referenced VC++ example. Following formulas shows an approach to deliver the generate pulse waveform to output port satisfied with constraints.
Analog Output Channel
Frequency = 8,000 cycles/sec (constraint)
Sample per Buffer = 2,000,000 = 2*106 samples/buffer
Cycles per Buffer = 80,000 cycles/buffer
Sample per Channel = 1,000,000 = 1*106 samples/channel
Sample Rate = Frequency * (Sample per Buffer / Cycle per Buffer)
= 8,000 * (2*106 / 80,000) = 2*106 samples / sec
△t = 1 sec / 2*106 samples / sec
= 0.5 * 10-6 sec/sample (constraint)
Buffer Cycle = Sample Rate / Sample per Channel
= (2*106 samples / sec) / (1*106 samples/channel)
= 2 channel / sec
Analog Input Channel
Sample per Channel = 1,000,000 = 1*106 samples/channel
Sample Rate = 1 MS/s * (2 Channel) = 5 * 105 Samples / Sec
Program Code
AO_ContGenVoltageWfm_IntClk / AI_ContAcqVoltageSamples_IntClk (VC++ Example)
Result: The proposed approach was implemented in the experiment environment (VS2010, MStudio2010). As shown in Figure 1, we could get the unsatisfied result. Although I intended to make a ‘square’ pulse wave, the result looks like ‘trapezoid’ pulse wave (Figure.1). However, there is other result which was undertaken with different parameter condition. It looks like the square shape not the trapezoid shape.
Please let me know what the conditions make the problem of signal distortion. (AO0 = Green line / AO1 = Red line)
[Figure. 1] Frequency 8000 Hz / Cycle per Buffer = 8000 Result
[Figure. 2] Frequency 1000 Hz / Cycle per Buffer = 1000 Result
Questions: Please let me know following questions.
1) Is it possible to deliver the generated pulse wave satisfied with constraints (f= 8KHz), △t = 0.5㎲/sample) to the output port without distortion using PXI 6251?
(Is it possible to solve the problem, if I use the LabView or MAX?)
2) Are there some mistakes in the proposed approach? (H/W or S/W program)
3) What is the meaning of the Cycle per Buffer?, It could effect to the result?