Download presentation

Presentation is loading. Please wait.

Published byBailey Lodes Modified over 3 years ago

1
Analog and Digital Signals AD/DA conversion BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Feb 5 Lesson 3

2
http://commons.wikimedia.org/wiki/File:A-D-A_Flow.svg Analog signal Voltage changes continuously with pressure. Digital signal Voltage has discrete values. Analog signal

3
Analog signals Smooth and continuous. Most physical and biological signals, e.g. sound, temperature, blood pressure, pH. Many sensors produce an analog signal; temperature, pressure, pH, light intensity etc. Used typically by some older electronic devices, e.g. radio, TV, tape recorders, vinyl records. time

4
Digital signals Discrete and discontinuous. Used by digital computers, i.e. most modern computers, including PC and supercomupters. Used by many modern electronic devices, e.g. satellite radio, digital TV, digital cameras, scientific instruments etc. Advantages over analog signals: immune to noise, flexible hardware, easy computing, robust storing, transmission, compression. 0 1 0 1 0 1 0 1 0 1 0 time amplitude

5
Analog-to-digital conversion (ADC) Modern telecommunication technology. Music recording, CD recordings. Hearing aids with digital signal processing. Scientific instruments, medical devices, e.g. ECG, EEG, pH-meters etc. Digital imaging systems commonly use analog-to- digital converters in digitizing pixels. Digital ECG

6
Analog or Digital? 100 billion (10 11 ) neurons. 100 trillion (10 14 ) synapses. peaks are the firing of the cells. the analog looking signals at the bottom represent sub-threshold activity.

7
McCulloch and Pitts & The Binary Neuron Neurons first studied in the 40’s Only two states were known, firing and not firing.

8
Artificial neural networks can be trained to recognize complex input patterns, e.g. sounds, images, faces etc. Biological brain and its theoretical models work entirely different than the modern digital computers.

9
Modern Digital Computer "Von Neumann Architecture" http://commons.wikimedia.org/wiki/File:Von_Neumann_Architecture.svg#mediaviewer/File:Von_Neumann_Arch itecture.svg

10
10110000 01100001..... inc ecx jne.loop... Machine Assembler C/C++ Matlab code Abstraction from the details of the hardware main() { printf("hello"); } y = 1:10 plot(y.^2) low high

11
Analog-to-digital Converter ADC

12
Sampling rate of ADC

13
Quiz 3 - Sampling %Write the script in Matlab editor: clear samplingInterval=1; %seconds time=0:samplingInterval:4; %seconds signalPeriod = 0.27; %seconds signal = sin(2*pi*time/signalPeriod); figure; plot(time,signal,'.-') 1) Adjust 'samplingInterval' to obtain proper plot of sin(). 2) What is the maximum 'samplingInterval' for which the shape of sin() is preserved? undersampled

14
Quiz 3 Answer samplingInterval= 0.1; 0.01; 0.001; % ok % good % oversampled General rule: (sampling Interval) < (signal period)/2 or (sampling frequency) > 2×(signal frequency), where (sampling frequency) = 1/(sampling Interval).

15
Audio in Matlab [Y,FS,NBITS]=wavread('fileName.wav'); % reads a WAVE audio file and returns Y -sampled data, FS - sample rate in Hertz, NBITS the number of bits per sample. wavplay(Y,FS) ; % plays the signal in vector Y with sample frequency of FS Hertz % alternatively try audioplayer() >> help audioplayer

16
Matlab script to read and play a WAV file: clear fileName = 'THE_MICROSOFT_SOUND.WAV'; [Y,FS,NBITS] = wavread(fileName); plot(Y) wavplay(Y,FS) whos FS NBITS

17
THE_MICROSOFT_SOUND.WAV FS = 22050 %Hz NBITS = 8 length(Y) ans = 135005 %number of elements

18
Addition of sine signal to the original sound time = (1:length(Y))/FS; % length(Y) - returns number of elements sine = 0.2*sin(2*pi*FS/50*time)'; % ' - transpose to column vector wavplay(sine,FS); pause(2) wavplay(Y+sine,FS); figure; plot(time,sine,'g-.',time,Y,'b--',... time,sine+Y,'r:') %... - line continuation

19
Quiz 4- Sounds clear FS = 5000; %sample frequency of 5kHz time = [0:25000]/FS; y1 = 0.25*sin(2*pi*FS/5*time); wavplay(y1,FS) pause(2) y2 = 0.25*sin(2*pi*FS/25*time); wavplay(y2,FS) pause(2) wavplay(y1+y2,FS) plot(time,y1,time,y2,time,y1+y2)

20
Quiz 5- WAV files Search Windows or Google for a '*.wav' file, and copy the file to Matlab current folder. Import the file into Matlab with wavread() or Menu/File/Import. Plot the samples. Play sound with wavplay() (or audioplayer() ). Modify the sound to fade out. Hint: Multiply the audio samples by a decaying function Y2=Y.*exp(-(1:length(Y))/(length(Y)/5))';

21
Note: wavplay() and audioplayer() may be unavailable or not working in some Matlab configurations, e.g. Matlab on Citrix, Mac OS.

Similar presentations

OK

Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.

Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.

© 2018 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google