[Solved]3 30 Points Write Matlab Function Called Clipsignal Following Form Function Sig Clipl Clip Q37239733
3. (30 points) Write a MATLAB function called clipSignal with the following form function (sig clipl – clipsignal(sigx,sigy,clipMin,clipMax) end This function is used to “clip” a signal at a maximum and minimum amplitude (y-value). The function arguments are defined as follows: . Input 1: sigx An array of x values of the original signal An array of y values (amplitude) of the original signal Input 2: ig e Input 3: clipMin The minimum amplitude that the clipped signal should have Input 4: clipMax The maximum amplitude that the clipped signal should have sigy Output1sig clip An array of y values (amplitude) of the clipped signal Your function should do the following This function must use a FOR loop to go through each element of the array sigY and set the corresponding value of the array sigY_clip to either: o the original value, o clipMin, (if the original value is smaller than clipMin) or o clipMax (if the original value is larger than clipMax) 1. Your function should also plot the original and clipped signals side by side as shown in the example run below. You must include the plot titles and gridlines. 2. Example Run: Command Line ysin(x); y_clip clipsignal(x,y,-0.8,0.5); Plot Original Signal 02 -04 You are not required to set the axis boundaries or line width Show transcribed image text 3. (30 points) Write a MATLAB function called clipSignal with the following form function (sig clipl – clipsignal(sigx,sigy,clipMin,clipMax) end This function is used to “clip” a signal at a maximum and minimum amplitude (y-value). The function arguments are defined as follows: . Input 1: sigx An array of x values of the original signal An array of y values (amplitude) of the original signal Input 2: ig e Input 3: clipMin The minimum amplitude that the clipped signal should have Input 4: clipMax The maximum amplitude that the clipped signal should have sigy Output1sig clip An array of y values (amplitude) of the clipped signal Your function should do the following This function must use a FOR loop to go through each element of the array sigY and set the corresponding value of the array sigY_clip to either: o the original value, o clipMin, (if the original value is smaller than clipMin) or o clipMax (if the original value is larger than clipMax) 1. Your function should also plot the original and clipped signals side by side as shown in the example run below. You must include the plot titles and gridlines. 2. Example Run: Command Line ysin(x); y_clip clipsignal(x,y,-0.8,0.5); Plot Original Signal 02 -04 You are not required to set the axis boundaries or line width
Expert Answer
Answer to 3. (30 points) Write a MATLAB function called clipSignal with the following form function (sig clipl – clipsignal(sigx,s… . . .
OR

