Frequency response

Response FIR to phasor with single frequency

Since each single frequency can be viewed as the sum of two phasor components, we will first study the response of a very simple FIR filter, a delay, as a result of an input signal x[n] which consists of one phasor frequency θ1, amplitude A and phase ϕ, thus x[n]=Aej(θ1n+ϕ). This is depicted in Fig. 1.

Response of a delay to signal $x[n]$.
Response of a delay to signal x[n].

The output can be calculated as follows: y[n]=x[n1]=Aej(θ1(n1)+ϕ)=Aej(θ1n+ϕθ1)=ejθAej(θ1n+ϕ) From this result it follows that when applying a single phasor with frequency θ1 to a delay, then the output y[n] contains exact the same phasor (denoted in red) with the same frequency θ1. Only the phase of the phasor has changed from ϕ to ϕθ1.

Example


Given an FIR filter which consists of 4 delays, or equivalently, the impulse response equals h[n]=δ[n4]. Calculate the response of this filter when the input is a phasor with frequency θ1=π8: x[n]=2ej(π8n+π3).
The output of this FIR filter with 4 delays is as follows: y[n]=x[n4]=2ej(π8(n4)+π3)=2ej(π8n4π8+π3)=ejπ22ej(π8n+π3)=2ej(π8nπ6). Thus a system which contains 4 delays does only change the phase of the input phasor (from +π3 into π6).

Example


Calculate the response of a simple FIR filter, as depicted in the figure below, when the input is the following phasor with frequency θ1=π8: x[n]=2ej(π8n+π3).
Simple FIR filter.
Simple FIR filter.

The output of this FIR filter is as follows: y[n]=x[n]+x[n4]=2ej(π8n+π3)+2ej(π8(n4)+π3)=(1+ejπ2)2ej(π8n+π3)=2ejπ42ej(π8n+π3)=22ej(π8n+π12). So the phasor at the output has the same frequency (π8) as the input, only the amplitude has changed from 2 into 22 and the phase has changed from +π3 to +π3π4=π12.

The previous results can by generalized by using the following equation which describes the convolution sum of an FIR: y[n]=k=0M1h[k]x[nk], in which h[n], for n=0,1,,M1 are the impulse response coefficients of the FIR filter. From this convolution sum we can calculate the following response of this system to the phasor x[n]=Aej(θ1n+ϕ): y[n]=k=0M1h[k]Aej(θ1(nk)+ϕ)=(k=0M1h[k]ejkθ1)(Aej(θ1n+ϕ)). Thus we can split the result as a product of a complex quantity (in blue) multiplied with the phasor description of the input signal (in red). The complex quantity (in blue) only depends on the FIR impulse response h[n] and the phasor frequency θ1 of the input signal. Because of the fact that we can use any frequency for the frequency θ1, we can generalize this complex quantity as a function of θ which leads to the following definition:

Frequency Response of FIR:H(ejθ)=k=0M1h[k]ejθk Here we denote the (discrete) impulse response with a small letter h, square brackets [] and it is a function of discrete time function variable n. The frequency response is denoted by a capital letter H, round brackets () and it is a function of the continuous frequency variable θ. In fact we could denote the frequency response as H(θ). The reason that it is denoted as H(ejθ) will be explained in one of the following sections.

The frequency response H(ejθ) of an FIR describes how a phasor frequency of an input signal is changed in amplitude and phase by the FIR filter. E.g. for an input signal with phasor frequency θ1 the change in amplitude is a result of the magnitude of the frequency response evaluated at frequency θ=θ1, denoted by |H(ejθ1)|. Furthermore the change in phase is a result of the phase of the frequency response evaluated at frequency θ=θ1, denoted by H(ejθ1). This is depicted in Fig. 2.

Response of an FIR to a phasor input signal with frequency $\theta_1 $.
Response of an FIR to a phasor input signal with frequency θ1.

Example


First calculate the Frequency response H(ejθ) of the FIR filter with impulse response h[n]=δ[n]+2δ[n1]+δ[n2] and then evaluate the response of this FIR filter to the phasor frequency x[n]=ej(π3n+π4).
With the given impulse response h[n] we obtain from the definition of the frequency response the following expression: H(ejθ)=1ej0θ+2ej1θ+1ej2θ=1+2ejθ+ej2θ. With the input signal x[n]=ej(π3n+π4) the resulting output signal can be found as follows: y[n]=x[n]+2x[n1]+x[n2]=ej(π3n+π4)+2ej(π3(n1)+π4)+ej(π3(n2)+π4)=(ej0π3+2ej1π3+ej2π3)ej(π3n+π4) Alternatively, we can obtain the first part (in blue) of this last equation by evaluation the general description of the frequency response H(ejθ), as derived in the equation above, for frequency θ=π3. This will be denoted by H(ejθ)θ=π3. Thus for an input signal x[n]=ej(π3n+π4), which consists of a single phasor frequency θ=π3, with amplitude A=1 and phase ϕ=π4, we can alternatively obtain the output y[n] of this FIR filter as follows: y[n]=(H(ejθ)θ=π3)ej(π3n+π4)=(ej0π3+2ej1π3+ej2π3)ej(π3n+π4)=(3ejπ3)ej(π3n+π4)=3ej(π3nπ12). Thus, the output signal y[n] is also a phasor with the same frequency θ=π3 as the input. However, the amplitude and phase of the input signal have been changed in a way which can be obtained by evaluating the frequency response H(ejθ) for the frequency θ=π3 of the input signal.



Response FIR to sinusoidal signal with single frequency

Using the result of the previous subsection we can now find in a few steps, as depicted in Fig. 3, the response of an FIR filter to a sinusoidal signal with a single frequency x[n]=Acos(θ1n+ϕ).

Response of an FIR to a sinusoidal signal with a single frequency.
Response of an FIR to a sinusoidal signal with a single frequency.

The first step is to split the sinusoidal signal into two phasor components, using Euler. Next we can use the Linear Time Invariant (LTI) property of an FIR filter: Applying the sum of 2 signals to an FIR filter is equal to first applying the individual signals to the same FIR filters and than adding the results. This is depicted in the lower part of Fig. 3. In the upper branch of this figure the FIR filter is ‘triggered’ by a phasor with frequency +θ1, while in the lower branch a copy of the same FIR filter is ‘triggered’ by a phasor with frequency θ1. As explained in the previous subsection, the change in amplitude and phase of both upper- and lower branch input signals follows from the magnitude |H(ejθ)| and phase H(ejθ) of the frequency response evaluated at frequency θ1 and θ1 respectively. When adding the results of upper- and lower-branch, we obtain a sinusoidal signal at the output of the filter, of which the frequency is the same as the frequency of the input signal. The amplitude A of the input signal has been changed by the magnitude |H(ejθ1)| of the frequency response of the FIR, while the phase ϕ of the input signal has been changed by the phase H(ejθ1) of the frequency response. This is depicted in Fig. 4.

Response of an FIR to a sinusoidal input signal.
Response of an FIR to a sinusoidal input signal.

Concluding, we have the following general result:

When applying a sinusoidal signal with a single frequency θ=θ1 to an FIR filter, the output is a sinusoidal signal with the same frequency θ1 as the input signal, only the amplitude and phase have changed. The change in amplitude is described by the magnitude response evaluated at frequency θ1, thus |H(ejθ)θ=θ1, while the change in phase is described by the phase response evaluated at frequency θ1, thus H(ejθ)θ=θ1.

Example


In this example we use the same FIR filter as used in the previous example. Thus h[n]=δ[n]+2δ[n1]+δ[n2] and from this it follows that the frequency response is given by H(ejθ)=1+2ejθ+ej2θ. Now the input signal is given by the following sinusoidal signal: x[n]=cos(π3n). Calculate the output signal y[n].
Now we can use the superposition property, which implies that we can evaluate the output y[n] to the input signal x[n]=cos(π3n) by first splitting the cosine into its two phasor components x1[n]=ejπ3n and x2[n]=ejπ3n. Then evaluate the output of each of these two individual phasor components, which results into: x1[n]=ejπ3ny1[n]=H(ejπ3)ejπ3n=3ejπ3ejπ3n=3ej(π3nπ3)x2[n]=ejπ3ny2[n]=H(ejπ3)ejπ3n=3ejπ3ejπ3n=3ej(π3nπ3) By adding the two phasor components and dividing by 2, we obtain the given input signal: x[n]=12{x1[n]+x2[n]}=12{ejπ3n+ejπ3n}=cos(π3n) Now because of the fact that an FIR filter is LTI, we can evaluate the output y[n] by applying the same operations to the two individual output signals y1[n] and y2[n], thus: y[n]=12{y1[n]+y2[n]} which results into: x[n]=12{ejπ3n+ejπ3n}y[n]=12{3ej(π3nπ3)+3ej(π3nπ3)}x[n]=cos(π3n)y[n]=3cos(π3nπ3) We can also obtain this result directly from the frequency response by evaluating the amplitude and phase of the frequency response for the input frequency θ=π3, as follows: x[n]=cos(π3n)y[n]=|H(ejθ)θ=π3cos(π3n+H(ejθ)θ=π3)=3cos(π3nπ3) The result is depicted in the figure below.
Example response of FIR to sinusoidal signal with one frequency.
Example response of FIR to sinusoidal signal with one frequency.



Superposition

Because an FIR filter is Time Invariant (LTI) system, we can use the superposition rule when an input signal consists of more than one frequency. So let us assume the input signal of an FIR filter consists of a DC component and N different frequencies as follows: x[n]=A0+k=1NAkcos(θkn+ϕk). Furthermore the frequency response of an FIR is given by: H(ejθ)=|H(ejθ)|ejH(ejθ) Each of the individual frequencies θk of the input signal will ‘trigger’ the FIR filter only at frequency θk. This implies that the amplitude Ak of frequency θk is changed by |H(ejθk)| and the phase ϕk is changed by H(ejθk). This results in the following output signal: y[n]=|H(ej0)|+k=1N|H(ejθk)|Akcos(θkn+ϕk+H(ejθk))

Example


In this example we use the same FIR filter as in the previous example. Thus h[n]=δ[n]+2δ[n1]+δ[n2] and the frequency response is given by H(ejθ)=1+2ejθ+ej2θ. Now, the input signal is given by the following frequencies: x[n]=1+43cos(π3n)+2cos(π2n)+cos(πn). Calculate the output signal y[n].
Using superposition, we first calculate the response of the given FIR filter as a result of the individual frequency components of the input signal x[n] and then we add the resulting outputs. With the individual frequency components θ=0,±π3,±π2 and θ=±π, this results in: H(ejθ)θ=0=4H(ejθ)θ=π3=H(ejθ)θ=π3=3ejπ3H(ejθ)θ=π2=H(ejθ)θ=π2=2ejπ2H(ejθ)θ=π=H(ejθ)θ=π=0. Now the output becomes: y[n]=41+343cos(π3nπ3)+2cos(π2nπ2)+0cos(πn)=4+4cos(π3nπ3)+4cos(π2nπ2).