assignment # 04

2
Advanced Digital Signal Processing Course Instructor: Dr. Tahir Zaidi Assignment # 04 Due Date for On Campus Students: April 25, 2015 Due Date for DL Students: April 25, 2015 Important Notes: This is an individual assignment. Each student must work alone, without help from any other person. Copied assignment will get Zero Marks. Submit the .doc file or .pdf along with codes. Upload the Assignment on Canvas. Filename should be firstname_rollnumber.rar In this assignment you will be required to give C++ code which is compatible with Code Composer Studio v3.3. If you are unable to write the code in Code Composer Studio, write a program in C++ and send a running program. 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.224e‐16 ‐0.309 ‐0.587 ‐0.809 ‐0.951 ‐ 1 ‐0.951 ‐0.809 ‐0.587 ‐0.309 ‐2.449e‐16]; 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 cut‐off 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]

Upload: imran-shah

Post on 16-Dec-2015

3 views

Category:

Documents


0 download

DESCRIPTION

Assignment # 04

TRANSCRIPT

  • Advanced Digital Signal Processing Course Instructor: Dr. Tahir Zaidi Assignment # 04

    Due Date for On Campus Students: April 25, 2015 Due Date for DL Students: April 25, 2015 Important Notes:

    This is an individual assignment. Each student must work alone, without help from any other person. Copied assignment will get Zero Marks.

    Submit the .doc file or .pdf along with codes.

    Upload the Assignment on Canvas.

    Filename should be firstname_rollnumber.rar

    In this assignment you will be required to give C++ code which is compatible with Code Composer Studio v3.3. If you are unable to write the code in Code Composer Studio, write a program in C++ and send a running program.

    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