Page 1 of 1

Generate data set from curve

Posted: Tue Oct 29, 2013 6:32 pm
by fixstuff555
Hi folks,

Got a question. I would like to generate a table of data points, from an arbitrarily drawn waveform curve. My intent is to use the generated data to generate a polynomial algorithm that I can subsequently use in a lookup table, that I can ultimately use to characterize waveform shapes. My ultimate goal is to be able to sample a signal over period, t, generate an algorithm, and if the coefficients fall within a certain range, match that up in a lookup table that corresponds to certain waveforms. I want to empirically sample several sequential different waveform samples, and have them stored in a table, and perform a go, no-go check on subsequent samples as being similar.

I've seen several waveform GUI's, that I can perhaps modify a bit to do what I'd like, but was wondering if the forum had any other ideas on how to best approach this. I would need the ability to add points as needed on the curve, as well as set the X and Y range and resolution.

Since a picture is worth a 1000 words and all that, I've included a .fsm that illustrates what I'm talking about. Obviously its non-functional, but I'm using the wire to illustrate how the waveform can be manipulated. Anyone know of an example I can use to modify to do this?

Heck, if anyone knows of a third party application that can generate data from a drawn waveform, would be useful, even if I had to purchase it.
Thanks in advance for any help.

Re: Generate data set from curve

Posted: Tue Oct 29, 2013 10:43 pm
by billv
fixstuff555 wrote:would like to generate a table of data points, from an arbitrarily drawn waveform curve

Use 'draw wave osc", attach text prim to float array output...that's your table of data points..
X/Y Range is there but can be tricky to modify.....
The FS 'draw wave osc' uses ruby for the graph draw, and "it" advises that adding point data
to view is not effecient.
So to view the points on the wave, best probably to use the old SM draw wave,
has the points set up, and works great.
Hope this helps....

Re: Generate data set from curve

Posted: Wed Oct 30, 2013 12:32 am
by nix
spline draw.fsm
(378.69 KiB) Downloaded 938 times

Here is the one MyCo built, that billv is referring to.
There is my mod there too.
IIRC there is something wrong with the preset recalling in the green & white one.
The grey one is my mod that fixes this.

Hope it speeds ur development

little edit-
AFAIK the wave is only 512 points long. I was resampling/interpolating it to 2048
If anyone can get this to be more than 512 samples long before resampling,
I would love to have that in my toolbox.
If you make it more than 512 points /samples long,
it glitches the last 16th of the form

Re: Generate data set from curve

Posted: Wed Oct 30, 2013 5:56 pm
by fixstuff555
Both of those examples are great. thanks.