//Modulation-PAM.dsp
//Copyright www.aubraux.com
//DspSee sample file. Shows generation of pulse amplitude modulation with SigGen module.
//Requires SigGen and Plot modules.
|
| //Pulse Train Generator | |
| load wc="SigGen" | //Loads the SigGen module. This module can generate waveforms of different shapes. |
| wc.type="pulse" | //Sets signal type |
| wc.freq=10.01M | //Sets frequency to 10.01 MHz |
| wc.pk2pk=2 | //Sets peak-peak voltage to 2V |
| wc.offset=0 | //Sets DC offset voltage to 0V |
| wc.mod.type="pam" | //Sets modulation type |
| wc.gui.more=1 | //Shows more advanced settings |
| wc.gui.wnd="sg" | //Sets the gui window name |
| wc.gui.title="Pulse Setup" | //Sets the gui window title |
| wc.gui.move(500,0) | //Moves the window to (x=500, y=0) |
| |
| //Modulating Signal Generator | |
| load wm="SigGen" | //Loads the SigGen module. This module can generate waveforms of different shapes. |
| wm.set("sine",999K,1000,100M) | //set(signal type, frequency, record length, sample rate) |
| wm.pk2pk=2 | //Sets peak-peak voltage to 2V |
| wm.offset=0 | //Sets DC offset voltage to 0V |
| link wc.mod.src=wm.out | //Links wc synth's modulation input port to wm synth's output port |
| wm.gui.wnd="sg" | //Sets the gui window name |
| wm.gui.title="Mod Signal Setup" | //Sets the gui window title |
| wm.gui.move(500,0) | //Moves the window to (x=500, y=0) |
| |
| //Plot | |
| load p1="Plot" | //Loads the Plot module. This module can display input data in various formats. |
| p1.plot.title="Plot Window" | //Sets the title of the plot window |
| p1.setup.title="Plot Setup" | //Sets the title of the plot setup window |
| link p1.src.ch1=wm.out | //Links the mod signal output to Plot input |
| link p1.src.ch2=wc.out | //Links the carrier signal output to Plot input |
| p1.ch1.label="Mod Input" | //Sets the Plot ch1 label |
| p1.ch2.label="PAM Output" | //Sets the Plot ch2 label |
| p1.ch1.vposition=0 | //Sets ch1 vertical position to middle |
| p1.ch2.vposition=0 | //Sets ch2 vertical position to middle |
| p1.setup.move(280,0) | //Moves the plot setup gui to (x=280, y=0) |
| p1.plot.move(0,220) | //Moves the plot window to (x=0, y=220) |
| p1.plot.size(1000,420) | //Resizes the plot window to (width=1000, height=420) |
The above schematic is another example of generating pulse amplitude modulation.
As you can see, the schematic based approach is very simple.
Just add the desired modules from the module list, and connect them with the wires
the way you want.
That's it, you are ready for the fun.
Just click on the Run button on the toolbar to view the signal.
Open the file Modulation-PAM.dsp in the Sch folder to load this example.