Inspired by Dr. Sarwate's answer to the question How replicas are formed in Frequency domain when a signal is sampled in Time Domain? , I decided to see for myself the underlying concept.
I interpreted Dr. Sarwate's answer that sampling was a sequential activity. All one needed to do was to multiply an impulse with the signal meant to be sampled. And this needed to be repeated with delayed/shifted versions of the impulse.
Multiplication in time domain is convolution in frequency domain and vice-versa. I thought that with the impulse shifting by every sample, its spectral response would also undergo a similar shift in frequency domain. But it seems not to be the case.
I wrote a toy program in octave and the plots of the frequency response havent brought any joy. What have I misunderstood here?
## Num Samples N = 10; ## Row vector representing samples (all zeroed out) x = zeros(1,N); y = zeros(1,N); z = zeros(1,N); ## Undelayed impulse (For lack of a better word) x(1) = 10; ## Delayed by 1 sample y(2) = 10; ## Delayed by 2 samples z(3) = 10; ## Obtain spectrum of undelayed impulse s_spectrum_x = fft(x); s_spectrum_abs_x = abs(s_spectrum_x); ## Obtain spectrum of impulse delayed by 1 sample s_spectrum_y = fft(y); s_spectrum_abs_y = abs(s_spectrum_y); ## Obtain spectrum of impulse delayed by 2 samples s_spectrum_z = fft(z); s_spectrum_abs_z = abs(s_spectrum_z); >>disp(s_spectrum_abs_x); 10 10 10 10 10 10 10 10 10 10 >>disp(s_spectrum_abs_y); 10 10 10 10 10 10 10 10 10 10 >>disp(s_spectrum_abs_z); 10 10 10 10 10 10 10 10 10 10
Shouldn't the initial bins of y and z be 0?