Page 1 of 1

Difficulties in transferring formulas in Ruby.

Posted: Sun Jul 28, 2013 5:00 pm
by borodadada
Friends, who can be able to help with the mathematical part of the plugin. I need to write formulry in Ruby, but lack the knowledge to convert formulas from mathematics to code for Ruby. If anyone can help I would appreciate.
0.5 COSINE (2π t - 0 π ) = 0.5 COS (2π t ) + 0 SIN (2π t )
http://www.fourier-series.com/fourierse ... index.html

I have the values 0.5 COSINE (2π t - 0 <----This value π ) value comes from the button.
How do I get the value for the second part of the formula?
And as it is written in the Ruby?

Re: Difficulties in transferring formulas in Ruby.

Posted: Sun Jul 28, 2013 7:54 pm
by Tronic
what result do you need?
sample to sample based on the time "t",
or an array of samples for a given length of time?

comunqe in Ruby, there is a Math class
type:
Math::PI = gives you the value of the constant PI
Math::cos (expression or value)
Math::sin
etc..

Re: Difficulties in transferring formulas in Ruby.

Posted: Mon Jul 29, 2013 8:28 am
by borodadada
I wrote a formula that is not quite true, for Ruby, there is one problem.
And I have done in the example, the development of the amplitude of the same thing, because it turns out that the failure to ampliture -3 decibel, that I do not know how to solve it.
Need to show any stereo analyzer.
We need the same thing but without the problems of amplitude. I do not have enough knowledge to write a button that would pass values ​​in accordance with the formula.
I apologize for the quality of the words, I am not English speaking.

PhaseTest1.fsm
File
(8.04 KiB) Downloaded 967 times
Or
http://rghost.ru/47743456 <------ File