# Converting a generated digital signal to time series in MATLAB

I'm given the periodic digital function $$x(n) = e^{0.2}\cos\left(\frac{2\pi 500 n}{3000}\right) + \sqrt{3} \cos\left(\frac{2\pi 700 n}{3000}\right)$$ where 3000 is the sampling frequency. Initially, I plotted the function against 500 sample points ($$n$$).

I was able to generate a signal with those criteria and my code was

fs = 3000;
n = 0:1:499; % 500 sample point
x = exp(0.2)*cos((2*pi*500*n)/fs) + (sqrt(3)*cos((2*pi*700*n)/fs));
plot(n,x);


My aim is to construct the time series of the function $$x(n)$$ given the time domain was not provided. Could you please point me in the right direction on what steps to take to achieve this?

I'm looking into discrete fourier transform along the way, any help would be appreciated.

Thank you.

This is the sum of two sinusoidal signals. The first one has period 6, the second one has period 30. Therefore, the period of the signal is 30, i.e. \begin{aligned} x(n+30) &= e^{0.2} \cos\left(2\pi\tfrac{ 500}{3000} (n+30)\right) + \sqrt{3} \cos\left(2\pi\tfrac{ 700}{3000} (n+30)\right) \\ &= \cos\left(2\pi\tfrac{ 500}{3000} n + 10\pi\right) + \sqrt{3} \cos\left(2\pi\tfrac{ 700}{3000} n + 14\pi\right) \\ &= x(n) \end{aligned} and there is no integer smaller than 30 with this property. Thus, knowing that the sampling frequency is 3000, the time series may be obtained as follows:
fs = 3000;