LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog output Complex Signal

Solved!
Go to solution

First I would like to say thank you to all you members of the community that is helping others

to achieve they goals on LabVIEW.

 

 Im really new to LabVIEW. Im trying to generate those two analog output using daqmx will be ideal if I could control the frequency and  amplitude of those signals.

I really appreciate if anyone has a similar project or an idea how to better approach this problem.complex signalcomplex signal

Thanks a lot 

0 Kudos
Message 1 of 14
(3,692 Views)

Only time for a few thoughts:

 

1. It will be difficult to make the signals' vary *independently* using only a single regular DAQ board.

 

2. It will be moderately difficult to make the signals change "on the fly" without stopping.

 

3. It could be fairly difficult to predefine the signals and have them regenerate *UNLESS* they have the same overall period of repetition.

 

4. I'd approach this by defining the waveform shapes in normalized form.  Let the time axis be "fraction of 1 period" and the amplitude axis be "fraction of max amplitude".   Define enough discrete points to define the curvature you want.  You'll now have a shape where normalized time runs from 0 to 1.0 and where normalized amplitude stays within [-1.0,1.0].

 

5. I'd then make some kind of lookup table out of these sets of data.  Scaling the amplitude will be trivial -- just multiply each sample value by the desired amplitude.  Scaling the frequency is also pretty simple.  You'll need to work out the multiplier between normalized time and actual waveform period, then you can use the DAQ sample rate and the lookup table to derive the array of values you'll feed to the AO task.

 

Just an outline, but that's all the time I've got now.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 14
(3,681 Views)

Hi,

 

In these two cases, we have a square signal with a particularity.

Genarate the square signal : you can use nodes of (Signal processing>>Wfm Generation). You will be able set frequency, amplitude, phase, duty cycle and sampling info of your signal.

  • case 1 : use a case structure and set (t1 : time when the signal change his form to another (ex : sin(-wt)), when the sine signal equal 0, set signal to 0.
  • case 2 : use a case structure and when the square signal will be negative, generate the sine signal.

I hope, it will help you! Let me know if you have another question.

 

Regards,

Fred.

 

Kudos are welcome!Smiley Wink

0 Kudos
Message 3 of 14
(3,674 Views)

first I really appreciate that  you are  taking time trying to help me out and  thanks a lot for that. How do  I use case structure ?  I have to add square signal within  sine signal ? sorry for been to dumb in this subject there is anyway you could upload something similar or a test project ?

 

thanks a lot 

0 Kudos
Message 4 of 14
(3,649 Views)

thanks a lot for taking your time to look at the project. Sorry but the way you explained was very technical way and i quite did not get your point of view about approaching this problem there is anyway you could be much clear or any other suggestion when you have your time.

 

thanks a lot 

0 Kudos
Message 5 of 14
(3,646 Views)

@guto26
thanks a lot for taking your time to look at the project. Sorry but the way you explained was very technical way and i quite did not get your point of view about approaching this problem there is anyway you could be much clear or any other suggestion when you have your time.

I *think* this was in response to my previous post (msg #2).  Let me start by identifying some key concepts you'll need to grasp first.  I won't be able to explain many details usefully until you've got that much as a solid foundation.

 

1. Normalizing.   This is a process where you take a set of numbers and scale them to fit some standard range or other criteria.  One common version of this to force the maximum absolute value to be 1.0  You can get there by simply dividing all of them by the max absolute value in the set.  The result is a set of values between -1 and +1 and they are now in units of "fraction of max value".

    Imagine your sketched waveforms as a bunch of connected (x,y) coordinate pairs.  Or don't just imagine, go ahead and enter those values as columns in Excel and make a plot.   I'm suggesting you derive 2 columns of *normalized* values where the new x values range from 0 to 1.0 in units of "fraction of full waveform period" and the new y values stay in the range from -1.0 to +1.0.

   (Tiny little perfectionist technical note: if normalized time is 0.0 for the 1st value of the 1st cycle of the waveform, normalized time should be 1.0 for the 1st value of the 2nd cycle of the waveform.)

 

2. Interpolation

3. Lookup Table - only consider the kind that will do Interpolation

4. The relationship and distinction among Waveform PeriodSample Rate, and # Samples per Waveform Period.   These can lead you to a Sample Index # which can then lead to a Normalized Index #.  And that's where you can use your Normalized Lookup Table and Interpolation.

 

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 6 of 14
(3,620 Views)

hello guys sorry for the later replay i manager to make those signals  but right now is very hard to manipulate the signal. How can I make the signal more easy to manipulate and how can add a delay for the next sample for to start like on my previous drawing many thanks  complex siganl labview.pngcomplex signal.png

0 Kudos
Message 7 of 14
(3,546 Views)
Solution
Accepted by guto26

here is something to play 🙂

complexwfrm01.png

the decay should be scaled to samplerate, but thats your homework now.

Your first wfrm was looking like a peak value with decay feeded by a pulse and the second was just adding the right difference 😄

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 8 of 14
(3,523 Views)

Wow amazing coding thank so so much genius the coding is much simple than mine 

also if i  could ask you just one last thing how do you connect this code to  DAQ to generate an analogue output 

thanks a lot keep in touch.

0 Kudos
Message 9 of 14
(3,514 Views)
Solution
Accepted by guto26

This creates the two arrays for one cycle you can feed into the AO task...

 

complexwfrm02.png

 

But now I'm curious ...  why do need such wfrms?

 

Homework: The vi is ready to be used as a subvi: However please create a nice icon for it (and post it :D) and there is no error handling included (but the connectors are left free 😉 )

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 10 of 14
(3,490 Views)