LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can i calculate the max and min amplitude ?

can i calculate the max and min and send it to function generator. i dont want the DC offset to be move away from origin. but i want a generated sine wave that has in one complete cycle 2 different amplitude levels.like one peak trough 5 volts and the crest 7 volts.moreover i dont want to move the Dc offset away from origin or from zero crossings.is it possible with function generator VI.
thanks
0 Kudos
Message 1 of 20
(5,749 Views)
I don't understand what you mean by peak trough 5 volts and the crest 7 volts, without DC offset. Can you post a picture of your desired waveform?
- tbob

Inventor of the WORM Global
Message 2 of 20
(5,749 Views)
Are you thinking of an AM modulated sine wave? With the Modulation being 1/f and about 2Vp-p? Modulating a 6Vp-p signal with a 2Vp-p one of 1/f, if the phases were correct, you would get 7Vpeak, on one cycle then 5Vpeak the next, then back to 7Vpeak. On both the negative most peak would be about -6V leaving the overall offset at zero.

If this is what you are after, the best way I can think of to do it is to calculate the two signals, and add them. Then run the resulting waveform out.

Let us know if this is what you are looking for. (I suspect that it isn't but I thought I would give it a shot.)
Message 3 of 20
(5,749 Views)
thanks for the reply. what i am looking for is to generate a sine cycle. but the first period is having amplitude +5 volts and the second period could have amplitude -7 volts. usually in sine wave both peaks have same amplitude level.but i am not looking for a +5 volts as one peak and a-5 volts as another peak, but what i am looking for is to have +5 volts as the first peak and -7 volts the next peak.but all this i wanna without moving the DC offset away from origin.
Dc offset must always lie on the origin. the problem with moving DC offset is that we will always have the same level of amplitude like +5 volts as one peak and -5 volts as another peak and this i dont wanna have.
one last important thing that i dont like to change the frequency of the
first or second period.frequency is the same through out the signal.i hope you got my point now. moreover i am also sending the attached needed sine graph in word format.
how can i achieve this form of sine signal with our function generator VI?
i already posted my function generator VI
thanks and regards
0 Kudos
Message 4 of 20
(5,749 Views)
thanks for the reply. what i am looking for is to generate a sine cycle. but the first period is having amplitude +5 volts and the second period could have amplitude -7 volts. usually in sine wave both peaks have same amplitude level.but i am not looking for a +5 volts as one peak and a-5 volts as another peak, but what i am looking for is to have +5 volts as the first peak and -7 volts the next peak.but all this i wanna without moving the DC offset away from origin.
Dc offset must always lie on the origin. the problem with moving DC offset is that we will always have the same level of amplitude like +5 volts as one peak and -5 volts as another peak and this i dont wanna have.
one last important thing that i dont like to change the frequency of the f
irst or second period.frequency is the same through out the signal.i hope you got my point now. moreover i am also sending the attached needed sine graph in word format.
how can i achieve this form of sine signal with our function generator VI?
i already posted my function generator VI
thanks and regards
0 Kudos
Message 5 of 20
(5,749 Views)
I don't think you understand the concept of DC Offset. The signal shown in your drawing is impossible to create using a sine wave without DC Offset. You could create such a signal using an arbitrary waveform generator, but the signal would not be a sinewave. The positive slope would be different than the negative slope. To create the waveform in your drawing you need to set the sinewave generator amplitude to 12 volts peak to peak (+5 - (-7)). If the DC Offset were 0, the signal would go from 0 to +6, back to 0, then to -6, and back to 0. With a DC Offset of -1 volt, the signal would go from -1 to +5, back to -1, then to -7, and back to -1. There would be a zero crossing and if you want to make this your reference point you could start you
r signal with a phase angle offset. Instead of starting at 0 degrees, you start at 10 degrees or so (you have to calculate that). Then the signal would start at 0, go to +5, down to -7, back to 0. Amplitude can be expressed in different ways. Peak voltage means from the origin to the next peak. Peak to peak means from the lowest peak to the highest peak. I suggest you experiment using a function generator and a scope to see how these settings change the signal.
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 20
(5,749 Views)
I have attached a LabVIEW 7.0 VI that should do what I think you are looking for.

Run the VI. The white trace is not a true sine wave. It is instead half of a 5V sign wave and half of a 7V sine wave. The red trace is a sine wave with a -1 offset and a slight phase adjustment to start near zero. Look at the diagram to see how I have done each of them.

I think you are looking for the first waveform, but remember that it is no longer a true sine wave.
0 Kudos
Message 7 of 20
(5,749 Views)
Dear Tbob
Thanks i did some try and in the following Vi if i give 62,5mm as aplitude, select 125mm for cylinder movement, phase angle i selected 10 degrees and offset i selected -1.i am getting the signal that starts from zero goes to +4 peak and return to -6 volts amplitude. that means peak to peak is +4 to -6 in this case. fine but this does not solves my problem.
my problem is if i give the amplitude +62.5 mm(or if want to expressed in volts) +62.5 Volts as a maximum peak value of amplitude and -64.5mm or volts(depends how you expressed it again) as negative peak value.
how can i give this POSITIVE peak value of amplitude and NEGATIVE peak value of input as input to Function generator VI. and then the output signal of this function generator VI, i can write to Osilloscope or graph etc.
now these two issues are important

1)i would like to give the input amplitude as positive peak and negative peak(max or min values). but in our Function generator VI, we have only one input for amplitude. that means now as an input, i can give only one value of amplitude , not the max and minimum values of amplitude, this is that i want actually.
2)i want to begin the signal from zero crossing and when 1/2 of the period is gone, i want again to pass through zero crossing and so on so forth, as i already shown in my above mentioned word sine graph. If the Dc offset is set to zero, peak to peak will be always the same like you mentioned 0 to +6 back 0 to -6.
with Dc offset -1 again we start taking -1 as refrence, then from -1 to +5 means 6 units positive peak and -1 to -7 means also 6 units negative peak.
in both cases you mentioned peak to peak units are having the same value . in the second case DC offset move away from zero crossing. only by changing phase angle offset and Dc offset we can reach the partial result. but what are the consequences of changing the phase angle offset?
3) i would not like to use arbitrary waveform generator, because as you said it does not gives the sine wave, and i am only interested in sine wave here.

Thanks
Regards
0 Kudos
Message 8 of 20
(5,749 Views)
Dear Boby.
just i am also sending a copy to you that i already send to Tbob. i dont know whether to comment only to one person is enough and you also get it automatically or not, therfore i am sending it to you as well. please i am a new user and dont know many things , therefore asking these issues. thanks again
Thanks i did some try and in the following Vi if i give 62,5mm as aplitude, select 125mm for cylinder movement, phase angle i selected 10 degrees and offset i selected -1.i am getting the signal that starts from zero goes to +4 peak and return to -6 volts amplitude. that means peak to peak is +4 to -6 in this case. fine but this does not solves my problem.
my problem is if i give the amplitude +62.5 mm(or if want to expressed in volts) +62.5 Volts as a maximum peak value of amplitude and -64.5mm or volts(depends how you expressed it again) as negative peak value.
how can i give this POSITIVE peak value of amplitude and NEGATIVE peak value of input as input to Function generator VI. and then the output signal of this function generator VI, i can write to Osilloscope or graph etc.
now these two issues are important

1)i would like to give the input amplitude as positive peak and negative peak(max or min values). but in our Function generator VI, we have only one input for amplitude. that means now as an input, i can give only one value of amplitude , not the max and minimum values of amplitude, this is that i want actually.
2)i want to begin the signal from zero crossing and when 1/2 of the period is gone, i want again to pass through zero crossing and so on so forth, as i already shown in my above mentioned word sine graph. If the Dc offset is set to zero, peak to peak will be always the same like you mentioned 0 to +6 back 0 to -6.
with Dc offset -1 again we start taking -1 as refrence, then from -1 to +5 means 6 units positive peak and -1 to -7 means also 6 units negative peak.
in both cases you mentioned peak to peak units are having the same value . in the second case DC offset move away from zero crossing. only by changing phase angle offset and Dc offset we can reach the partial result. but what are the consequences of changing the phase angle offset?
3) i would not like to use arbitrary waveform generator, because as you said it does not gives the sine wave, and i am only interested in sine wave here.


Thanks
Regards"
0 Kudos
Message 9 of 20
(5,749 Views)
Dear Bob Y.
Yes you are right. this is what i am looking for.
i was also thinking almost like this to generate the first sine wave, X1=5 sin(x) take the first period of first generated sine wave.
and generate another sine wave x2=7 sin(x) take the second period of second generated sine wave
and finally append the first period ( 5 volts amplitude) to second period (7 volts amplitude). and append so on so forth.in your VI are you doing the same like i said?

you are also right that this is not a true sine wave.but please could tell me following

1)when you say that this is not true sine wave what do you meant by that?
2)you used simulate signal VIs for sine generation, and i was using before basic function generator V
I,
what is the difference between Simulate Signal Vis and basic function generator Vi. if they are same in functionality can i also write the output of simulate signal Vis to AO write function, as i was doing before. i was adding the outputs of basic function generator and writing it to AO write Vi(sending to osilloscope).
3) i did some change in your white traced VI and now the output i want to wire after buliding array to AO write. would i get the max and min peaks 5 and 7 volts on the osilloscope?
4) all this can i do without changing the functionality of the main VI.
well i am sending you my main VI and the example you send to me(that i changed according to my needs).please also tell me the changes i did according to my needs are practically correct or wrong.
thanks
Regards
0 Kudos
Message 10 of 20
(5,749 Views)