I am new to matlab and signal processing. I have wrote the below posted code. what i could not understand is, the time soecification
section at the beginning of the code. I do not why do we need sampling when specifying an interval or time duration, i think it suffice to specify something like the following :
t = (0: 0.2: 1.0) for an example,
why do i need some thing like sampling to plot such as stationary signal.
another question is, this code gives me an error saying paranthesis imbalance
how to solve it please.
Code
%% Time specifications:
Fs = 8000; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 1; % seconds
t = (0:dt:StopTime-dt); % seconds
x = (10)*cos(2*pi*3*t) ...
+ (20)*cos(2*pi*6*t ...
+ (30)*cos(2*pi*10*t) ...
+ (50)*cos(2*pi*15*t);
% Plot the signal versus time:
figure;
plot(t,x);
xlabel('time (in seconds)');
ylabel('Amplitude');
title('Signal versus Time');
title('{\bf Periodogram}');