I'd expect the spectrum to look like a spectrum of the saw waveform with the fundamental frequency having the highest amplitude. However, the amplitude of the fundamental frequency is 20 dB lower than the amplitude of the second harmonic, as can be seen in the following screenshot. I use windows_x86_64/sunvox.exe version 1.9.5d.
For comparison, here is a correctly looking spectrum of the saw waveform:
strange spectrum from the FM module
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: strange spectrum from the FM module
Why? FM is not equal to saw waveform :)I'd expect the spectrum to look like a spectrum of the saw waveform with the fundamental frequency having the highest amplitude.
It depends on the M.Sustain value. Please try to set it to 159 or lower values
Re: strange spectrum from the FM module
Thank you for the advice! Indeed, when M.Sustain and M.Volume are set to 32, and M.Feedback is set to 0, I get a waveform and spectrum that look more or less the way I expected:It depends on the M.Sustain value. Please try to set it to 159 or lower values
For comparison, here is what I expected:
Re: strange spectrum from the FM module
I thought it was possible to obtain a waveform similar to a sawtooth or square, using one carrier and one modulator with feedback.Why? FM is not equal to saw waveform
I've just done a few tests with a simple Python script (it's in the attachments to this post) that simulates one carrier and one modulator with feedback. Here is what I get with 100% modulation index and 100% modulator feedback:
However, when I try to get something similar by increasing the M.Feedback value, I cannot obtain what I expect:
- Attachments
-
- fm_test.py.txt
- (930 Bytes) Downloaded 126 times
Re: strange spectrum from the FM module
I've just checked the source code of the FM module at this link and I think that I now understand how the M.Feedback parameter is used.
The algorithm implemented in the FM module can be written as
So, what is called feedback in the code of the FM module is not actually feedback, but an additional modulator running at the same frequency as the first modulator. This additional modulator is modulating the first modulator. The M.Feedback parameter is the volume of this additional modulator.
To implement the modulator feedback the algorithm should be changed to
Here are two diagrams illustrating the difference between the current implementation and the modulator with feedback:
The algorithm implemented in the FM module can be written as
Code: Select all
fb = sin(mphase) * mfeedback
cval = sin(cphase + sin(mphase + fb) * mvol)
To implement the modulator feedback the algorithm should be changed to
Code: Select all
fb = sin(mphase + previousfb * mfeedback)
cval = sin(cphase + previousfb * mvol)
previousfb = fb
- NightRadio
- Site Admin
- Posts: 3955
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: strange spectrum from the FM module
Thanks for the detailed analysis!
I plan to update the FM module in one of the new SunVox versions. I will take into account your remark regarding the feedback.
I plan to update the FM module in one of the new SunVox versions. I will take into account your remark regarding the feedback.