NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
PPrez
Posts: 4
0 Kudos
Accepted Solution

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.

 

Thanks in advance

Member
JtotheB
Posts: 194
0 Kudos

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
PPrez
Posts: 4
0 Kudos

Re: Sinewave parameters/discontinuity

Thank you!

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page