DSP Lab - 1 CE
DSP Lab - 1 CE
Enter the Matlab command(s) through which you defined this vector in your
report.
ii) Develop a general function that can shift any given signal x[n] by any desired
time delay nd to produce x[n - nd]. When nd is positive, the signal will be shifted
rightwards while for negative nd, the signal will be shifted leftwards. Your
function should automatically plot both the original signal x[n] and the shifted
signal x[n - nd]
Hint: You can use ‘find’ command of Matlab. Explore what ‘find’ does in
Matlab’s function browser.
For this question assume x[n] to be the function defined in the previous part as
the input signal x[n] to your function.
Now choose nd as -5. Attach a screenshot of the output of your function in your
report. Plot both x[n] and x[n+5] and properly label both figures.
Your Matlab function should plot this function for whatever value of ni and nh is
input.
Attach a screenshot of the figure generated by your function for the input values of
ni = 4 and nh = 7. Also copy the function to your report.