Page 5: Frequency modulation, waves and inverted mode
Frequency modulation
![]()
It will probably not come as a surprise to you that in order to use frequency modulation we have to connect a wave generator to the frequency connector of another wave generator. We will now also modulate the frequency of the signal produced by the generator that already gets its amplitude modulated. In order to do this you should now place a generator in cell Y18, which you find to the top left of the generator that is connected to the speaker. After that, you connect its output connector to the frequency connector of the generator in cell Z19. Your setup should then look like shown here. You should listen to the sound and notice that it has changed to a lower frequency. Next we're going to use another wave than the Sinus in order to get to understand how this frequency modulation works.
Every wave generator comes with a number of predefined waves for you to choose from. Each wave has its own way of assigning a position to the membrane in your loudspeaker for each point in time. You can choose another wave by opening up the Waves menu in the controller. If you position your mouse cursor over the New item a list of waves will appear. Do this now for the newly created generator. For the purpose of this tutorial you should pick the Round wave. You can then see how the viewer shows another wave. The default setting for a Round wave is to run over an interval ranging from -5.0 to 5.0, but starting at 0.0. So at first, the wave generates all zero's, since all numbers from 0.0 up to 0.5 will be rounded down. After that it produces all ones, since all numbers from 0.5 to 1.5 will be rounded to one. And so it will continue, resulting in the stairs like curve you see now.
At this point you could also look at the other controllers you have open, and notice that the modulated signal has changed a bit, since it now gets its frequency modulated, whereas the wave that takes care of the amplitude modulation has not changed at all. This is ofcourse as it should be. Listening to the sound again will show you that the Round wave does indeed produce another sound than the Sinus wave did.
![]()
Frequency modulation works in the same way as amplitude modulation does, except that it is the frequency that gets modified, and not the amplitude. So when a signal that is used for frequency modulation reaches its absolute minimum, the signal it modulates runs at a frequency of 0 Hz. And when the modulating signal reaches its absolute maximum the modulated wave will run at the frequency that was specified for that wave.
To clearly demonstrate this we're going to change the frequency of the Round wave. We have this sound that gets turned on and off once each second, and we have this stairs like wave, that takes on the same value for some period of time, so couldn't we change this period so that each time the sound gets turned on and off it does so at a different frequency? Ofcourse we can, and it is actually not that hard to do. The Round wave is defined at the moment on an interval of -5.0 to 5.0, which equals eleven steps on the stairs, so only if we could make it run with ten steps and then set the frequency to 0.1 Hz, then it would run at a cycle with a length of ten seconds and change its value each second.
So let's try to make this work. First we set the frequency to '0.1'. Then we listen to the sound. You'll notice that we're kind of close. Except that the pitch of the sound changes in the middle of each second when the sound is turned on. We would like to have it change its frequency while the sound is turned off. For that to happen we will examine the curve of the Round wave, which is also shown here. Notice that the time interval for the viewer has been set to 0.05Hz so that it shows exactly two cycles again. If you also do this you will notice that it takes quite long for MathSounds to come up with the requested curve. This is because it now has to calculate twenty seconds of sound. It can ofcourse only show a curve after it has calculated it. You can always see from the running clock in the main window when MathSounds is busy calculating something. While it is doing that, there's many things you can't do, like for instance place a new generator. This can be annoying, so you can always stop MathSounds from doing what it is doing by hitting the Stop button. You won't get to see all the graphs then, but it will allow you to continue working.
![]()
When you are not interested in the curves, then there are two other ways to stop MathSounds from taking this long to calculate them. The first one is ofcourse to not ask it to calculate long time intervals. The other one is to open up the Viewers menu in the main window, move your mouse cursor over the Frozen item until another menu appears and then check the 'Frozen when not playing' option. MathSounds will then never draw any curves when you are busy creating a setup.
Let's get back to examining the graph. You'll notice that the stairs counts eleven steps, from bottom to top, with the bottom and top step each being half the length of the other steps. With a frequency of 0.1 Hz this should change to ten steps of equal length in order to get a sound that changes its pitch once a second. The problem is in the start and the end of the interval. When the wave is at -5.0 it produces -5.0 as a result, and it will do so until it reaches -4.5. Then it will produce 4.0 while it covers the distance from -4.5 to -3.5. So you see these intervals are of different length. To make all steps of equal length you should change the interval to range from -4.5 to 5.5. That way they're all of length one, and at the same time the number of steps is reduced to ten, as you can also see from the graph shown here.
If you listen to the sound now you'll notice we're still not there yet. Each tone lasts equally long, but the pitch is changed exactly in the middle of a second. If you look at the graph again, you'll see this is logical, since the first step is still half the length of the other steps. The last problem to solve is adjusting the start point. If you set this to -4.5, then you'll have a first step that is equally long to all other steps, while at the same time the sound will nicely start at its lowest pitch.
Now you should look for a while at the viewer of the generator whose wave gets modulated while the sound is playing. You can see then that its amplitude gets modified exactly in the same way it did before, but from the everchanging shape of the curve you can see that its frequency gets modified also.
![]()
The next thing you can do is to stop the sound and set this viewer to a time interval of '0.1Hz'. This matches exactly one cycle of the Round wave that takes care of the frequency modulation. You'll see a graph like the one shown here, which clearly shows that the amplitude and the frequency gets changed ten times over a time period of ten seconds.
We're going to end this example about frequency modulation, that was intended to clarify the concept by letting you actually work with it, by doing something that might at first be a bit confusing, but that is nevertheless very logical. You should now change the amplitude of the Round wave to 100 and then listen to the sound. You'll notice that the amplitude of it hasn't change a bit, but that instead the pitches have changed, so that its lowest tone is lower then it was, and its higher tone higher. That is because you haven't changed the amplitude of the sound, but the amplitude of the wave that takes care of the frequency modulation, thereby increasing the range of the frequencies the modulated wave can take on.
Finally you should change the time interval of the viewer of the modulated signal to '30Hz' and look at the graph while the sound is playing. You can clearly see the amplitude change over time, but also the frequency, because the number of cycles of the Sinus wave it shows changes with every tone. We're now going to pay some more attention to inverted mode, before moving on to the concept of asynchronicity. If you think the sound we have created is nice, and you might want to listen to it again, or use it as the basis for a larger setup, then you should now save it, because we're going to change it. You can save a sound from the File menu in the main window.
Inverted mode revisited
![]()
Since inverted mode is a way to let a wave generator take into account that some of the values it gets fed for modulation are negative, you can't use inverted mode to change the way the frequency gets modulated. If a negative number were to modulate a frequency we would get negative frequencies, and that is impossible. You can't ask a loudspeaker to take back some of the air vibrations it produced. So switching a generator to inverted mode will only change the way its amplitude gets modified. Yet we will see that inverted mode can very well be used to change the way frequencies get modulated, by using it to change the way the amplitude gets modulated of a generator that is used for frequency modulation.
In order to do this we're first going to do something that might seem a bit pointless.
You should now add a generator to cell X19, change its wave to a Sign wave, and connect its output connector to the amplitude connector of the generator that produces the Round wave, the one that takes care of the frequency modulation. Your setup will then look like shown here.
A Sign wave is a wave that takes on a value based on the sign of its argument. If the argument is negative it will be -1, if the argument is positive it will be 1, and when the argument is zero it will be zero. So in the default case, where a Sign wave runs on interval ranging from -1.0 to 1.0, it will produce -1 when it is between -1.0 and 0.0, it will be zero when it hits the zero point (which will most of the time not happen), and above zero it will produce +1.
Now set the Sign wave to run on an interval that starts at -1.0 and ends at -1.0. This probably seems a bit strange, since this is no interval, just one point, but that is exactly what we want to do, we want this generator to produce the absolute minimum value all the time. So you should also set the amplitude to 100, to guarantee this. Now the viewer shows a straight horizontal line at the bottom of its display. You can't get a value lower than this.
Notice that the start point for this one point interval has automatically changed to -1.0 as well. MathSounds will always make sure that the start point is within the specified interval. The start point is a subordinate value, it will never stop you from changing something else, it will always adapt, whereas the start and the end of the interval will never be changed automatically, so they can stop you from entering certain values. We saw an example of that when we tried to change the interval of a Sinus wave.
Now open up the controller for the Round wave and notice its curve has changed to a straight line as well, except that this one coincides with the X-axis. This is according to the rules of amplitude modulation: an input of the absolute minimum will result in a wave of zero's, like it is multiplied by zero.
![]()
This all seems very pointless. If you listen to the sound now you'll notice that all the different tones have gone, we're back at one tone being switched on and off each second. You might however notice that now the pitch is lower than it was at first. You can also verify this by setting the viewer of the generator in cell Z19 to a time interval of '440Hz' and play the sound. You'll see exactly one cycle of a Sinus wave being turned on and off, so this is a wave at 440 Hz. Now take a look at the frequency that you have set for this generator. It is at 880 Hz. And all of this is exactly as it should be. The signal coming from the Round wave is in its middle position all the time, at zero, exactly at equal distance from the absolute maximum value and the absolute minimum value. At the absolute minimum value frequency modulation should result in a frequency of 0 Hz, while at its maximum value it should produce a frequency equal to the frequency set, 880 Hz in this case, so being halfway it should produce half of the maximum, which is 440 Hz.
And finally we get to the point where it becomes clear why we are doing all this. Now open up the Round wave again, switch on inverted mode, wait a bit, and see a graph appear as the one shown here. We've got our stairs going downwards, instead of upwards. It really is inverted. Listen to it and you'll hear that it now runs from a high pitched tone to a base tone.
So what is happening? In inverted mode a signal that is negative will be treated as a negative signal, so all values produced by the wave will be switched to the other side of the X-axis, like they are multiplied by a negative number, whereas in non-inverted mode a negative signal will be turned into a positive signal, only reducing the amplitude of the modulated wave.
This concludes the discussion on frequency modulation and inverted mode. On the next page we will turn our attention to asynchronicity.
Page 1: Introduction, news and installation
Page 2: Tutorial: creating a simple sound
Page 3: Modulation: wave generators working together
Page 4: Inverted mode and the interval of a wave
Page 8: Manual: the main window
Page 13: Release notes, known bugs and issues
If you can't find a button to download MathSounds try
Please send your questions, comments or remarks to info@mathsounds.com