Menu

[Solved]3 30 Points Write Matlab Function Called Dipsignal Following Form Function Sigyclipl Clips Q37255632

3. (30 points) Write a MATLAB function called dipSignal with the following form function [sigy_clipl - clipsignal (sigx, sigt

3. (30 points) Write a MATLAB function called dipSignal with the following form function [sigy_clipl – clipsignal (sigx, sigt,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: An array of x values of the original signal An array of y values (amplitude) of the original signal . Input 1: . Input 2: sigy sigx Input 3: clipn The minimum amplitude that the clipped signal should have Input 4: Output1 clip An array of y values (amplitude) of the clipped signal The maximum amplitude that the clipped signal should clipHax · Your function should do the following: 1. 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) 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 x2*pi : 0.1: 2*pi: y_clip-clipsignal(x,y,-0.8,0.5): Plot nsj are not required to set the axis boundaries or line width Show transcribed image text 3. (30 points) Write a MATLAB function called dipSignal with the following form function [sigy_clipl – clipsignal (sigx, sigt,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: An array of x values of the original signal An array of y values (amplitude) of the original signal . Input 1: . Input 2: sigy sigx Input 3: clipn The minimum amplitude that the clipped signal should have Input 4: Output1 clip An array of y values (amplitude) of the clipped signal The maximum amplitude that the clipped signal should clipHax · Your function should do the following: 1. 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) 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 x2*pi : 0.1: 2*pi: y_clip-clipsignal(x,y,-0.8,0.5): Plot nsj are not required to set the axis boundaries or line width

Expert Answer


Answer to 3. (30 points) Write a MATLAB function called dipSignal with the following form function [sigy_clipl – clipsignal (sigx,… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *