Project 3: Common Emitter Amplifier
Overview

The purpose of this project is to give you some experience in creating a function generator and in computing the gain of a common emitter amplifier circuit.

Step

user-interface (2).jpg

The top figure shows the user interface for this project. You can get the skeleton of the code.

  • You need to write your code to simulate the function generator in Calculate.cpp which contain the following codes:

//****************************************************************************
//
// * Generate the input voltage
//   Type: 0 for sine, 1 for square wave (duality cycle 50%) and 
//         2 for triangle wave
//   amplitude is the amplitude of the function
//   phase: control the offset in radian (0 ~ 2 pi)
//   t: the current time
//   delta_t: the time interval between two consecutive samples
//   nSamplesToKeep: how many samples in the array
//   wave: the wave samples
//============================================================================
void Calculate(int type, double amplitude, double frequency, double phase, 
               double t, double delta_t, int nSamplesToKeep, vector<double>& wave)
//============================================================================
{
        // TODO
        I = Vo = Z = 0;
}

  • You also need to write the code to compute the output signal
//****************************************************************************
//
// * Compute the output waveform in the common emitter amplifier setting
//   nSamplesToKeep should be equal to wave.size()
//============================================================================
void Compute(double R1, double R2, double RC, double RE, double beta, 
             int nSamplesToKeep, vector<double>& wave, vector<double>& output)
//============================================================================
{

}

How will we grade it?

You will send a rar files containing only Calculate.cpp and CommonEmitter.exe to TA(何柏輝). We will grade your code accordingly and check whether you have copied others' code.