Main siteMain site  ForumForum  ForumSearch  Private messageEmail contact  RegisterRegister  Log inLog in 
Topic: Retrieving/Keeping momentary phase of simulator signal
Reply to topic
Author Message
Marius



Joined: Jun 10, 2013
Posts: 51

PostPosted: Jul 8, 2013 2:54 PM    Post subject: Retrieving/Keeping momentary phase of simulator signal

Hi Jarek,

is it possible to retrieve the momentary phase of a sinus signal from a SimulationSource?

My goal is changing the frequency of a simulator during runtime while keeping the phase. The above question targets on retrieving an setting the momentary phase, but it would even easier if the phase would be kept during the frequency change.
For changing the amplitude it works already by chosing Post actiion - none , but not for frequency.

Marius
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Jul 8, 2013 6:02 PM    Post subject:

If the Simulator is generating a pure sine signal of a known amplitude, then you can calculate the phase in ExpressionEvaluator using the generated value, previous value and Math.asin (or Math.acos) function.

If you want to change the frequency it might be a good idea to do this when the output value is 0. But this might not be easy (or even possible) if you need to keep a perfect continuity of the signal.

The Generator can do this. It changes both amplitude and frequency gradually, it works great for audio generation. I am not sure it could replace Simulator.


Marius



Joined: Jun 10, 2013
Posts: 51

PostPosted: Oct 10, 2013 8:00 PM    Post subject:

I tried with generator.
It produces an extremely high output rate which is unimpressed by whatever value I set in the \"output sample rate\" field.
Is this a know issue for you?
jarek



Joined: Oct 22, 2007
Posts: 1073

PostPosted: Oct 10, 2013 8:26 PM    Post subject:

Generator is only for sound/audio creation, it should be used with PCMAudioPlayer (see BioEra examples). The output sample rate worked the last time I used it.
Reply to topic