1
$\begingroup$

I am writing an FM/PM synthesizer, using Java. For the most part it works pretty well. What I am curious about is an attempt to use a low frequency tone as a carrier. By low frequency, I mean in the vicinity of 1 Hz. I use this a lot in my FM-synth coding as it warms up/thickens the output via the slow beating of overtones that occurs between sidebands.

The result I am getting sounds similar to the output of the Yamaha DX7S, and even closer to the output of the Native Instruments FM7 (I am behind an upgrade or two). My favorite sound, though, is the DX7S result. In trying to find out the nature of the differences, I recorded and examined output from all three with Audacity.

Below are three pairs of images from Audacity from three sources. In each case, the carrier is 1Hz and the modulator is 440Hz. 1) Yamaha DX7S 2) Native Instruments FM7 3) Java that I coded.

I tried to get the amplitudes and timbres to roughly match before making these recordings, though didn't go to a lot of trouble in that regard. (All of these have a sort of "wooo" lower format quality, somewhere between "boot" and "boat.") I was using a modulation factor of 200 in the Java version, where the size of the lookup table is 1024 units, containing one period in the range -1 to 1. The DX7S and FM7 both use a number in the range 0..100 for designating the modulation Index, but they don't seem to be defining them in the same way. The FM7 is set to "38" and the DX7S is set to "84".

1) Yamaha DX7S DX7S, wave, Modulator 440Hz, Carrier 1Hz

DX7S, frequency analysis, Modulator 440Hz, Carrier 1Hz

There is noise from the unit itself and from the external mixing gear it is running through. But there is no prominent low Hz frequency component compared to the following diagrams.

2) FM7 FM7, wave, Modulator 440Hz, Carrier 1Hz

FM7, frequency analysis, Modulator 440Hz, Carrier 1Hz

3) My Java coded phase modulation Java, wave, Modulator 440Hz, Carrier 1Hz

Java, frequency analysis, Modulator 440Hz, Carrier 1Hz

I like the sound of the DX7S effect the best. I'm noting that the FM7 also has a large low Hz component in the frequency analysis, and so am wondering if perhaps Yamaha was using some sort of high-pass filtering.

Below is the core Java code that I'm using for the phase modulation. It is being called once per audio frame (44100 fps), and makes use of a lookup table.

public float get(float modulationAmt)
{
    cursor += pitchIncr;

    // Handle sine LUT overshoot by wrapping around
    while (cursor >= tblSize ) cursor -= tblSize;

    // Phase modulation requires we do not directly modulate
    //    the cursor.
    temp = cursor + modulationAmt;

    while (temp < 0) temp += tblSize;
    while (temp >= tblSize) temp -= tblSize;

    return SineTable.get(temp); 
}

Any thoughts as to what might be going on? The visual wave makes me wonder if there is DC bias of some sort happening, even though phase modulation is supposed to eliminate 0 Hz energy, if I read the Schottstadt article correctly (easy for me to misread, as it overshoots my math comprehension).

Is there an efficient way to eliminate the 1Hz component without removing the desired beating of sidebands? If Yamaha had accomplished this in the 1980's I'm thinking the algorithm must have been pretty minimal. For example, I have read that in some contexts, a simple "box" filter of 2 frames was used to help prevent aliasing. I haven't verified this though, and a box filter is low-pass, not high-pass. But maybe a box filter with a large number of frames can be inverted, or something like that, to make a "cpu cheap" high pass filter?

Or maybe that large low Hz peak can be ignored and isn't really relevant to the sound differences I'm hearing. But on general principles it seems to me having a large amount of "unheard" energy or output could potentially be asking for problems.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.