代做FIR filters、代写Python编程、Python代做、代写Digital Signal代写Database|代写R语言编程

Assignment 2, Digital Signal processing: FIRfiltersBernd Porr2018The task of this assignment is to filter an ECG with FIR filters. Before yourecord from yourself please read the info-sheet and sign the consent form.1 ECG filteringForm groups of 2 students. Submit one report. There are different amplifierswith different gains and converter boards available. When you record the ECGmake sure that you take a note of the gain, bits, etc. If you record with a onechannel amplifier record Einthoven II (google it what it means). Upload the filesonto the ECG forum on moodle or e-mail it to yourself. Give the file a namewhich anonymises the ECG. Use only numbers, characters and the underscorefor your filename.Every group of two has to work on a different ECG. If your initial recordinghas been too noisy just record another one. You can minimise artefactsby lying down and/or placing the electrodes on the shoulders / hips instead ofwrists/ankles. In Python load the file with the command numpy.loadtxt(’myecg.dat’.You’ll get a numpy matrix with time-stamps in ms in the first column and 3columns of ecg with raw unsigned integer numbers. Choose the channel withthe highest amplitude. Also note that the ECG devices will be around all Oct/ Nov so there is plenty of time to record your ECG. You can use one of theexample ECGs from moodle to kick start your work.The Python code must be object oriented (i.e classes). Decide which Pythonclasses to create to structure your code and make it readable.Make sure you scale the ECG properly so that it’s displayed at the rightamplitude.1. Create a Python FIR filter class which implements an FIR filter whichhas a method of the form value dofilter(value) where both the valueargument and return value are scalars and not vectors so that it couldbe used in a realtime system. The constructor of the class takes thecoefficients as its input:class FIR_filter:1def __init__(self,_coefficients):# your code heredef dofilter(self,v):# your code herereturn result[30%]2. Create a Python class which inherits or has an instance of the FIR classabove from 1 but is also able to calculate its own coefficients numerically(=ifft) were the user can specicy the frequency response in a user friendlyway. Think of methods which can manipulate the frequency response sothat the user can specify a high/low/band/stopband filter. Then Filterthe ECG by removing the 50Hz interference and the DC. Let the Pythonclass automatically decide how many taps are needed. Also this filter classneeds to be able to perform realtime processing (i.e. scalar in and scalarout for the filter operation). [30%].2 ECG heartrate detectionThe task is to detect the momentary heart rate r(t) over a long代做FIR filters作业、代写Python编程作业、Python实验作业代做、代写Digital Signal作业er period oftime. For example, after exercise you should see a slow decay of the heart rateto the baseline of perhaps 60 beats per minute. It is not the average heart ratebut the frequency derived from the times between adjacent heartbeats.Record a separate long ECG over a couple of minutes. Ask the person tobreathe in quite deeply which will change the heart rate or anything whichchanges the heart rate for example sending the person up to level 8 and back.1. Create a matched filter Python class which detects the individual heartbeatsin the ECG. Think of the optimum length of the filter and give areason. Optimise the detection by pre-filtering both the ECG and thetemplate. Remember the detection works best when both the signal andthe templates are completely DC free. Use your own FIR filter class forit and square the output of the matched filter to increase the SNR.Instead of taking your own ECG you can also use functions which looklike an ECG. Very popular are the so called Daubechies wavelets whichlook like an ECG r-peak. Python can generate these for you.Test your detector with an ECG which is clean and one where there are alot of artefacts. [20%]2. Implement a Python class which uses the output of the matched filterto calculate the momentary heart rate r(t) over time (not the average!)by measuring the intervals between the detected hearbeats over the wholeperiod of the ECG. Detect the heartbeats by employing a threshold (adaptive,if required). Generally use any heuristics to weed our wrong detection,for example that a heartbeat is usually below 200bpm and above30bpm. [20%]Every report must be based on different ECG recordings. Please keep it shortbut it should make clear what you have done and why you have done it. Includethe Python code (object oriented) as well as plots of the ECGs (timedomain)and their frequency representation (with proper lables). If necessary enhancethe plots with InkScape and remember to use vector based image formats, forexample EPS, SVG, PDF or EMF and not pixel based formats for the report.These figures need to be in the report not attached separately. Also, showzoomed in ECG traces of one heartbeat so that it is possible to identify thedifferent parts of a single heartbeat (see Fig. 1) and that it’s possible to checkif it’s still intact.No high level Python functions except of FFT/IFFT and the window functionsare allowed. Any use of “lfilter” or “firwin” will result in zero marks forthe whole report. If the same ECG data is spotted in two different reports thiswill result in zero marks.Hand in your report at the teaching office (Room 620 James Watt BuildingSouth). Deadline is 12th November 3pm.Figure 1: A normal ECG with P,Q,R,S,T waves (taken from Wikipedia)转自:http://ass.3daixie.com/2018110722443760.html

你可能感兴趣的:(代做FIR filters、代写Python编程、Python代做、代写Digital Signal代写Database|代写R语言编程)