# Tutorial: Simulating a Guitar Amplifier Signal

Learn how to define a circuit block and run a transient and frequency-domain analysis for a guitar amplifier.

## Files for This Tutorial

Amplifier directory.

The files required for this tutorial are available here: <installation_directory>/tutorial_models/Amplifier/...

## Overview of a Guitar Amplification Problem

The following is a guitar amplification problem, which is presented here courtesy of https://fais-tes-effets-guitare.com/conception-dune-pedale-boost-a-ampli-op/:
This tutorial shows you how to address the amplification problem by performing both a transient and AC simulation inside of Activate given the following:
• Circuit model: opamp_model.scm
• Circuit model: opamp_model_AC.scm
• Spice Library: opamp

The opamp Spice library contains the following block definition and schematic used in the circuit models.

Opamp.cir:
*
.SUBCKT OPAMP1 1   2   6
* @ACTPO: 3
* INPUT IMPEDANCE
RIN	1	2	10MEG
* GAIN BW PRODUCT = 10MHZ
* DC GAIN (100K) AND POLE 1 (100HZ)
EGAIN	3 0	1 2	100K
RP1	3	4	1K
CP1	4	0	1.5915UF
* OUTPUT BUFFER AND RESISTANCE
EBUFFER	5 0	4 0	1
ROUT	5	6	10
.ENDS

OPAMP1.svg:

## Import the Opamp Block

1. Copy <installation_directory>/tutorial_models/amplifier into a working directory.
2. In the OML Command Window, enter the following: vssImportSpiceLibrary command; path to the opamp folder; and path to a designated folder that the import command will use to generate files for the library:
 vssImportSpiceLibrary('<working_directory>/opamp/', 'c:/temp’)

A new palette with the OPAMP1 block is created:

## Open the Amplifier Model

Select File > Open > opamp_model.scm.
The model opens with the imported OPAMP1 block.

## Run a Transient Analysis

1. For the simulation setup, keep the default values.
2. On the ribbon, select Run.
3. Select the Scope block, then view the results.
The Scope shows the input and output of the amplifier.
4. Experiment and change the parameter values in the components such as the Resistor and Capacitor.
5. Run the simulation again and observe the changes in the input and output.

## Set Up a Frequency Analysis

To set up a small signal frequency analysis, select a source block in the circuit model and define it with AC parameters.
1. Select File > Open > opamp_model_AC.scm.
2. Double-click the SuperBlock.
The SuperBlock has the same schematic as the transient model, opamp_model.scm, but with a potential sensor and additional output.
3. Select the VoltageSin block.
This is the block that provides the small signal source for the circuit when the AC analysis is launched.
4. Select the AC tab and the Use AC option.
Review the parameters and keep the default values.

5. Double-click the Spice AC Analysis block.
The AC Analysis block contains the parameters and controls to perform an AC simulation.
Note: The AC Analysis block is found in the Spice > Tools palette.
6. Review the setup for the AC analysis.
AC Analysis Parameter Description
Block name Enter SuperBlock. This block specifies where the Spice circuit is defined for the AC analysis.
Frequencies Method Select DEC, which defines the range of frequencies by the power of 10.
Frequencies Range Enter:
• Minimum frequencies = 10Hz
• Maximum frequencies = 10000 kHz
• Number of points to be computed per decade = 1000.
Results and Plots Enter:
• Frequency Scale = Logarithmic
• Amplitude Scale = Linear
• Phase Results = Degrees
AC Analysis Enter:
• Analysis at time = 0
Your setup should look like this:
7. Click the Execute button.
The simulation runs directly from the Spice AC Analysis block.

## Review the Frequency Analysis Results

1. Review the frequency response of the amplifier signal.
The Scope block in the model shows the magnitue and phase of the potential sensor of the amplifier signal:
2. Experiment by modifying the component values and rerun the simulation.
Compare the results from the opamp_model_AC.scm in reference to the textbook example shown at the start of this tutorial: