From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Representing graphically a function on two periods

Hi, I'm a student that is begginer in LabView and I have to solve a set of problems. I have a problem on which I can find the solution.

 

I have to represent graphically the function u = Umax * sin * (a * x + b) on two periods if Umax, a and b are given. I tried to represent the function, but I don't know how to represent it on two periods.

0 Kudos
Message 1 of 6
(1,098 Views)

Ah, a simple Math problem.  Let me rewrite it for you, and see if that gives you some clues.

 

   y = gain * sin (twopi * f * t + phase)

 

Surely you recognize this as the equation for a sine wave of frequency "f".  Suppose we start with t = 0 -- what value of t gives you two periods of this sine wave (whose frequency is f)?

 

Figure this out, figure out how to get back to your original equation's formulation, and you will have the answer to "how to represent it on two periods".

 

Bob Schor

Message 2 of 6
(1,073 Views)

Thank you! But my math is beating me. I couldn't figure out how to do it. I trie for another function, and i've been able to do it. I don't know how to do it for this equation.

Download All
0 Kudos
Message 3 of 6
(1,040 Views)

Hi Adeline,

 

simple math:

  1. You want to display "two periods" of your sine signal, so you want to range from 0 to 2*2*pi…
  2. You want to display two periods for any given frequency. Bob gave you the basic formula sin(2pi*f*t).
  3. The start of the range is given by t=0.
  4. The end of the range is given by 4pi=2pi*f*t, or t=4pi/(2pi*f)=2/f…

Now all you need is a ramp from t=0 … 2/f, with as many samples you like to use in between…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 6
(1,022 Views)

Ok, I managed to do it if a=1 and b=0. But if the value of a ans b changes, it changes my sine signal. Can you please show me in labview, how can I do it for my equation. Thank you so much for your help.

0 Kudos
Message 5 of 6
(976 Views)

@Adelinne wrote:

Ok, I managed to do it if a=1 and b=0. But if the value of a ans b changes, it changes my sine signal.


Have you had any lectures on Signals?  You just said "If I change the Frequency or the Phase of my Sine Signal, it changes my Sine Signal".  Of course it does!  But you can still determine how much time it takes to create two periods ...

 

If you (for some reason) have never dealt with sinusoids, find a second-year Engineering Student and ask them to teach you about sine waves.  Or ask a helpful Professor.  Or read a textbook.

 

Bob Schor

0 Kudos
Message 6 of 6
(966 Views)