05-07-2019 04:36 PM
Hi all, I need your help!
I want to generate a set of points that follow exactly a Sine curve and the value difference between them must be invariable (fixed and can manually be determined). Just like the triangle wave, the generated points are separated by a step =1. So I would like to do the same thing for Sine wave but it seems impossible, I'm using the waveform generator VI:
05-07-2019 04:53 PM
If the sine wave points should be equidistant in Y, they cannot be equidistant in X and vice versa.
The rest is simple math. Create a complex array (x=RE, y=IM) and graph it on an xy graph.
05-07-2019 07:09 PM
The waveform datatype is based on equidistant X values (time), and can't be anything else. If you want equidistant Y values, you'll have to make an X/Y plot.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
05-07-2019 09:17 PM
Typically when generating a plot for a sine wave, you might use y = A*sin(mx + c) where A controls amplitude, m frequency, and c phase.
In your case, you want to change y by 1 each step (or similarly, by some non-1 constant value).
So invert your equation to get x = (arcsin(y/A) - c) / m, then plot for the range of y values you're interested in.
As James mentioned, you can't do this easily with a waveform graph - use an XY Graph instead (optionally with complex numbers as altenbach wrote).
The problem then becomes that a given value of Y has an infinite number of possible X values (compared to the inverse, where a given X produces only one Y value). Also note that some values of Y are impossible to reach, whereas any value of X is valid (Y/A must be between +-1).
A partial picture of a possible solution is shown below. I've obscured some parts of the block diagram because I'm guessing you're supposed to do the maths 🙂
Note that if you assume m=1 and c=0, it's a bit simpler.
05-07-2019 11:50 PM
A third interpretation would be to have the points equidistant along the curve (either in the plane or along the curve segments).
05-09-2019 07:48 AM
@altenbach wrote:
A third interpretation would be to have the points equidistant along the curve (either in the plane or along the curve segments).
Reminds me to a situaton where we were students sitting in a pub, (after some beer) trying to calculate the extention factor for way home assuming a sine shaped trail with amlitude and frequency somehow related to liters 😄 ... or other boundary conditions 😄