Exercise 2.1: Basic digital signals (a) Write a MATLAB programto generate and display (using the stem function) the signalsdefined in Table 1. The MATLAB code of the first signal (dirac) isgiven in the report template as an example. (b) Write a MATLABfunction [x, t] = sin_NU(f0, fs, T) to generate a sine signal. Theoutput parameters x and t are the signal and time vectors,respectively. The input parameters are f0 (signal frequency in Hz),fs (sampling frequency in Hz), T (signal duration in sec.). (c)Test your sin_NU function with the input parameter values .... anddisplay the result using the plot function. List of basic digitalsignals to generate: - Dirac (Unit Response) - Unit step (Heavisidestep) - Sign - Rectangle - Sine - Sine cardinal Exercise 2.2: Audioaliasing To illustrate the aliasing phenomenon, let’s perform twosimple experiments allowing us to “hear†it. Using the sin_NUfunction of Exercise 1: (a) Generate two 1 kHz sine signals (2seconds duration), first signal at 20 kHz sample frequency andsecond signal at 1.5 kHz sample frequency; (b) On the same graph,use the plot function to display the two signals versus t in therange 0 < t < 5 msec.; (c) Listen to the two signals oneafter another using the function soundsc(x, fs); and (d) Give yourinterpretation of this listening. Exercise 2.3: QuantizationQuantization is done by replacing each value of an analog signalx(t) by the value of the nearest quantization level. To exemplifythis operation, let’s simulate an unipolar ADC (Analog to DigitalConverter) having the technical specifications: R = 10 Volts(full-scale range) and B = 3 (number of bits). (a) Write a MATLABfunction y = adc_NU(x, R, B) where x and y are vectors containingthe input signal and the quantized signal, respectively; (b) Testyour function with an input ramp signal ranging from -5 to 15 Volts(1 volt per step); and (c) On the same graph, use the plot and stemfunctions to display the input signal and quantized signal,respectively.