Tone Frequencies Total Error pos freq Compare with 1\" Row 940.5 1000.5941336 05
ID: 2292845 • Letter: T
Question
Tone Frequencies Total Error pos freq Compare with 1" Row 940.5 1000.5941336 05 3355 336.0 Compare with 2 Row 697 1336245 33555970 697 | 1336 | * | 2435 | 3355 | 597.0 Find Read Background Section (6) on the function abs and min, and then answer the following Using the function abs, write the line of code to calculate the absolute error measurement abs error between the extracted frequencies pos freq and ith row of the matrix TE. Note that abs error is a 1 x 2 row vector. i) ii) What is the line of code to sum up the 1st and 2nd elements of abs error, the value of iii) Using the function min with two outputs, write the line of code to find the minimum iv) Note that if the correct tone number is 0, index min e will equal 1. If the correct which will be stored as the ith element of vector total error? value min e and corresponding location index index mine in vector total_error? number is 1, index min e will equal 2. If the correct number is 9, index min e will equal 10. How do we calculate the tone number num from index min e?Explanation / Answer
% i).
abs_error= abs(pos_freq-TF(i,:));
% you can replace i with 1 if you need for the first row
% ii).
total_error(i)=sum(abs_error,1); % 1 indicates for summation in row
% iii)
[min_e, index_min_e]=min(total_error);
% the two outputs are, one is the minimum value and the second is the
% location of the minimum value
% iv) from the given data tone number is 1 less than the index_min_e value
num=index_min_e-1;