Step 4Now some sound!
The modulator component is an actually an oscillator. Frequency and amplitude are both adjustable like a VCO and VCA in a real analog synthesizer. The wave form is always sinusoidal, but there are ways to alter it- more on that later.
The frequency limits are set by the mark and space parameters. Mark is the frequency when the FM input voltage is 1V and space is the frequency when the FM input voltage is 0V. The output frequency is a linear function of the FM input voltage, so the frequency will be half way between the mark and space frequencies when the FM input voltage is 0.5V and will be 2x the mark frequency when the FM input voltage is 2V.
The modulator can also be amplitude modulated via the AM input pin. The modulator (oscillator) output amplitude will match the voltage applied to the AM voltage input. If you use a DC source with a voltage of 1, the output amplitude will be 1V (that means it will swing between -1 and +1 V).
The modulator has two outputs- sine and cosine. The waveforms are exactly the same except they are 90 degrees out of phase. This can be fun for stereo audio applications.
There is a .tran statement that tells the simulator the maximum time step and the duration of the simulation. In this case, circuit-time (total simulation time) = audio file time. That means if you run the simulation for 10 seconds you'll get an audio file that is 10 seconds long.
The .save statement is used to minimize the amount of data the simulator will save as it runs the simulation. Normally it saves the voltages at every node and the currents into and out of every component. That can add up to a LOT of data if your circuit gets complicated or you run a long simulation. When you run the simulation, just select one voltage or current from the list in the dialog box and the data file (.raw) will be small, and the simulation will run at maximum speed.
Finally, the .wave statement tells the simulator to create a CD quality stereo audio file (16 bits per sample, 44.1 ksps, two channels) putting the voltage at "OUTL" in the left channel and the voltage at "OUTR" in the right channel. The .wav file consists of 16 bit samples. Full scale output in the .wav file (all 16 bits in a sample turned on) occurs when the voltage being output is exactly +1 Volt or -1 Volt. Your synthesizer circuit should be set up to generate voltages no more than +/- 1V out to each channel, otherwise the output in the .wav file will be "clipped" whenever the voltage exceeds +1 or -1 V.
Since we are making an audio file that is sampled at 44.1 ksps, we need the simulator to simulate the circuit at least 44,100 times per second, so we set the maximum time step to 1/44,100 sec or about 20 microseconds (us).
dizzy.asc1 KB| « Previous Step | Download PDFView All Steps | Next Step » |













































Musicians probably wouldn't bother, but it can be used to make a high resolution test CD or can be used as a signal source for electronic testing. It can also be used to test the response of a circuit you want to simulate, say a crossover for an audio system, etc.