**Lab 1 - Impulse Response of First-order Systems** **[ENGR 12 Spring 2026](index.html)** (#) Background In this lab, you will measure the **impulse response** of several circuit configurations. In lecture, you will learn that the impulse response is the basis for how we understand systems; if you know the impulse response of a linear time-invariant system, you can predict how that system will respond to any input signal. This property makes the impulse response an especially important tool. (##) Objectives * Analyze the impulse response of first-order circuits. * Compare theoretical results with experimental data. * Present results in formal lab report. (##) Before you begin * Find your seat * [Section B](B1.pdf) - 1/28 * [Section C](C1.pdf) - 2/2 * [Section D](D1.pdf) - 2/4 * [Section A](A1.pdf) - 2/9 * Log into the desktop PC * Power up the oscilloscope (##) Resources * Reference the [pre-lab slides](lab1.pdf) as needed. * Download the [E12 lab report template](E12_Lab_Report_Template.zip) and upload it to Overleaf. Share it with your lab partner. * Use [this starter code](load_tek_csv.m) for quickly loading data into MATLAB from the TekScope Utility. Equipment manuals: * [MDO34 Oscilloscope](MDO34_Oscilloscope.pdf) * [AFG1022 Function Generator](AFG1022.pdf) # Tasks (##) Circuit setup 1. Collect a decade resistor and a decade capacitor to use at your workstation. 2. Connect a BNC splitter to the Channel 1 output of the AFG1022 function generator. 3. Connect one side of the splitter to Channel 1 on the MDO34 oscilloscope. 4. Connect the other side of the splitter to a BNC to banana plug adapter that will supply your circuit under test. 5. Build a series RC circuit at your workstation whose voltage is supplied by the function generator. The RC time constant of your circuit should be 1 ms. 6. Use a second BNC to banana plug adapter on Channel 2 of the MDO34 oscilloscope. Measure the voltage across the capacitor on Channel 2. 7. Ensure the oscilloscope is set to high res mode by pressing the button in the upper right. ## Step response of an RC circuit 1. Configure the function generator to generate a 63 Hz square wave with a height of 3 V. The square wave should range from -1.5 V to 1.5 V. 2. Configure the scope so that you can see half a period of the square wave and the circuit's step response. These waveforms should take up the full screen. !!! ***Checkpoint:*** Before you move on to the next step, show me or the wizard the waveforms on your screen. 3. Use *TekScope Utility* on the desktop PC to save the data from both channels to a file. Once you have clicked Select Instrument and chosen your oscilloscope, you should click on "Waveform," select Channel 1 and Channel 2, and click "Get Data." After the plot appears, click "Save As" to save your data to a file called `step_response_capacitor.csv`. 4. Note your resistor and capacitor values as well as the settings on your scope (especially the volts/div) to include in your report. ## Impulse response: measure across the capacitor 1. Configure the function generator to approximate a unit impulse. Press the pulse button, and use the following settings: * 10 V High level * 0 V Low level * 100 μs pulse width 2. Adjust the scope so that you see the impulse on the far left of the screen and the impulse response takes up the full screen. !!! ***Checkpoint:*** Show me or the wizard your waveforms before capturing the data. 3. Use *TekScope Utility* on the desktop PC to save the data from both channels to a file file called `impulse_response_capacitor.csv`. 4. Note your resistor and capacitor values as well as the settings on your scope (especially the volts/div) to include in your report. ## Impulse response: measure across the resistor 1. Now, rearrange the circuit to swap the places of the resistor and the capacitor. Measure the output voltage across the resistor rather than across the capacitor. Leave the pulse signal from the function generator unchanged. 2. Configure the scope so that the circuit's impulse response takes up the full screen. !!! ***Checkpoint:*** Show me or the wizard your waveforms before capturing the data. 3. Use *TekScope Utility* on the desktop PC to save the data from both channels to a file file called `impulse_response_resistor.csv`. 4. Note your resistor and capacitor values as well as the settings on your scope (especially the volts/div) to include in your report. ## Impulse response of an RL circuit 1. Build a series RL circuit with a time constant of $\tau = \frac{L}{R} = 1 \mbox{ms}$. Get as close as you can with the available equipment. Measure the output voltage across the resistor. Leave the pulse signal from the function generator unchanged. 2. Configure the scope so that the circuit's impulse response takes up the full screen. !!! ***Checkpoint:*** Show me or the wizard your waveforms before capturing the data. 3. Use *TekScope Utility* on the desktop PC to save the data from both channels to a file file called `impulse_response_RL.csv`. 4. Note your resistor and inductor values as well as the settings on your scope (especially the volts/div) to include in your report. # Data analysis !!! Tip Make sure to save your code, as you will need to submit it with your lab report. I suggest you use the [`load_tek_csv.m`](load_tek_csv.m) function to load your data into MATLAB. ~~~ MATLAB data = load_tek_csv('filename.csv') t = data.TIME; ch1 = data.CH1; ch2 = data.CH2; ~~~ ## Step response of an RC circuit 1. Plot the data from your .csv file to make sure it matches what you saw on the oscilloscope. 2. Trim the data to only be the part after the input goes high. A clean way to accomplish this is to use logical indexing in MATLAB. ~~~ MATLAB idx = ch1 > 0; t = t(idx); ch1 = ch1(idx); ch2 = ch2(idx); ~~~ 3. Plot the data to make sure you have trimmed the data correctly. 4. Fit a curve to the data using the curve fitting toolbox. ~~~ MATLAB ft = fittype('-a*exp(-x/tau) + b', 'independent', 'x', 'dependent', 'y'); opts = fitoptions('Method', 'NonlinearLeastSquares'); opts.Display = 'off'; opts.StartPoint = [3 3 0.001]; [fo,gof] = fit(t, ch2, ft, opts); plot(fo,t,ch2) ~~~ 5. Examine the best fit MATLAB calculated, and record the value of $\tau$ for your report. Is it what you expected? Calculate a percent error between what you obtained and what you expected for $\tau$. Also for the report, record the coefficient of determination and the root mean squared error in the goodness of fit statistics. 6. Plot your experimental data, the best fit of your data, and what you expected from theory all on the same graph. Follow the standards for making professional plots for E12. ## Impulse response: measure across the capacitor 1. Plot the data from your .csv file to make sure it matches what you saw on the oscilloscope. 2. Trim the data to only be the part after the impulse. A clean way to accomplish this is to use logical indexing in MATLAB. ~~~ MATLAB idx = t > 0; t = t(idx); ch1 = ch1(idx); ch2 = ch2(idx); ~~~ 3. Plot the data to make sure you have trimmed the data correctly. 4. Fit a curve to the data using the curve fitting toolbox. ~~~ MATLAB ft = fittype('a*exp(-x/tau)', 'independent', 'x', 'dependent', 'y'); opts = fitoptions('Method', 'NonlinearLeastSquares'); opts.Display = 'off'; opts.StartPoint = [1 0.001]; [fo,gof] = fit(t, ch2, ft, opts); plot(fo,t,ch2) ~~~ 5. Examine the best fit MATLAB calculated, and record the value of $\tau$ for your report. Is it what you expected? Calculate a percent error between what you obtained and what you expected for $\tau$. Also for the report, record the coefficient of determination and the root mean squared error in the goodness of fit statistics. 6. Plot your experimental data and the best fit of your data on the same graph. Follow the standards for making professional plots for E12. ## Impulse response: measure across the resistor 1. Plot the data from your .csv file to make sure it matches what you saw on the oscilloscope. 2. Trim the data to only be the part after the impulse. A clean way to accomplish this is to use logical indexing in MATLAB. ~~~ MATLAB idx = t > 0; t = t(idx); ch1 = ch1(idx); ch2 = ch2(idx); ~~~ 3. Plot the data to make sure you have trimmed the data correctly. 4. Fit a curve to the data using the curve fitting toolbox. ~~~ MATLAB ft = fittype('-a*exp(-x/tau)', 'independent', 'x', 'dependent', 'y'); opts = fitoptions('Method', 'NonlinearLeastSquares'); opts.Display = 'off'; opts.StartPoint = [0.8 0.001]; [fo,gof] = fit(t, ch2, ft, opts); plot(fo,t,ch2) ~~~ 5. Examine the best fit MATLAB calculated, and record the value of $\tau$ for your report. Is it what you expected? Calculate a percent error between what you obtained and what you expected for $\tau$. Also for the report, record the coefficient of determination and the root mean squared error in the goodness of fit statistics. 6. Plot your experimental data and the best fit of your data on the same graph. Follow the standards for making professional plots for E12. ## Impulse response of an RL circuit 1. Plot the data from your .csv file to make sure it matches what you saw on the oscilloscope. 2. Trim the data to only be the part after the impulse. A clean way to accomplish this is to use logical indexing in MATLAB. ~~~ MATLAB idx = t > 0; t = t(idx); ch1 = ch1(idx); ch2 = ch2(idx); ~~~ 3. Plot the data to make sure you have trimmed the data correctly. 4. Fit a curve to the data using the curve fitting toolbox. ~~~ MATLAB ft = fittype('a*exp(-x/tau)', 'independent', 'x', 'dependent', 'y'); opts = fitoptions('Method', 'NonlinearLeastSquares'); opts.Display = 'off'; opts.StartPoint = [1 0.001]; [fo,gof] = fit(t, ch2, ft, opts); plot(fo,t,ch2) ~~~ 5. Examine the best fit MATLAB calculated, and record the value of $\tau$ for your report. Is it what you expected? Calculate a percent error between what you obtained and what you expected for $\tau$. Also for the report, record the coefficient of determination and the root mean squared error in the goodness of fit statistics. 6. Plot your experimental data and the best fit of your data on the same graph. Follow the standards for making professional plots for E12. # Writing your lab report Write a lab report using $\LaTeX$ that adheres to the guidelines in the [E12 Lab Report Template](E12_Lab_Report_Template.zip). In addition to the guidelines in the template, below are guidelines specific to some sections of the report for this lab. ## Theory * Derive the equation for the step response of an RC circuit with the output voltage measured across the capacitor. * Derive the equation for the impulse response of an RC circuit with the output voltage measured across the capacitor. * Derive the equation for the impulse response of an RC circuit with the output voltage measured across the resistor. * Derive the equation for the impulse response of an RL circuit with the output voltage measured across the resistor. ## Methods * Report the values of all circuit components (resistors, capacitors, inductors) used in your experiments. * So that your work can be reproduced, make circuit schematics for each circuit you investigated and include them in this section. * Report the relevant scope settings used to record the data. ## Submission Before your next lab meeting, please submit to Moodle: * Your lab report in PDF format. * All .csv data files you recorded from the oscilloscope. * Any code you wrote. You do not need to include any of my starter code. !!! Tip Every group will be allowed one resubmission for lab 1 to earn points back after receiving a grade. This policy gives you one chance to learn (without penalty) what my standards are for E12 lab reports.