Electrical Communications Systems
Course No. 0909-331-01
Spring 2005
Laboratory Project 1
Waveform Synthesis and
Spectral
Analysis
Objectives
This project has 4 parts. In Part 1,
you
will:
- Generate arbitrary waveforms with
specified SNR's using software;
- Synthesize this waveform using an
arbitrary
waveform generator.
In Part 2, you will study the differences
between
the Continuous Fourier Transform (CFT) and the Discrete Fourier
Transform
(DFT) (this is homework!). In Part 3, you will synthesize AM and
FM
bandpass signals and analyze their spectra. In Part 4, you will capture
and
analyze the spectra of:
- A baseband NTSC composite video signal;
- An electrocardiogram (ECG) signal.
Equipment and Software
- HP 33120A Function Generator/Arbitrary
Waveform
Generator
- HP 54645A with HP 54657A FFT Moduleor
Agilent
Infinium Oscilloscope
- NTSC baseband composite video source
(VCR/Camcorder/RGB to NTSC Encoder/Sony Color Camera/CCB-GL5 Camera on PCB)
- RGA-BNC connector
- Clinimark Pinstyle ECG Electrodes with
leads
- Antiseptic prep pads
- Human with beating heart (or, if absent,
a Lionheart 3 cardio-simulator)
- 9 V DC batteries/ Isolated DC power supply
- 10-X Scope Probe
- Burr-Brown INA114 Precision
Instrumentation
Amplifier. Dowload data-sheet here.
- MATLAB
- Agilent IntuiLink
Connectivity Software
Part 1: Digital synthesis of arbitrary
waveforms
with specified SNR
Background
- SNR in dB = 10 log10 (ss2/sn2); where ss2:signal variance, sn2: noise variance
- Given signal, s(t), find ss2
- Compute required sn2
- Generate noise signal, n(t) = snN(0,1),
where N(0,1) is a Normally (Gaussian) distributed random variable with
Zero
mean and Unit variance
- Message signal with desired SNR, m(t) = s(t) + n(t)
|
Procedure Overview
- Synthesize a 2 second A-Sharp sinusoidal
tone
(466.16 Hz) sampled at 8 kHz.
- Plot this waveform; observe. Save this waveform to a .wav sound
file,
play using the Sound Recorder and listen. (You can also listen using
the sound command in Matlab).
- Save the waveform to an ASCII file using a .csv extension for
downloading to the HP33120A Arbitray Function Generator.
- Corrupt this signal with a Gaussian noise source to get an SNR
of
10 dB. Observe, listen and save waveform as before.
- Synthesize 1 cycle of the noisy waveform.
- Download the original and noisy signals to the HP33120A
Arbitrary
Function Generator using either the HP Benchlink or HPVEE software.
- Vary the frequency and amplitude.
- Observe waveform using the Oscilloscope.
- Repeat experiment with various SNRs.
- Experiment with other waveforms:
- s(t) = Ac[1 + cos(2pfmt)]cos(2pfct) with varying Ac, fm
and fc.
- s(t) = Accos[2pfct
+ bfsin(2pfmt)]
with varying Ac, bf, fm
and fc.
Example Matlab Code
%ECOMMS Lab Project 1 Example Spring 02
%S. Mandayam, Rowan University
%This program generates a 2-second
duration
%Asharp signal (466.16 Hz) with a specified
SNR
%Specify SNR
snr=10;
%Generate Asharp signal
t=[0:1/8e3:2.0]';
s = 0.5*sin(2*pi*466.16*t);
sound(s);
wavwrite(s, 'asharp.wav');
save asharp.csv -ascii s;
%Compute signal variance
var_s = cov(s);
%Calculate required noise variance
var_noise=var_s/(10^(snr/10));
%Generate noise
n=sqrt(var_noise)*randn(length(s),1);
sound(n);
%Add signal to noise and generate message
m=s+n;
sound(m);
wavwrite(m,'asharp_noise.wav');
save asharp_noise.csv -ascii m;
|
Part 2: Comparison between CFT and DFT
(FFT)
(Uses Matlab only) (This is
Homework!)
Consider the signal shown in Figure 1:
Figure 1: Time-domain signal
- Model the signal as a continuous-time
function
and plot.
- Obtain, analytically, the CFT of
the
signal, and plot.
- Based on your observations of the
frequency
components of the signal, determine the maximum sampling period/minimum
sampling
frequency that will allow reconstruction of the continuous-time signal.
- Plot the DFT magnitude spectrum using
Matlab's fft function.
- Attempt to reconstruct the original
continuous-time function from its samples, either by:
- Convolving the time domain samples with
appropriate Sinc function (difficult), or
- Windowing the Fourier transform and
taking
the inverse Fourier transform (easier).
Comment on your results.- What is the maximum sampling period/minimum sampling
frequency
that will allow reconstruction of the discrete-time signal from its
DFT,
that adequately represents the original continuous-time signal? Show
plots
of the discrete-time signals, the corresponding DFTs and
reconstructions, for sampling intervals at, above and below this
maximum allowed sampling period.
Part 3: Spectral Analysis of AM and FM
Signals
(Uses Matlab, Oscilloscope, Function Generator and Spectrum
Analyzer)
- Synthesize a bandpass AM signal, s(t) = Ac[1 + Amcos(2pfmt)]cos(2pfct)
where fm = 5 kHz and fc = 25 kHz.
- Obtain and plot the spectral components of this signal using:
- Matlab's fft function.
- The spectrum analyzer/ FFT module.
- Add noise to the RF signal, observe the signal in the time and
spectral domains.
- Experiment with various fms, fcs and SNRs.
- Synthesize a bandpass FM signal, s(t) = Accos[2pfct + bf
Amsin(2pfmt)]
wherebf = Frequency Modulation
Index (choose
initially = 10).
- Repeat earlier experiments.
Part 4 (a): Spectral Analysis of Composite NTSC Baseband Signal
(Uses Matlab, Oscilloscope, VCR, and
Spectrum
Analyzer/FFT Module)
Figure 2 shows a composite NTSC baseband video
signal.
Figure 2: Composite baseband NTSC video
signal
- Observe the NTSC video signal on an
Oscilloscope. In particular, measure the horizontal sweep interval time
and the frequency and number of the color-burst subcarrier signal
located on the "back porch". This subcarrier signal contains the
chrominance or (color) infomation.
- Digitally acquire this signal using the
HP Benchlink Suite software and obtain its DFT using Matlab. Identify
the subcarrier frequency
component and its dB level below the fundamental.
- Compare your results with the spectrum
analyzer.
Part 4 (b): Spectral Analysis of ECG Signal
(Uses Matlab, Oscilloscope, ECG
Electrodes,
Antiseptic Prep Pads, Isolated Power Supply/ 9 V DC batteries, 10-X
Scope-Probe
and Spectrum Analyzer/FFT Module)
NOTE: READ THIS
FIRST!!!!!!!!!!!
This experiment must be conducted with
the instructor present at all times when you are obtaining the ECG
readings. The
procedure that has been outlined below has been determined to be safe
for this laboratory. You must use an isolated power supply for
powering the instrumentation amplifier. You must use a 10-X
scope probe for recording the amplifier output on the oscilloscope.
This objective of this experiment is compute the amplitude-frequency
spectrum of real data - this experiment does not represent a true
medical study; reading an ECG effectively takes considerable medical
training. Therefore, do not be alarmed if your data appears"different"
from those of your partners. Also, if you observe any allergic
reactions when you attach the electrodes (burning sensation,
discomfort), remove them and rinse the area with water. Finally, if,
for any
reason, you do not want to participate in this experiment, obtain
recorded
ECG data from your instructor. |
- Electrocardiagram (ECG or EKG) measurements are used to monitor
the
contraction of the cardiac muscles by measuring the propagation of
electrical
depolarization and repolarization in the atria and ventricles. The ECG
is
one of the many diagnostic tools for monitoring the normality of
cardiac
activity in a patient. The references provided below provide
considerable
additional information regarding the ECG. Figure 3 shows the components
of
a typical ECG signal.
Figure 3: Components of a typical ECG signal
- The experimental set-up for obtaining ECG measurements is shown
in
Figure 4. Make sure your instructor is present before you power-on
and
start taking measurements!
Figure 4: Experimental set-up for taking ECG measurements.
- Select one of your lab partners as the "patient" for obtaining
the
ECG. Use the antiseptic prep pads and thoroughly clean the wrist area
where the electrodes will be attached. A thorough cleaning is required
to ensure a good contact of the electrode with the skin - and a
strong signal.
- Remove the electrodes from the release sheet and place each
electrode
on the inside wrist of each arm. (This method of electrode placement is
known as Standard I Lead). Press firmly to ensure adequate
contact.
- Attach the electrode lead wire pin into the slot - the other end
of
the lead wire is connected to the appropriate terminal of the
instrumentation amplifier.
- Use a 10-X scope probe and connect the output terminal of the
instrumentation amplifier to the oscilloscope.
- With the instructor present, power on the
instrumentation amplifier. Observe the ECG signal on the screen. To
obtain a strong signal, you may need
help from your lab partner to press the electrodes firmly to your arm.
- Capture the waveform using Benchlink Scope. You may observe a
strong
60 Hz ripple - you can eliminate this by filtering the signal using DSP
techniques.
- Comment on the time and frequency components of the ECG
signal.
Click here for required lab project
report
format.
Click here for suggestions for a
good lab report.
References:
- HP 33120A Function Generator/Arbitrary
Waveform
Generator User's Guide
- Appendix B (p. 650) in textbook
- Zsolt Papay, Technical University of Budapest (TUB),"Experiments
in Gaussian White-noise Generation," HP Test and Measurements
Educator's Corner, http://www.educatorscorner.com/index.cgi?CONTENT_ID=2254
- Chapter 2 in the texbook.
- Class Demo: Sampling
- Class Demo: Discrete
Fourier Transform
- Section 8-9 (Television) in texbook -
pages
589-601.
- Kelin J. Kuhn, Conventional Analog
Television
- An Introduction, http://www.ee.washington.edu/conselec/CE/kuhn/ntsc/95x4.htm
- L. A. Geddes and L. E. Baker, Principles
of
Applied Biomedical Instrumentation, 2nd Edition, Wiley, 1975.
- Frank G. Yanowitz, MD, University of Utah
School of Medicine, The Alan E. Linday ECG Learning Center in
Cyberspace, http://www-medlib.med.utah.edu/kw/ecg/ecg_outline/
- UNL Physics and Astronomy, Physics
142
Labs, L63:Measuring Potentials of the Heart, http://www-class.unl.edu/phys142/Labs/L63/ECG_handout_web.html