# Magnitude response and DFT normalization

Suppose I have an FIR denoted h that represents the impulse response of a system. Using MATLAB syntax (for convenience and brevity),

1. What does abs(fft(h)) represent?

If the answer is the system's magnitude response, then please proceed to the next question. If not, please correct me.

1. Is it correct to say that the value of the magnitude response of a system at a given frequency represents the gain applied to an input sine tone at that frequency?

If yes, then please proceed to the next question. If not, please correct me.

1. If I upsample h by, say, a factor of 2, then the values of abs(fft(h)) are doubled compared to the same computation done at the original sampling rate, at least up to the Nyquist frequency of the original rate. This seems to contradict the answer to question 2, because even though the impulse response has twice the number of samples, it represents the same system and therefore, if abs(fft(h)) represents the magnitude response (with magnitude response defined as mentioned above), then there shouldn't be a discrepancy.

These questions should reveal gaps in my knowledge regarding the meaning of a system's magnitude response, and normalization when computing a DFT (see the answers to this related question). I'd appreciate some clarity on these points. Thanks!

Update 1: Below is a figure showing an example. The chosen example FIR is a low-pass filter. Blue is the original sampling rate (1024 samples/second). Red is upsampled by a factor of 2. The system magnitude response is a result of doing abs(fft(.)) to each of the IRs shown on the top left. The two plots below (bottom left should actually read "spectrum" and not "response") shows what the system does to an input, unit amplitude sinusoid of frequency 50 Hz.

Update 2: The confusion has been resolved in the comments section of the accepted answer. The source of confusion was the assumption that upsampling a discrete-time impulse response (as shown above) is exactly the same as sampling an analog IR at the higher sampling rate. This is not the case.

• I am at number 3 now. If you upsample $h$ by a factor of 2, the spectrum is not doubled. It condenses the spectrum by a factor of 2.
– msm
Apr 13, 2017 at 5:04
• but @msm, if it's the most common normalization of the FFT/DFT, then the height of the spectrum will be doubled. Apr 13, 2017 at 5:05
• @msm I was referring to the height of the spectrum as robert bristow-johnson specifies Apr 13, 2017 at 5:11
• I think you are mixing two different things up here. No doubling occurs. I will provide an answer if I find the time...
– msm
Apr 13, 2017 at 5:24
• @msm I have added an example if it helps. Apr 13, 2017 at 5:51

As a simple test, note that the value of the frequency response at $\omega=0$ is given by the sum of all samples (assuming a signal of length $N$):
$$X(0)=\sum_{n=0}^{N-1}x[n]\tag{1}$$
• I guess a little more clarification regarding why it doesn't represent the same system would be helpful (not from a mathematical point-of-view, which I understand). For example, if we think of the above as capturing the impulse response of a real system at two different sampling rates (one twice the other) - therefore measuring the IR of the same system - and I wanted to know what gain the actual system applies to a sinusoid, how would I go about computing that given abs(fft(.)) gives two different answers? Apr 13, 2017 at 7:19
• @Rahul: It doesn't represent the same discrete-time system. If you use the discrete-time system to represent a continuous-time system, then you have to normalize by the sampling interval $T$: $$\int_{-\infty}^{\infty}h(t)dt\approx T\sum_nh(nT)$$ Apr 13, 2017 at 7:48