Hi Alexandre,


about FM and PM (probably my reply is late!), here's a simple implementation using oscillators with sync(0):

// m = mod osc;  c = carrier osc;
SinOsc m => Gain g => SinOsc c => dac;
Step cm => g; //cm = carrier freq in Hz


while( true ){
    modInd(10, 250); //arg: modInd, freq mod
    cm.next(500); //carrier frequency
    second => now;
}

fun void modInd( float i, float f ){ //arg: modInd, freq mod
    float am;  

    i*f => am; //(modInd = Am/Fm), then (Am = modInd*Fm)
    m.freq(f);
    m.gain(am);
}

this is the simplest modulation, that usually is considered as FM, but in the end is a PM.

without going into details, what's happening is:

FM (t)=sin(ω c t +Φ c + I sin (ω m t +Φ m ))

with ω c = carrier freq, ω m = mod freq, Φ = phase


Cheers,
Mario


On 04/06/17 07:34, Alexandre Torres Porres wrote:


2017-06-04 2:35 GMT-03:00 Alexandre Torres Porres <porres@gmail.com>:

It's not easy to explain, but you found the magic number/formula that makes Frequency modulation sound like Phase Modulation. 

Actually, I shouldn't have said this, I don't wanna give you the idea it comes down to this, but there are just too many details I didn't want get into, sorry. What I can say is that you got pretty close, not 100% there yet, and that is not as simple as just doing this every time, it gets more complicated.

Sorry again for not getting into the math and everything. What I'd like to add is that people use phase modulation instead of trying to replicate it via frequency modulation cause it's just more convenient to do directly via phase modulation if you want it to behave like that.

cheers




_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users