# You are to develop a MATLAB function that outputs the trigonometric Fourier series of the input…

You are to develop a MATLAB function that outputs the trigonometric Fourier series of the input function. Hint You may use your test signal and the hand calculations to verify your solution. The function must take the following inputs:

• Any periodic function over a single period as s_hinf. This signal will be in the form of a discretely sampled array (similar to Problem 3): • The time vector that the periodic noise signal was evaluated over as t; and • The number of harmonics that the Fourier series will be evaluated as N.

The function must output:

• The trigonometric coefficients of the input periodic function as a0, an and bn; and • The trigonometric Fourier series approximation of the input periodic function evaluated with N harmonics, saved as s_approx.

The variable an and bn must be stored as a row vector where an = b,, = lb b2, bN: The trigonometric coefficients must be computed numerically using MATLAB. It is expected that any integrals will be found numerically using a Riemann sum, i.e. do not use the trapz or syms functions. Please note. this function is not related to the signals given in Problems 1 and 2.