284x Filetype PDF File size 1.35 MB Source: static1.squarespace.com
MATLAB SIMPLIFIED
Practical Programming and Signal Processing for Scientists
Copyright 2013 David Mann, Loggerhead Instruments
Table of Contents
Getting Started ........................................................... 5
MATLAB .................................................................... 6
Launch MATLAB ........................................................ 6
Matrices ................................................................... 12
A First Program ........................................................ 14
Sources for MATLAB Help ....................................... 15
MATLAB Help File ....................................................... 15
Mathworks Online........................................................ 17
Learning to Program ................................................ 18
MATLAB Scripts (m-files) ......................................... 18
MATLAB Path .......................................................... 19
Fundamental Programming Constructs .................... 21
For Loops .................................................................... 21
If .................................................................................. 22
Relational and Logic Operators ................................... 23
Basic File Input ........................................................ 29
Matrix Manipulation .................................................. 40
Introduction to Time Series Analysis ........................ 52
Analog and Digital Signals ....................................... 52
Sampling Rate ......................................................... 53
Aliasing ........................................................................ 54
Avoiding Aliasing ......................................................... 56
Nyquist Theorem ............................................................... 56
Anti-Aliasing Filters ........................................................... 56
Sampling Resolution ................................................ 57
Bits .............................................................................. 57
Digital Resolution ......................................................... 59
Measurement Resolution ............................................. 59
Decimal Numbers ........................................................ 60
Reading Data Files with fread() ............................... 60
File Reading Example: ...................................................... 61
MATLAB Functions.................................................. 63
RMS ............................................................................. 63
Using RMS Example .................................................... 65
Fourier Transform .................................................... 67
Measuring Amplitudes of Specific Frequencies ........... 75
Determining Peak Amplitude and Frequency ............... 75
Additional Details ......................................................... 76
Digital Filters ............................................................ 77
Finite Impulse Response (FIR) Filters ..................... 78
What about the end bits? ............................................. 81
Visualizing the frequency response of the filter ............ 81
More Reason to ♥ MATLAB! ........................................ 83
Infinite Impulse Response (IIR) Filters ..................... 84
Try This ........................................................................ 87
How Do IIR Filters Work? ............................................ 88
Automatic Signal Detection...................................... 90
Energy Detectors ..................................................... 90
Energy Detection in the Time Domain ......................... 90
Energy Detector Example ........................................ 91
Step 1. Filter the signal .................................................... 92
Step 2. Rectify Signal ........................................................ 93
Step 3. Envelope Signal ................................................... 94
Step 4. Threshold Signal ................................................... 94
find ..................................................................................... 96
Image Processing .................................................... 97
Basic MATLAB Image Functions ................................. 97
Creating and plotting an image ................................ 98
Plotting the Matrix as an Image ......................................... 99
Colormap ......................................................................... 100
Try This ...................................................................... 105
Loading and Manipulating an Image ...................... 105
Thresholding Images ............................................. 107
no reviews yet
Please Login to review.