Page 4: Inverted mode and the interval of a wave
Inverted mode
![]()
In the definition of amplitude modulation, given on the previous page, it was stated that when the signal that is used for modulation reaches its minimum this results in an amplitude of zero in the modulated signal. But it has also been said that MathSounds does its calculations with positive and negative numbers. You've also learned that a negative amplitude can be used to invert the output of a generator. So why wouldn't MathSounds be able to calculate amlitude modulation in such a way that negative numbers in the modulating signal would cause the modulated wave to be inverted? The answer is that this is actually possible, and it is done by switching the generator that gets its wave modulated to inverted mode. In inverted mode, when the modulating signal is zero, the modulated signal is also zero, and when the modulating signal reaches the highest positive number, the modulated signal will have its maximum amplitude given the point it has reached in its own wave at that time. And this is true also for the negative maximum, which means that the modulated signal gets inverted then.
You can switch a generator back and forth between inverted and non-inverted mode in the Modulation menu of the controller for that generator. You should try this now. Go to the controller for the generator that is connected to the speaker and switch it to inverted mode. The resulting graph will look like shown here.
This whole inverted mode thing might be a bit difficult to understand, so we won't dwell on it too much. I'll just give a brief explanation of what is happening, hoping you will then understand it a bit better. Looking at the graph and listening to the sound you might notice that in inverted mode the sound doesn't go louder and return to silence once every second, but it does so twice every second. You can understand this if you take a look at the graph of the generator that is set to 1 Hz, the one that provides the signal that modulates the other generator.
At the starting point, all the way to the left, the modulating signal is zero, which means that the other signal also is zero, as you can see from its graph. In the first half second the signal of the modulating generator climbs up to its maximum and returns back to zero, which results in the output of the other generator to go to its maximum and then also return to zero. The next half second the same thing happens, except that the modulating signal is negative, but as we have already seen, an inverted wave will sound exactly like its non-inverted counterpart. Thus, switching to inverted mode will, in this case, double the speed at which the sound turns on and off.
More can be done using inverted mode, so we will briefly return to it later. For now we'll leave the subject and turn to something else: the interval of a wave.
The interval of a wave
![]()
Take a final look at the graph shown at the top of this page, the one that shows the modulated signal, and notice how nicely it starts at zero, meaning that when this sound starts, it will start with silence and will then increase its loudness. Now switch this generator back to non-inverted mode. You will again see the graph as shown here. Now notice that it doesn't start with a zero value, meaning that when this sound starts it kind of jumps right in the middle of it all. Wouldn't it be nice if we could let this sound also start with silence and then let it increase its loudness gradually? Well, you can, using the interval input fields you might have noticed at the bottom of the controllers, called 'start of interval', 'end of interval' and 'start point'.
Let's take a look at what that means: an interval.
First of all we'll have to spend some words on mathematical functions. MatSounds creates its sounds using functions, which we call waves in this documentation. A wave assigns a value on the Y-axis to every value on the X-axis, so that for each point in time MathSounds knows to what position it should move the membrane in your loudspeaker. Read back the information about the axes of the viewer on page 2 if you don't understand this. Up until now we have been using a Sinus wave to do this. MathSounds comes with more kinds of waves, which we will discuss later. A Sinus wave gives this nice rounded curve we've seen so far.
In MathSounds every wave has to be defined on an interval, for the program to be able to know when a cycle is complete and it should start over again. So, for instance, an interval could be defined ranging from -1 to 1. MathSounds will then divide this interval in the number of parts it needs to be able to produce the frequency you request of it, and then calculate over time what value it should assign to each part. When it reaches the end of the interval, in this case 1, it will then jump back to the start of the interval and start all over again.
Every wave has its own special requirements when it comes to the interval you can specify. The manual will give you more information about this, but you can also just try things. MathSounds will always warn you when you do something wrong and then tell you what it is that you did wrong. For now you should know that a Sinus can accept any interval that is not larger than two times pi.
Pi is a mathematical constant. It always has the value of roughly 3.14, so two times pi equals roughly 6.28. This might seem a bit difficult, and you might wonder why it has to be this difficult, but unfortunately pi is really needed to specify usefull intervals for a Sinus wave.
![]()
The input fields for the interval of waves that can make good use of 'pi' are bi-modal, like the time interval field for the viewer is, but in this case, in stead of using 'Hz' you can use 'pi' to specify a number. Also, in both cases, you can easily switch back and forth between notations. Take a look at the input field 'end of interval' of one of your controllers. It shows '2.0pi'. If you now enter something it can't accept, like for instance the letter 'k', and hit Enter, then you'll get an error message telling you that this is not acceptable input, but if you click that away you can see that the input field now shows roughly '6.28', which equals two times pi. To switch back to pi-mode you can just type 'pi', hit Enter, and again, after the error message, it shows '2.0pi'.
In order to understand why our non-inverted modulated signal doesn't start with a value of zero we again take a look at the graph of the generator that sends the signal that modulates it. It is shown here also, for your convenience. You can see that it starts with a value of zero, but we have seen before, zero does not mean no current in the modulated signal. For that to happen the modulating signal has to be at its absolute lowest value. So all we have to do is make it start with its absolute lowest value, and you can see this point in the graph, only after it has travelled three quarters of its cycle. So we should change the interval so that it starts there.
![]()
There are actually two ways of doing this. The easiest one is to change the 'start point'. If you look closely at the curve you might notice that it is divided into four clearly distinct parts. At '0.0pi', which equals zero, the Sinus wave is zero. At a quarter of its interval, which equals '0.5pi', it reaches its maximum. It returns back to zero at '1.0pi', and at '1.5pi' it achieves its lowest value. Then at '2.0pi' it is back where it started and the cycle will start over again. So one way of letting the Sinus wave start at its lowest point is to set the 'start point' to '1.5pi', telling the generator that the first time it starts to go through its cycles it should start at '1.5pi' and produce its lowest output.
The other way of achieving this is to entirely change the interval of the Sinus wave. As you can see the Sinus wave is cyclic, so if it reaches its lowest value at three quarters of its cycle, at '1.5pi', it will also do so at '-0.5pi'. You can see this if you imagine the curve continuing to the left of the starting point. So what we have to do is change the 'start of interval' input field to '-0.5pi', the 'end of interval'input field to '1.5pi', and the 'start point' to '-0.5pi' as well. This is however a bit tricky, because the length of the interval of a Sinus wave cannot be larger than '2.0pi', so to avoid an error message you first have to change the 'end of interval' field, and then the 'start of interval field'.
Whichever way you choose, after the change your graph should look like shown here, nicely starting at its lowest point. Now you can listen to the sound and you will hear that it starts with silence and then increases its loudness. You can also see it from the graph of the modulated generator. It really starts with no sound.
On the next page we're going to examine frequency modulation. Doing that we're going to work with another wave than the Sinus, and finally some more words will be spend on inverted mode.
Page 1: Introduction, news and installation
Page 2: Tutorial: creating a simple sound
Page 3: Modulation: wave generators working together
Page 5: Frequency modulation, waves and inverted mode
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