laboratorium 05 py id 261472 Nieznany

background image














SIGNAL PROCESSING

Laboratory #5:

Fourier transform of signals in Python







M. Kociński, P. Strumiłło



Medical Electronics Division

Institute of Electronics






background image



Signal Processing, Biomedical Engineering

M. Kociński, P. Strumiłło, Institute of Electronics, Lodz University of Technology


PURPOSE:


Computing and plotting the Fourier transform of signals in Python environment.


TASKS:


Task 1:
Define a harmonic signal

x(t)=Asin(2

ft) of frequency f=50 Hz and amplitude A=10 consisting of

N=2000 samples and

sampled at a rate of fs=1000 Hz.

a. plot the defined signal in a correct time scale, compute its amplitude Fourier spectrum (using the

fft command form scipy.fftpack package) and plot it in a physical frequency scale in Hertz units;
comment the result; (hint: frequency scale of the DFT can be computed from the formula:

N

f

k

kf

s

0

, where f

0

is the frequency resolution);.

b. compute the inverse transform of the Fourier spectrum of the harmonic signal x(t) and plot the

result (hint: due to limited computing precision you will need to select and plot the real part of
the obtained complex signal)

c. repeat a) by changing just the frequency of the harmonic function to f=50.25 Hz . What

difference do you notice in the spectrum plot for the new frequency of the sinusoid? To see
better the difference use the stem command from the pylab package for plotting the spectrum and

select the zoom icon

in the figure window and zoom in onto appropriate plot fragment.

d. build a signal being a sum of the three sinusoids: x1(t)=5sin(50

t), x2(t)=10sin(100

t),

x3(t)=20sin(150

t). Compute the Fourier amplitude spectrum of the defined signal. Can you

determine frequencies and amplitudes of these harmonic functions from the Fourier spectrum?



Task 2:

a. to the signal defined in 1d add a Gaussian noise of zero mean and standard deviation

20

(hint: use random.normal function from the numpy package).

b. Plot the obtained noisy signal. Can you determine from the time plot of this signal what are the

hidden frequencies in it?

c. Computer and plot the amplitude spectrum of the signal defined in 2a. Can you determine now

the harmonic components in the noisy signal?










background image



Signal Processing, Biomedical Engineering

M. Kociński, P. Strumiłło, Institute of Electronics, Lodz University of Technology

Task 3:

Load the ecg_mit. mat ECG signal given in the Matlab binary file from the signal Processing lecture
signal bank.

a. plot the loaded ECG signal in a correct time (in seconds) and amplitude (in mV) scales given

a sampling rate of fs=360Hz and an 11-bit coding of signal amplitude range: -5mV

+5mV

b. compute and plot the Fourier amplitude spectrum of the first N=1800 samples of the ECG

signal; What is the frequency resolution used for plotting this spectrum? How can you
comment the obtained poor result showing that the spectra amplitudes are almost zero except
for the 0Hz value?

c. now, before computing the Fourier spectrum, remove the mean value (i.e. the DC

component) of the ECG signal. Why do we need to do it?

d. can you spot in the plotted spectrum the frequency of the power line contaminating the

recorded ECG signal? What is the frequency of the power line in the USA?

e. for the volunteer: propose a method for removing the powerline contamination and verify

your method by plotting the enhanced ECG signal in the time domain.

□2/11/2012


Wyszukiwarka

Podobne podstrony:
laboratorium 01 py id 261468 Nieznany
laboratorium 06 py id 261473 Nieznany
laboratorium 02 py id 261471 Nieznany
Lab 05 Obliczenia w C id 257534 Nieznany
Laboratorium z TM spr1 id 26189 Nieznany
ei 2005 05 s022 id 154158 Nieznany
cw 05 instrukcja id 121376 Nieznany
Laboratorium 2i3 zswier id 2615 Nieznany
26 05 2011 id 31262 Nieznany (2)
cw 05 formularz id 121375 Nieznany
Laboratorium 7 z TM spr2 id 261 Nieznany
05 06 id 418348 Nieznany (2)
er 05 04 id 162953 Nieznany
4 05 2011 id 36932 Nieznany (2)
2wyklad 05 packetyzer id 32778 Nieznany (2)
ei 2005 05 s048 id 154161 Nieznany
Namar laboratoria 2012 13 id 31 Nieznany
Laboratorium TSS cw3 id 261862 Nieznany
Laboratorium zadania cz 1 id 26 Nieznany

więcej podobnych podstron