Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

SPSI: Assignment 2021-2022

Filter Analysis and Implementation

Part A

You have been given the impulse response, h[n], of a digital FIR filter, as shown in     Figure1.  You are required to analyse the response of the filter to the particular input    signal x[n], also shown in Figure 1.  The sampling period for implementation is Ts=0.1 seconds.

FIR filter with impulse response h[n]

3

x[n]

0   1   2   3    ... n

INPUT

h[n]                           3

 

2

 

0

0   1   2   3    ... n

-1

Figure 1

i) Use convolution to find the output, y[n], of the FIR filter in response to the specified input, x[n], shown in Figure 1. Plot the answer. (10)

ii) Obtain the z’ domain transfer function of the Filter in Figure 1 (note: you could use your answer to part i) or obtain directly from h[n]). (10)

iii) Use Matlab to plot the frequency response of the z transfer function of ii).  Include your plot in your assignment return, and describe how you obtained it.  What type of filter is it ? (LP, HP, BS or BP) (10)

Part B

Figure 2 shows the structure of a digital filter in block diagram form.  Assume the filter is implemented with a sampling frequency Fs=10kHz.

i)           Obtain the difference equation describing the behaviour of the filter.

ii)          Does it represent an IIR or an FIR filter ? Justify your answer.

iii)         Determine the impulse response of the filter.

iv)         Find the z-domain transfer function of the system i.e. find Y(z)/X(z).

v)          Determine whether the filter possesses a low-pass, high-pass, band-pass or band- stop characteristic.

vi)         Check your results with Matlab and include supporting plots and the      commands you used.

vii)       Implement the filter in either Matlab or Simulink and provide a step response   characteristic in your report.

Figure 2

1

z-

Part C

i)           Implement the following difference equation on an Arduino (eg. Uno) or an alternative computational  microcontroller/dsp/fpga  etc.  Assume  an  implementation  sampling frequency of Fs= 100Hz. Provide all your code etc in your report so that your results can be reproduced.

y[n]=0.4142y[n- 1] + 0.2929(x[n]-x[n- 1])

NOTE: you can either use a real Arduino board and obtain the output data using a 3rd party graphing tool, OR use an online virtual simulator of an Arduino (eg. Uno) with your code eg. Virtronics, OR you can alternatively decide to use the Serial Plotter function in the Arduino IDE (?). Some example websites that may be useful include those below, although there are many more available—there is no prescriptive way to do this; choose something that you can get working !

https://www.tinkercad.com/circuits

http://www.makerplot.com

https://github.com/gregpinero/ArduinoPlot

https://github.com/devinaconley/arduino-plotter

https://www.megunolink.com

https://github.com/sebnil/RealtimePlotter

You could also open a com port in matlab and display data using matlab routines

ii)           Then apply squarewaves to your implemented digital filter and show that your  filter has the correct step response characteristics (be clear about timescales and amplitudes).

iii)          Use Matlab to confirm your results to Part ii) (include your Matlab plots and be clear about timescales and amplitudes)