VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sinewave parameters/discontinuity

Solved!
Go to solution

Hi,

 

Is there a way to have two sinewaves that play one after another withtout discontinuity? I know that I can can use the Phase parameter and I calculate it like this:

 

y=Amplitude_A*sin(Frequency*time + Phase_A)
Bias_B=Amplitude_A*sin(Frequency*time + Phase_A)


Since Time = 0 :
Bias_B=Amplitude_A*sin(Phase_A)


Isolating Phase_A :
Phase_A=asin(Bias_B/Amplitude_A)

 

(and i convert this in degrees)

 

So I have a function as smooth as possible but it does not work if I have a sinewave from 800 (max) to 200 (min) followed by another one of 600 (max) to 400 (min). When my Bias is greater the the Amplitude (just like this example), I have no way to go from the end of the first sinewave to the beggining of the second one without discontinuity or ramping. Ideally, I would like this transition to be a curve.

 

Sorry if it is not clear, english is not my first language.

 

Thanks in advance

0 Kudos
Message 1 of 3
(5,893 Views)
Solution
Accepted by topic author PPrez

Hey PPrez,

 

I think the only way to ensure that there won't be a discontinuity it to make sure that you are switching the sinewave at a common point. Since we aren't changing the frequency and we aren't changing the central point of the amplitude (500 in both waves), the best way to get that change with minimal discontinuity is to change when crossing that 500 line. There won't be any phase shift necessary, since the central point there should be at the 0 or pi phase of both waves depending on whether you are crossing low to high or high to low. You could also implement windowing during the transition period to minimize discontinuity, but that will change the shape of your signal over that period. 

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
0 Kudos
Message 2 of 3
(5,862 Views)

Thank you!

0 Kudos
Message 3 of 3
(5,850 Views)