I'm having a rough time doing the following question from a HW. Given a sequence of your choice, what happens to the DFT if we add a 0 between every sample? I.e. if we have x[n] = [A,B,C], we turn it into x[n] = [A,0,B,0,C,0].
My initial thought was that the sampling frequency would double, similar to when we zero pad at the end of the signal. To do some analysis, I used the following MATLAB code.
Fs = 300; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1500; % Length of signal
t = (0:L-1)*T; % Time vector
S = 0.7*sin(2*pi*50*t); %Signal - sine 50 Hz
z = zeros(1,3000);
z(1:2:end) = S; %Zero interp
z_fft = fft(z);
z_abs = abs(z_fft/(L*2));
P = z_abs(1:L*2/2+1);
P(2:end-1) = 2*P(2:end-1);
f = Fs*(0:(L*2/2))/(L*2);
plot(f,P);
Which yields the following plot:
That is different from the result when I add the same number of 0's but to the end of the sequence:
So I got confused, what is the result of adding the 0 between every sample? Does that doubles the frequency of my signal? What about that peak on f = 125Hz? Or am I making something wrong on my simulation?
Thanks for your time!