Write a new MATLAB function as described in the following:
1. The new function will have three input parameters: f, W, C.2. Parameter f will specify the frequency of the square wave. 3.The parameter W will specify the width of the single pulse as anumber of sample periods. 4. The parameter C will specify thenumber of square wave cycles. 5. Calculate a number of samples, N,to run the simulation for both waveforms. 6. Create one signal thatis a square wave of period 2W samples and lasts for a duration of Ccycles. 7. Create a signal beginning with a single pulse ofamplitude 1 and a width of W samples followed by N-W samples withamplitude of 0. 8. Plot time and frequency domain plots for each.Use subplots to show all four graphs on the screen at once,arranged the same way as in the reference lecture slide. Scale theplots as necessary so that the desired characteristics can beeasily seen. Label the x-axis with the correct units oftime/frequency. Run the new function with f=1000, W=20, andC=10.