I have a sinusoidal signal that is sampled at $f_s=10$ Hz. I am asked to find the absolute value of the DFT for different data lengths (1 sec., 2 sec. etc.)
I do not understand where will I use the information about the data lengths.
Does the question want me to change the time vector for each attempt? as such:
** original time vector **
f=10; % sampling freq
t=0:1/f:5;
rendering
x = cos(2*pi*3*t)
** time vector for each attempt **
t1=0:1/f:f*1; % data length = 1 sec
t2=0:1/f:f*2; % data length = 2 sec
thus rendering
x1 = cos(2*pi*3*t1);
x2 = cos(2*pi*3*t2);
and the rest would be how we usually get the FFT.
Did I understand the request correctly or not?
----Edit ------
t1=0:1/f:f*1
, you are mixing times (1/f) and frequencies (f*1). Use times for everything:t1 = 0:1/f:1
for samples going from 0 to 1 second. $\endgroup$