Assignment # 04
Assignment # 04
Question # 01
Write a code for convolution between the following two arrays.
A = [ 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90
0.95 1];
B = [ 0.309 0.587 0.809 0.951 1 0.951 0.809 0.587 0.309 1.224e16 0.309 0.587 0.809 0.951
1 0.951 0.809 0.587 0.309 2.449e16];
Question # 02
Download the file ECG_Data(2).txt and store the data in an array of type double.
a) Apply an FIR low pass, with cutoff frequency 40 Hz. Use difference equation for
filtering. Plot the results. Use H[n] as given below.
H[n]
=
[0.266429741357649,
0.0438184729162442,
0.0464078581676495,
0.0484869832839731, 0.0494457581421799, 0.0498726328512953, 0.0494457581421799,
0.0484869832839731, 0.0464078581676495, 0.0438184729162442, 0.266429741357649]
b) Apply an IIR low pass filter, with cutoff frequency 40 Hz. Use difference equation for
filtering. Plot the results. Use Coeff matrices and gain given below,
Num Coeff = [1 2 1];
Den Coeff = [1 1.86462554633675 0.925106300799212];
G = 0.0151201886156165