Ynzn's Amplitude Modulator + Demultiplexer
by Christiaan Janssen
What's it?
This machine demultiplexes the signals that come from the Ynzn's multiplexer and performs an amplitude modulation with them. It comes with the sourcecode to show other machine developers how to demultiplex two signals, so they can be used in their machines.
How does it work?
First, it copies the signal into two buffers: modulator and carrier.
Then it filters the modulator and the carrier to remove the undesired signal and
reverses the carrier's spectrum. This means it always considers the "Low" signal as
the modulator and the "High" signal as the carrier.
Then it performs the amplitude modulation:
output = modulator * [carrier + 1]
Usage
P a r a m e t e r s
ModCutOff | The cutoff frequency of the modulator's filter (lowpass). It may be changed to avoid aliasing. |
CarCutOff | The cutoff frequency of the carrier's filter (highpass). As before, you can change it to reduce aliasing effect |
AbsFloor | Changes the constant that the machine sums to the carrier. If you want a tremolo-like effect reduce the carrier's volume and raise this parameter. |
Source Code
The source code corresponds to a usual effect machine. It shows clearly
enough the way to separate the modulator and the carrier.
I know I could make it a lot faster, using psamples as the modulator instead of copying it
to a buffer, and I also could reverse the carrier while calculating the amplitude modulation.
But I think this code is more clear to show how the demultiplexion works.
I hope these machines (The Mux and this AM) would be useful for other machine developers.
Notes
The output will have surely a big saturation. To avoid it reduce the
input volume of the signals to -30dB or so. The floor value is divided by 100 for this purpose.
Watch the demosong to see how to connect the multiplexers and this machine. You will notice that
only one multiplexer is needed, and the other one isn't necessary. I've kept it there for the
same purposes as my slow code: to serve as an example
If anyone finds this machine really useful and wants a faster version (and finds it really necessary,
don't expect huge speed changes) mail me and I can compile the fast version. But be sure that
it is really necessary. I don't want to fill everyones' computers with lots of versions of the
same machine.
No known bugs yet.
Author | Christiaan Janssen "Ynzn" |
cjan5813@alu-etsetb.upc.es |