Difficulties in transferring formulas in Ruby.

For general discussion related FlowStone
Post Reply
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Difficulties in transferring formulas in Ruby.

Post 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?
Tronic
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Difficulties in transferring formulas in Ruby.

Post 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..
borodadada
Posts: 47
Joined: Sun Jun 02, 2013 5:58 pm

Re: Difficulties in transferring formulas in Ruby.

Post 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
Post Reply