68°F 1 Unit Impulse For this lab, we focus on the response of the system to an input called the impulse. A unit impulse
Posted: Fri Jul 08, 2022 6:24 am
= responses 10 this lab, the system is at rest for 1 second. The impulse is injected into the system and lasts for 30 samples and then the input is zero for the rest of the data record. Thus, the summation should be computed between k 10000 and k = 10050. (The impulse is sample-based, occurring every 50000 samples. Sample time is nominally 0.0001 second, but taking diff (t) the time between samples varies slightly around this value. Thus the pulse may not start exactly at t = 1.0000 seconds. Using find (u) the exact indices where the pulse is non-zero may be found.) Once y is obtained for the input and output you are interested in, scale u(t) and y(t) to recover the approximate unit impulse input into the system 6(t) and the corresponding impulse response h(t). 2 Impulse Response of Low and High Pass Filters 2.1 Data Collection Data were collected following the instructions in this subsection: The impulse response of the low-pass filter and high-pass filter are studied in this lab. You will need to force the system with the provided impulse and capture the input and output signals from each system. The impulse used for this lab is a set of three pulses one after the other that each last for 0.001 seconds and have a gain that you will set. The below Simulink model diagram highlights the type of impulse is implemented: PAN Genera Get Gest impa MUKADO LADO E DAC ACC Figure 1: Simulink diagram showing implementation of 3 pulse impulse The provided ControlDesk interface lets you set the gains on each of the three pulses contained in the impulse and is capable of consistently capturing data (with a one second delay before the
impulse is turned on) with the "Start Triggered" Button Start Triggered After data collection, the data is saved as a ".mf4" file found in the measurement tab as a "rec.001.mf4". You are tasked with capturing three sets of data per system: (1) The sum of the pulse gains is above 10 representing a positive area impulse, (2) The sum of the pulse gains is below -10 representing a negative area impulse, and (3) The sum of the pulse gains is equal to 1 representing a small area impulse. For the low-pass filter data, set (1) was stored as lowpass.posgain_impresp.mat, (2) as lowpass_neg and (3) as lowpass_smallgain_impresp.mat. High-pass filter data follows a similar convention. 2.2 Data Analysis The input and output signals for each set of data must therefore be scaled to represent the impulse response of the associated circuit. The time vector in each file, denoted t, can be used for graphing all of the signals. The impulse "hits" the circuit in a neighborhood of t=0 seconds. The sample time associated with the data is t, = 0.0001 second. Offsets in the output data have been removed by subtracting the mean of the first 0.9 seconds of data. The following code will guide the data analysis for "lowpass.posgain_impresp.mat", but can be applied to any captured and exported low-pass filter data set. First, the data is loaded to the workspace. The offset is removed and the subsequent signals are plotted in the time domain. load lowpass posgain_impresp.mat ts - 1/10000; sample time tlp lowpass_impresp.X.Data-1; ulp lowpass_impresp.Y (3).Data; ylp lowpass_impresp.Y (1).Data; - offset mean (ylp (1:9000)); W ylp 1 offset; ylp figure (1) plot (tip, ulp); xlabel ('time (sec)'); ylabel('u (volts)'); grid on; title('Low-pass filter raw input'); figure (2) plot (tlp, ylp); xlabel (time (sec)'); ylabel('y (volts)'); grid on; title('Low-pass filter raw output'); Second, the data is normalized by the area of the input, 7. Note that the units of 7 are volts/volts- seconds. * compute area under the curve gamma_lp [1; to be filled in by student
normalize by the area of the impulse 888 To be filled in by student $$% To be filled in by student plot the impulse response figure (3) plot (tlp, ylpn); xlabel('time (sec)'); ylabel('h (volts/volts-sec)'); axis ([-0.1 1 -1 9]); Lastly, the normalized signal is plotted against the analytical signal. A first order model consisting of parameters a, b is used to produce the analytical model. $ fitting model to data blp =;&TBD alp; TBD hlp = blp exp (alp tlp).. (tlp>0); figure (3) hold on; plot (tlp, hlp); legend ('experimental', 'analytical') title('LP Impulse Response'); grid on; The high-pass filter data undergoes a similar process as the low-pass filter but with slight differences when deriving a model for the impulse response fit. For "highpass.posgain_impresp.mat", for instance, the code is as follows: load highpass_posgain_impresp.mat thp highpass posgain_impresp.X.Data-1; uhp - highpass posgain_impresp.Y (3).Data; yhp highpass_posgain_impresp.Y (1).Data *** - mean (highpass_posgain_impresp.Y (1).Data (1:9000)); figure (4) plot (thp, uhp); xlabel('time (sec)'); ylabel('u (volts)'); grid on; title('Raw input data'); figure (5); plot (thp, yhp);
xlabel('time (sec)'); ylabel('y (volts)'); grid on; title ('Raw high-pass filter response') compute area under the curve gamma_hp []; normalize by the area of the input uhpn []; yhpn []; D = figure (6) plot (thp, uhpn); xlabel('time (sec)'); ylabel ('u (volts/volts-sec)'); grid on; axis ([-0.001 0.003 -500 20001); figure (7) plot (thp, yhpn); xlabel('time (sec)'); ylabel('y (volts/volts-sec)'); grid on; axis ([-0.001 0.003 -500 2000)); title('Zoomed-out normalize output,y') figure (8) plot (thp, yhpn); xlabel('time (sec)'); ylabel('y (volts/volts-sec)'); grid on; axis ([-0.1 1 -20 201); title('Zoomed-in normalized output, y'); bhp <= []; []; ahp hhp - bhp-uhpn ahp-bhp.exp (ahp-thp).. (thp>0); M figure (9) plot (thp, yhpn); hold on; plot (thp, hhp); xlabel('time (sec)'); ylabel('y (volts/volts-sec)'); grid on; axis ([-0.1 1-20 201); legend('experimental','analytical'); title('High-pass filter impulse response') After the empirical high-pass filter response signal is normalized, it is plotted on two time scales.
The first is a zoomed-out time scale used to show the feed-through pulse that appears in the system output. The second figure consists of a zoomed-in plot that focuses on the "free response" section of the signal that is governed by the high-pass filter's natural mode. Recall that the initial condition set-up by the unit-area pulse is the product, ab. Due to the stability of the system, the sign of a is negative. 2.3 Tasks: Low-Pass Filter 1. For each set of data, compute and report the area of the impulsive input for the low-pass circuit. 2. Scale the measured outputs by the corresponding input areas. These "normalized" signals represent the impulse response of the low-pass filter. Graph the scaled outputs in a single figure (Figure 1). The impulse response will be analytically represented by a single "unit" function. Use the axis command to set the time axis interval to [-0.1, 1] seconds and the y axis limits to [-10, 10]. Label the axes with appropriate units. What do you notice about an output given its unit impulse input for the larger area impulse inputs? What do you notice about the scaled output for the small area impulse input relative to the other outputs from the other input cases? 3. The low-pass circuit is well-modeled by the following ODE y = ay + bu Select a and b so that the impulse response h(t) = et bu(t) matches the scaled positive area impulse response data and plot both in Figure 2. The parameter b can be estimated by determining an approximate value of the scaled outputs after the impulsive input has reset to zero- this is at about t= 3.0 ms. The a parameter is chosen so that the exponential decay is matched to the data. Graph, in Figure 2, the model impulse response against one of the normalized output data sets. Set the time axis limits to be [-0.1, 1] second and the y axis limits to [-10,10]. Report the ODE parameters in the following table Parameter a b Value ? ? 2.4 Tasks: High-Pass Filter 1. Compute and report the area of the impulsive input for each of the three sets of data collected for the high-pass circuit. 2. Scale the measured inputs by the corresponding input area. These "normalized" signals represent the unit impulses sent to the high-pass filter. Graph the scaled positive area input in a single figure (Figure 3). Use the axis command to set the time axis interval to [0,0.003] seconds, and do not set the y axis limits. Label the axes with appropriate units.