Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Cancellation, Precision, and Loss of Prescion All code is supposed to be in MATL

ID: 3787952 • Letter: C

Question

Cancellation, Precision, and Loss of Prescion

All code is supposed to be in MATLAB. Any help would be greatly appreciated.

Cancellation, Precision and Loss of Precision. Consider finding the roots of the quadratic polynomial, f(x) = ax^2 + bx + c. Supporse we are trying to solve this equation for a = 0.5, b = 1000, c = 5 times 10^-7 The quadratic formula says that one of the roots is, x = -b + Squareroot b^2 - 4ac/2a (a) Use the Loss of Precision Theorem (with base 10) to establish the number of accurate digits in the root. Recall that double precision numbers give about 15 or 16 decimal digits of precision. (c) Compute the root in Matlab using the formula in Equation (1). How accurate is your result? Does it agree with your answer in part (a)? (d) Modify the above formulation of the quadratic formula to remove this problem. Verify your results by computing the root with the new formulation in Matlab.

Explanation / Answer

x = [2 one a pair of 1];
y = [1 a pair of 3];
clin = conv(x,y);
The output has length 4+3-1.

Pad each vectors with zeros to length 4+3-1. get the DFT of each vectors, multiply the DFTs, and acquire the inverse DFT of the merchandise.

xpad = [x zeros(1,6-length(x))];
ypad = [y zeros(1,6-length(y))];
ccirc = ifft(fft(xpad).*fft(ypad));
The circular convolution of the zero-padded vectors, xpad and ypad, is such as the linear convolution of x and y. you keep all the weather of ccirc as a result of the output has length 4+3-1.

Plot the output of linear convolution and therefore the inverse of the DFT product to point out the equivalence.

subplot(2,1,1)
stem(clin,'filled')
ylim([0 11])
title('Linear Convolution of x and y')

subplot(2,1,2)
stem(ccirc,'filled')
ylim([0 11])
title('Circular Convolution of xpad and ypad')


Pad the vectors to length twelve and acquire the circular convolution victimisation the inverse DFT of the merchandise of the DFTs. Retain solely the primary 4+3-1 parts to provide a similar result to linear convolution.

N = length(x)+length(y)-1;
xpad = [x zeros(1,12-length(x))];
ypad = [y zeros(1,12-length(y))];
ccirc = ifft(fft(xpad).*fft(ypad));
ccirc = ccirc(1:N);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote