Cart | Help
 You are here: NI Home > NI Developer Zone > NI Discussion Forums Select Community English Français Italiano 日本語 한국어 Español 简体中文 繁体中文 Português (BR)

Member
Posts: 4

# Sinewave parameters/discontinuity

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.

Member
Posts: 194

# Re: Sinewave parameters/discontinuity

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
Member
Posts: 4

Thank you!