I've just noticed something in an FM engine I made bidule, and I wonder how commercial developers handle it?
A carrier wave is, say 200 hz; a mod wave is 50hz.
If I want to FM the mod wave greater than the carrier wave's centre frequency, frequencies lower than zero end up being 'no frequency', and this introduces artifacts.
How do you normally handle carrier waves going beyond 0 hz? I can envisage a couple of ways to handle it
- a simple wrap of the hz (-10hz = +10hz)
- inverting the wrapped signal (-10 = -10hz)
Or do you limit the boundaries of the FM amount based on the carrier frequency?
cheers
FM developers: how do you handle modulation amounts?
-
- KVRAF
- Topic Starter
- 2462 posts since 15 Apr, 2004 from Capital City, UK
-
Music Engineer Music Engineer https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=15959
- KVRAF
- 4285 posts since 8 Mar, 2004 from Berlin, Germany
how so? they should be just negative values. if your instantaneous frequency becomes negative, it just means that you read backwards through the waveform. if you use a wavetable oscillator, it means your increment will become negative and you will not only have to take care of the wrap-around at N (taken to be the table length) but also 0. something like:frequencies lower than zero end up being 'no frequency'
Code: Select all
while(position >= N) // forward wrap around
position -= N;
while(position < 0) // backward wrap around
position += N;
-
- KVRAF
- Topic Starter
- 2462 posts since 15 Apr, 2004 from Capital City, UK
Reading backwards.. that's what going wrong.. aaah. Many thanks Robin I'm not using a conventional programming language (Bidule) and it seems the oscillators are designed differently; perhaps they do not use wavetables?Music Engineer wrote:how so? they should be just negative values. if your instantaneous frequency becomes negative, it just means that you read backwards through the waveform. if you use a wavetable oscillator, it means your increment will become negative and you will not only have to take care of the wrap-around at N (taken to be the table length) but also 0. something like:frequencies lower than zero end up being 'no frequency'Code: Select all
while(position >= N) // forward wrap around position -= N; while(position < 0) // backward wrap around position += N;
I have now designed a new FM oscillator for bidule using accumulators and sine, and when the accumulator receives a signal below 0, it starts counting backwards and generating the sine in reverse. Quick test in an FM situation and it's perfect! So thanks again
Now I'll add tri/saw/squ shapes in to the mix.