联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Python编程Python编程

日期:2018-12-02 10:30

Assignment 3, Digital Signal processing: IIR filters

Bernd Porr

2018

This assignment covers IIR filters which as before can be low/high/band or stopband

filters.

The task is to add IIR filters to a Python Oscilloscope to filter out any interference from

a noisy input signal.

We have Arduinos, Attys DAQ boards (www.attys) and the USB-DUX boards (www.linuxusb-daq.co.uk).

All can operate in realtime under Python. Links to the APIs and exanples

are provided on moodle. Your task is to measure a (noisy) physcial quantity and use realtime

IIR filtering to turn the raw noisy signal into a smooth, tidy signal.

Examples of noisy signals you can measure:

Temperature using the voltage drop over a diode

Temperature using a thermocouple (i.e. two different metals)

Pulse detection using an light dependent resistor

Athmospheric pressure changes

“Earthquake” detector using a piezo

Distance sensing via a capacitor

Mechanical strain measurements with a piezo sensor

Realtime ECG heartbeat detection during exercise using a bandpass/highpass (biomed

team)

Displaying EEG alpha/beta waves (biomeds team)

Detecting the small oscillometric pressure changes in the blood pressure cuff (biomed

team)

Hackaday has a lot of good examples and other Maker pages. You can create your circuit on

a breadboard, matrix board, etc. Feel free to use any component which is in the electronic

component store on level 7.

Every team needs to measure something differnet. Add your topic to the wiki provided

on moodle.

Again you work in teams of two students and one report is submitted per team.

1

This task requires planning/initiative before you come to the lab. Think of

a scenario before the lab starts. It’s not the task of the lab demonstrators /

technicians to come up with ideas here and they need to come genuinely from

you. I’d like to see different ideas from every team. Enter you project ideas on

the WIKI on moodle so that others can see what’s already taken. Feel free to

discuss it with us.

1. Present a measurement problem which requires realtime filtering. Marks are given for

initiative, inventiveness and originality (= ideas which haven’t come straight from the

lecturer, lab demonstrators or other groups). Document the experiment with:

photos of the setup

dataflow diagrams

YouTube clip(s)

in addition to your report. [20%]

2. Decide which sampling rate you’d like to use. Python is a scripting language which is

much slower than C++ and there is the risk samples go missing. Test if your desired

sampling rate is safe by sending test frequencies into the ADC. How can you test that no

samples have gone missing? If you have an ADC running at a sampling rate fs which

test signal is useful for an SAR ADC (arduino) or a Sigma Delta converter (Attys)?

[10%]

3. Determine the filter response(s) which are required here and justify them.

Generate the sos coefficients for the filter(s) with the help of Python’s high level functions.

In particular also consider the pure digital solution of a bandstop/highpass shown

the lecture if appropriate. [20%]

4. Write two classes: a) IIR2Filter which implements a 2nd order IIR filter which takes

the coefficients in the constructor and has a method called:

y=IIR2Filter.filter(x)

where y and x are simple scalars (no arrays) as before. b) a class IIRFilter which

directly takes the sos array from the high level IIR design commands as its constructor

argument and which then creates a chain of 2nd order filter instances of IIR2Filter.

Again implement a function which then filters the signal:

y=IIRFilter.filter(x)

and then internally processes the data x by sending it through the chain of 2nd order

filters. [30%]

5. Compare your filtered results with the original recordings, show both signals in the

realtime demo (YouTube clip) and discuss if you have been successful. Do a critical

analysis. [20%]

Deadline for the report is 17th Dec 3pm. As before I expect sharp figures in vector format

in the report.

High level design commands are allowed but the actual IIR filtering operations need be

written from scratch as outlined above. Any use of lfilter or other high level python filter

operation will result again in zero marks. Proof of realtime processing in form of a video

needs to be given. Please add your link to the wiki.

The report can also be written purely on github which should then contain the software,

the report and the video clip. In this case please submit a single page containing the link to

github and add it to the WIKI.


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp