Question: The MATLAB function below performs the discrete convolution: function y discrete_conv(x, h, N) y- zeros(1, 2N+1); for n- 1: 2 N+1 for m- 1:N if
The MATLAB function below performs the discrete convolution: function y discrete_conv(x, h, N) y- zeros(1, 2"N+1); for n- 1: 2 N+1 for m- 1:N if ((n-m)>0 & (n-m)N) y(n)-y(n) +x(m) * h(n-m); end end end 2. Save the function as discrete_conv.m and apply it as shown below to the example of the two pulse example. Record the result. >> xr(11 1 ]; h-[11 1 1], N-length(x); >> y-discrete_conv(x, h, N) y- 3. Apply MATLAB's convolution function as shown below. >y-conv(x, h) 4. Convolve the two pulses indirectly, using MATLAB's fft and ifft functions as shown below >> N-length(x); zzeros(1,N-1);X-fft((x z]); H-fh([hz]); y-ifft(X.* H) 5. Convolve the unequal length pulses below using the discrete_conv function. Record the result Verify using MATLAB's functions, but do not record the results. The MATLAB function below performs the discrete convolution: function y discrete_conv(x, h, N) y- zeros(1, 2"N+1); for n- 1: 2 N+1 for m- 1:N if ((n-m)>0 & (n-m)N) y(n)-y(n) +x(m) * h(n-m); end end end 2. Save the function as discrete_conv.m and apply it as shown below to the example of the two pulse example. Record the result. >> xr(11 1 ]; h-[11 1 1], N-length(x); >> y-discrete_conv(x, h, N) y- 3. Apply MATLAB's convolution function as shown below. >y-conv(x, h) 4. Convolve the two pulses indirectly, using MATLAB's fft and ifft functions as shown below >> N-length(x); zzeros(1,N-1);X-fft((x z]); H-fh([hz]); y-ifft(X.* H) 5. Convolve the unequal length pulses below using the discrete_conv function. Record the result Verify using MATLAB's functions, but do not record the results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
