For both parts of this part, modify and run the FFT test program ffttest_rev.m.
(a) Periodic triangular waveform
4 t / T (t < T/4)
(4/3) (1 – t / T) (t >= T/4)
Run the program for 16, 32 and 64 samples and record the relative magnitudes of the FFT coefficients X(2) to X(10), which correspond to the fundamental frequency along with 2nd to the 9th harmonics. Show the percent errors for the three runs. Explain the result you get for the 9th harmonic when N=16.
Derive the Fourier series coefficients for the triangular waveform and compare to the MATLAB results.
Hint: Use the exponential form of the Fourier series and integrate by parts.
(b) Periodic pulse used
1 (0 < t < T/4)
x(t) = 0 (T/4 < t < T)
Run the program for 64 samples
Note: For each run in (a), submit print-out only for the relative magnitudes of FFT coefficients X(1) to X(10)
For (b), submit print-out only for the relative magnitudes of FFT coefficients
X(1) to X(5)
Submit the time plots for the reconstructed signals, but not the frequency bar graphs.
The bridge circuit shown below is balanced when R2 / R4 = R3 / R5 , resulting in zero current through R6. A “small“ unknown resistor can be measured accurately by placing it in series with R5 for example. The current and voltage to R6 are then proportional to the unknown resistance.
The balance of the bridge obviously depends greatly on the accuracy of the resistors used. Test the imbalance caused by resistor tolerance by programming a Monte Carlo analysis with MATLAB. This can be done by randomizing R2, R3, R4 and R5 and solving the mesh equations in a loop (similar to the approach recommended for the analysis of this circuit in MATLAB Assignment 2). Use a tolerance of 9.4 % and a uniform distribution.
Insert rng(1946091) at the start of the program
Display the minimum and maximum voltages across R6, along with the mean and standard deviation. Show a histogram of the voltages for 1000 runs.