Question: mathlab Consider the following MATLAB code: >> n - Lo : 7] >> N - 4; >> x = sin((2*pi) / Nn); >> stem (n
![7] >> N - 4; >> x = sin((2*pi) / Nn); >>](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa2d675537a_65466fa2d66e89fd.jpg)

Consider the following MATLAB code: >> n - Lo : 7] >> N - 4; >> x = sin((2*pi) / Nn); >> stem (n ,x); The value of N defines the number of samples per period, and n defines the total number of data points stored. In the above example, we are sampling the diserete time sinusoidal signal 4 times every period and storing these sampled values into a vector consisting of 8 data points. The result- ing stem plot is: 0.8 0.0 0.4 0.2 o -0.4 -0. -0.3 With more samples per period, the sampled signal more closely resembles a sine wave. You can easily see the effect by doing: >> N = 16; >> n = 10:31 ] ; >> X = sin ( (2*pi) /N n ); >> stem (n,x); (1) A signal X[n] is said to be periodic (with period T) if X[n+T) - x[n]. This question investi- gates the effect how floating point numbers are stored internally within a computer. Sample the signal x = cos( (2*pi)/1024 * n ) over 4 periods and then determine whether x[n] = x[n+ 1024]. For example, you can compute the difference of x[1] - x[1+1024] to see if it is equal to 0.0. It would be useful to use the: >> format long command so that doubles are displayed to their full 15 decimal place accuracy. (ii) Instead of using the MATLAB constant, pi, use the value of 3.14 and compare your results with those obtained in part (i). (iii) Determine (using MATLAB) whether the signals: xl = cos(pi/4* n + pi/3) and x2 = cos(9*pi/4.*n + pi/3) 25 are equal to each other
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
