# Delayed impulse does not delay spectral response

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?

The convolution theorem ("Multiplication in time is Convolution in frequency") states:

$$\mathcal{F}\{x\cdot y\}=\mathcal{F}\{x\}*\mathcal{F}\{y\}$$

where $x, y$ are two time-domain signals, $\cdot$ denotes element-wise multiplication and $*$ is the convolution operator. So, the convolution in the frequency domain, is carried out between the Fourier Transforms of the original signals.

As an example, let us use your impulses with frequency response:

$$\mathcal{F}\{\delta(t)\}=1$$

Further, note the time-shifting property of the FT:

$$\mathcal{F}\{x(t-t_0)\}=\mathcal{F}\{x(t)\}\exp(-j2\pi ft_0)$$

where $x(t)$ is any signal you like. Now, you can readily explain the results you obtain for your shifted impulses:

$$\mathcal{F}\{\delta(t-1)\}=\mathcal{F}\{\delta(t))\}\exp(j2\pi f)$$

where $f=[0/N, 1/N, 2/N, \ldots, (N-1)/N]$ (due to the discrete FT). Similar for the two-shifted case:

$$\mathcal{F}\{\delta(t-2)\}=\mathcal{F}\{\delta(t)\}\exp(-j2\pi f2)$$

Note that $\mathcal{F}\{\delta(t)\}=1$. You display the absolute value of your spectra: $\left|X(f)\exp(j2\pi ft_0)\right|=|X(f)|$ for any $X(f)$ you like. That's why you see three times the same output. Try plotting real and imaginary part separately, then you will see the effect of time-shifting. You might also have a look here which is an article I wrote about the effect of the time-shift and frequency-shift.

• +1 for the link. illustrations are so explanatory, thank you for that! – kdrtkl Mar 6 '17 at 12:03