1. Use the subsetA signal (below) as the input to the first order system shown i
ID: 2990898 • Letter: 1
Question
1. Use the subsetA signal (below) as the input to the first order system shown in equation 3. (use a for loop)
2. Create the waveform data for the output data
3. Graph the input and ouput waveforms
4. Run the simulation using the following time constants: 0.01, 0.03, 0.05, 0.07, and 0.1 and graph the results.
subsetA =
-0.1650
-0.1550
-0.1950
-0.2050
-0.1850
-0.1550
-0.1350
-0.0950
-0.0750
-0.0650
-0.0650
-0.1250
-0.1250
-0.1250
-0.1150
-0.1250
-0.1650
-0.1150
-0.1450
-0.1150
-0.1350
-0.1350
-0.1250
-0.1750
-0.1450
-0.1250
-0.1450
-0.1450
-0.1350
-0.1650
-0.1550
-0.0950
-0.1050
-0.0750
-0.0850
0.0250
0.0250
-0.0250
-0.0850
-0.1150
-0.1450
-0.1250
-0.1550
-0.2050
-0.2150
-0.2150
-0.1650
-0.1650
-0.1550
-0.6150
-0.8550
-0.1850
1.2950
2.5750
2.6750
2.4450
0.7350
-0.4150
-0.2950
-0.2850
-0.3450
-0.3650
-0.3450
-0.3050
-0.3150
-0.3050
-0.2650
-0.2350
-0.2650
-0.2450
-0.2150
-0.1950
-0.1750
-0.1850
-0.1550
-0.1250
-0.1450
-0.1250
-0.1450
-0.1550
-0.1850
-0.1750
-0.1750
-0.1650
-0.1650
-0.1150
-0.0650
-0.0950
-0.1150
-0.0750
-0.1150
-0.1550
-0.1050
-0.1250
-0.1350
-0.1250
-0.1150
-0.1050
-0.1350
-0.1350
-0.1350
-0.1450
-0.1250
-0.1150
-0.1350
-0.1350
-0.1650
-0.1550
-0.1150
-0.0850
-0.0550
-0.0550
-0.0450
0.0650
0.0050
-0.0150
-0.0550
-0.1150
-0.1350
-0.1350
-0.1750
-0.2050
-0.2250
-0.1750
-0.1750
-0.1550
-0.2550
-0.8750
Explanation / Answer
Change the Tau value as you need and run the following MATLAB script.
Save your input data as input.txt in the same folder as the script.
fid = fopen('input.txt');
X = fscanf(fid, '%g');
n = length(X);
Delta_t = 1/n;
Tau = 0.01;
Y = zeros(n,1);
Y(1) = X(1)*Tau/(Tau + Delta_t);
for i = 2:n
Y(i) = (Delta_t/(Tau + Delta_t))*((Tau/Delta_t)*Y(i-1) + X(i));
end
time = Delta_t:Delta_t:1;
plot(time',X,time',Y,'--');
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.