Summary

This document is a set of lecture notes on dynamic systems, covering topics such as sensors, signal analysis, and programming. It includes detailed information on various types of sensors, including resistive, capacitive, and inductive sensors, and their characteristics. It also describes the principles of signal analysis and processing techniques. Lastly, it touches upon programming and MATLAB aspects.

Full Transcript

Indhold {#indhold.Overskrift} ======= [Sensor technology 3](#sensor-technology) [Lecture 1 -- Basics of sensors 3](#lecture-1-basics-of-sensors) [Lecture 3 -- Resistive sensors 3](#lecture-3-resistive-sensors) [Lecture 4 -- Capacitive and inductive sensors 4](#lecture-4-capacitive-and-inductive-...

Indhold {#indhold.Overskrift} ======= [Sensor technology 3](#sensor-technology) [Lecture 1 -- Basics of sensors 3](#lecture-1-basics-of-sensors) [Lecture 3 -- Resistive sensors 3](#lecture-3-resistive-sensors) [Lecture 4 -- Capacitive and inductive sensors 4](#lecture-4-capacitive-and-inductive-sensors) [Lecture 5 -- Microphone 4](#lecture-5-microphone) [Signal analysing 5](#signal-analysing) [Lecture 1 -- Signals and statistics 5](#lecture-1-signals-and-statistics) [Lecture 2 -- Number representation 5](#lecture-2-number-representation) [Lecture 3 -- Linear systems 5](#lecture-3-linear-systems) [Lecture 3 -- Fourier transform 5](#lecture-3-fourier-transform) [Lecture 4 -- Frequency plot 6](#lecture-4-frequency-plot) [Lecture 5 -- Convolution 6](#lecture-5-convolution) [Lecture 6 -- Heart sounds 6](#lecture-6-heart-sounds) [Lecture 7 -- filters 6](#lecture-7-filters) [Lecture 7 -- moving average 7](#lecture-7-moving-average) [Lecture 8 -- FIR Frequency separation filters 7](#lecture-8-fir-frequency-separation-filters) [Lecture 9 -- IIR filters 7](#lecture-9-iir-filters) [Programming 9](#programming) [Lecture 1 9](#lecture-1) [Lecture 2 10](#lecture-2) [Lecture 3 10](#lecture-3) [Lecture 4 11](#lecture-4) [Lecture 5 11](#lecture-5) [Lecture 6 12](#lecture-6) [Questions that may be good to be able to answer before final exam 12](#questions-that-may-be-good-to-be-able-to-answer-before-final-exam) [Explanation of MATLAB code from project 14](#explanation-of-matlab-code-from-project) [Step 1 -- Loading of the data 14](#step-1-loading-of-the-data) [Step 2 -- Editing the time data 15](#step-2-editing-the-time-data) [Step 3 -- Data validations 16](#step-3-data-validations) [Step 4 -- Calculating the sampling frequency 17](#step-4-calculating-the-sampling-frequency) [**Step 5 -- Removal of the DC-offset** 18](#step-5-removal-of-the-dc-offset) [Step 6 - FFT (Fast fourier transformation) 19](#step-6---fft-fast-fourier-transformation) [Step 7 -- Filter design and application 21](#step-7-filter-design-and-application) [Step 8 -- FFT after filtering 22](#step-8-fft-after-filtering) [Step 9A -- Identification of the peaks 24](#step-9a-identification-of-the-peaks) [Step 9B -- Highlighting the peaks of S2 25](#step-9b-highlighting-the-peaks-of-s2) [Step 10 -- Calculation of the heart rate 27](#step-10-calculation-of-the-heart-rate) [Explanation of Code Structure and Purpose of Key Functions and Decisions 29](#explanation-of-code-structure-and-purpose-of-key-functions-and-decisions) [Forsøg 1A - Amplitude Change 29](#fors%C3%B8g-1a---amplitude-change) [Forsøg 1B - Frequency Change 29](#fors%C3%B8g-1b---frequency-change) [Databehandling - Data Plotting and Fitting 30](#databehandling---data-plotting-and-fitting) [\ ] [Sensor technology] =============================== +-----------------------------------+-----------------------------------+ | Lecture 1 -- Basics of sensors | | | ------------------------------ | | +===================================+===================================+ | Passive vs Active sensor | | +-----------------------------------+-----------------------------------+ | Transfer function | What is a transfer function? | +-----------------------------------+-----------------------------------+ | | Why is the inverse of a transfer | | | function often interesting? | +-----------------------------------+-----------------------------------+ | | A transfer function | | | | | | - Can have many functions | | | | | | - We often linearize it | +-----------------------------------+-----------------------------------+ | Three types of Calibration | | +-----------------------------------+-----------------------------------+ | | Grinding | +-----------------------------------+-----------------------------------+ | | Trimming | +-----------------------------------+-----------------------------------+ | | Calculation of the transfer | | | function | +-----------------------------------+-----------------------------------+ | Terms of sensor specification | | +-----------------------------------+-----------------------------------+ | | Sensitivity | +-----------------------------------+-----------------------------------+ | | Hysteresis | +-----------------------------------+-----------------------------------+ | | Saturation | +-----------------------------------+-----------------------------------+ | | Resolution | +-----------------------------------+-----------------------------------+ | Lecture 3 -- Resistive sensors | | | ------------------------------ | | +-----------------------------------+-----------------------------------+ | What is a resistive sensor | | +-----------------------------------+-----------------------------------+ | What parameters define the | [I, A, T ]{.smallcaps} | | resistance of a cable | | +-----------------------------------+-----------------------------------+ | Piezoelectric effect | | +-----------------------------------+-----------------------------------+ | Strain Sensor | How does it work? | +-----------------------------------+-----------------------------------+ | Force sensor | How does it work? | +-----------------------------------+-----------------------------------+ | | FSR | +-----------------------------------+-----------------------------------+ | | FSC | +-----------------------------------+-----------------------------------+ | Temperature sensor | How does it work? | +-----------------------------------+-----------------------------------+ | | Thermistor(Resistive type) | +-----------------------------------+-----------------------------------+ | | Pyroelectric | +-----------------------------------+-----------------------------------+ | | Thermocouples | +-----------------------------------+-----------------------------------+ | How to measure change in | Wheatstone bridge | | resistance | | | | - How does it look like? | | | | | | - What are the advantages in | | | comparison with a voltage | | | divider? | +-----------------------------------+-----------------------------------+ | How to amplify small voltages | Intrusmental amplifier | | | | | | - Properties: High input | | | resistanc, high CMRR | +-----------------------------------+-----------------------------------+ | | | +-----------------------------------+-----------------------------------+ | Lecture 4 -- Capacitive and induc | | | tive sensors | | | --------------------------------- | | | ------------ | | +-----------------------------------+-----------------------------------+ | What is capacitance | How does it work? | +-----------------------------------+-----------------------------------+ | | What parameters change the | | | capacitance of a plate capacitor? | +-----------------------------------+-----------------------------------+ | Humidity sensor | | +-----------------------------------+-----------------------------------+ | Condenser microphone | | +-----------------------------------+-----------------------------------+ | Touch screen | | +-----------------------------------+-----------------------------------+ | Lecture 5 -- Microphone | | | ----------------------- | | +-----------------------------------+-----------------------------------+ | Different types of microphones | Condenser | | | | | | - Principle | | | | | | - Advantages and disadvantages | +-----------------------------------+-----------------------------------+ | | Dynamic | | | | | | - Principle | | | | | | - Advantages and disadvantages | +-----------------------------------+-----------------------------------+ | | Ribbon | | | | | | - Principle | | | | | | - Advantages and disadvantages | +-----------------------------------+-----------------------------------+ | | Carbon | | | | | | - Principle | | | | | | - Advantages and disadvantages | +-----------------------------------+-----------------------------------+ | Frequency response | | +-----------------------------------+-----------------------------------+ | Directionality | | +-----------------------------------+-----------------------------------+ | Principle of MEMS | | +-----------------------------------+-----------------------------------+ | Used for accelerometer | | +-----------------------------------+-----------------------------------+ [Signal analysing] ============================== +-----------------------------------+-----------------------------------+ | Lecture 1 -- Signals and statisti | | | cs | | | --------------------------------- | | | -- | | +===================================+===================================+ | Signal | A description of how one | | | parameter depends on another. | +-----------------------------------+-----------------------------------+ | Continuous signal | A signal that can change | | | infinitely, often representation | | | analog | +-----------------------------------+-----------------------------------+ | Discrete signal | A signal form from parameters | | | that are quantized (from analog | | | to digital converter) are said to | | | de discrete or digitized signal. | +-----------------------------------+-----------------------------------+ | Time domain | A signal that used time as the | | | independent variable (x-axis) is | | | said to be in the time domain. | | | | | | If the x-axis is labelled with | | | something like sample number, | | | then they are in the time domain, | | | as sampling at equal intervals of | | | time is the most common way of | | | obtaining signals. | +-----------------------------------+-----------------------------------+ | Frequency domain | A signal that uses frequency as | | | the independent variables is said | | | to in the frequency domain. | +-----------------------------------+-----------------------------------+ | Analog to digital conversion | How a continues signal (analog) | | | into a discrete signal (digital) | | | | | | - The higher the sample rate | | | the more information you | | | received | | | | | | - The higher the resolution the | | | more changes you can see | +-----------------------------------+-----------------------------------+ | | Happens in two steps | | | | | | 1. Sampling | | | | | | a. Conversion of the | | | independent variables | | | from continues to | | | discrete | | | | | | 2. Quantization | | | | | | b. Conversion of the | | | depended variables from | | | continuous to discrete | +-----------------------------------+-----------------------------------+ | Sampling | Sampling is the process of taking | | | measurement of a continuous | | | signal at regular time intervals | | | to create a discrete version of | | | the signal | | | | | | - Sampling converts an analog | | | signal into a series of | | | discrete values | | | | | | - Each sample represents the | | | signal amplitude at a | | | specific point in time. | | | | | | - The quality of the digitized | | | signal depends on the | | | sampling frequency and the | | | resolution of the ADC | +-----------------------------------+-----------------------------------+ | | Sampling frequency or sampling | | | rate is the number of samples | | | taken per second when a signal is | | | being digitized. It's measured in | | | Hz. | | | | | | \ | | | [\$\$f\_{s} = \\frac{1}{T\_{s}}\\ | | | \$\$]{.math.display}\ | +-----------------------------------+-----------------------------------+ | | Nyquist theorem | | | | | | - To accurately reconstruct a | | | signal, **the sampling | | | frequency must be at least | | | twice the highest frequency | | | present in the analog | | | signal**. | | | | | | - If a signal contains | | | frequencies op to 10 kHz, | | | then the sampling frequency | | | should be at least 20 kHz. | | | | | | - If the sampling rate is too | | | low aliasing occurs | | | | | | - **Aliasing**: misinterpreting | | | frequencies due to | | | insufficient sampling | +-----------------------------------+-----------------------------------+ | Resolution | **Resolution** referees to the | | | level of detail or precision in a | | | digital representation of an | | | analog signal | | | | | | Determined by the number of bits | | | used to represent the signal | | | | | | **More bits = higher resolution = | | | more precise representation** | +-----------------------------------+-----------------------------------+ | | **Most significant bit (MSB)** is | | | the bit in a binary number that | | | represents the largest value. | | | | | | - Contributes the most weight | | | in a binary representation. | | | | | | - In a ADC system, the MSB | | | determines whether the | | | digital value is closer to | | | the maximum possible level | | | | | | - If a ADC has a output of 8 | | | bit number, then the MSB can | | | represent ½ of the full-scale | | | range. | +-----------------------------------+-----------------------------------+ | Quantization | The process of converting a | | | continuous analog signal into a | | | discrete digital signal during | | | analog-to-digital conversion. | | | | | | Process: | | | | | | 1. The continues range of signal | | | values is divided into a | | | finite number of levels | | | | | | 2. Each sample of the analog | | | signal is assigned to the | | | nearest discrete level | | | | | | a. Example: A 3 bit ADC, | | | there are 2\^3 = 8 levels | | | available. | | | | | | b. If a analog signal falls | | | between the two levels, | | | its rounded to the | | | nearest level, which can | | | give means that the | | | digital output is equal | | | to the input plus a | | | quantization error. | +-----------------------------------+-----------------------------------+ | | **Quantization error** is the | | | difference between the original | | | continuous signal and the | | | quantized digital signal. | | | | | | - The maximum error for any | | | sample happens when the | | | analog value is exactly | | | halfway between two adjacent | | | quantication levels. | | | | | | - That is +- ½ least | | | significant bit | | | | | | - The error introduced by | | | approximating continuous | | | values | +-----------------------------------+-----------------------------------+ | | **The LSB** is the smallest step | | | the ADC can represent. It's the | | | distance between two adjacent | | | quantization levels. | | | | | | If an ADC have a 10 bit | | | resolution and the input is 0 to | | | 5 volts | | | | | | - Total amount of levels = | | | amount of bits to a power of | | | 2 = [2^10^ = 1024]{.math | | |.inline} | | | | | | - LSB = | | | [\$\\frac{\\text{Range}}{\\te | | | xt{Number\\ | | | of\\ levels\\ }} = \\frac{5\\ | | | V}{1024\\ } \\approx 4.88\\ | | | m\\ V\\ \$]{.math.inline} | | | | | | - Therefor the maximum | | | quantization error is +- ½ | | | LSB or about +- 2.44 m V | +-----------------------------------+-----------------------------------+ | | **Random noise or quantization | | | error** | | | | | | - Quantization error often | | | resembles random noise, as | | | its uncorrelated with the | | | signal -- e.g. it doesn't | | | follow the pattersn of the | | | input signal | | | | | | - Error varies randomly as the | | | signal fluctutates between | | | the quantiation levels | | | | | | - The erro looks like white | | | noise (uniformly distribued | | | acrous frequencies) when | | | analysed in the frequency | | | domain | | | | | | - The randomness is more true | | | when the signal is complex | | | and the resolution of the ADC | | | is high | | | | | | **Its unavoidable artefact, | | | therefore important to be aware | | | of it.** | | | | | | **It can be minimized by having a | | | higher resolution ADC -\> more | | | bits = smaller LSB** | +-----------------------------------+-----------------------------------+ | Statistics | **Mean** is the average value of | | | a signal. | | | | | | The mean is in electronics | | | commonly called DC (Direct | | | current) value, the AC | | | (Alternating current) referees to | | | how the signal fluctuates around | | | the mean value. | +-----------------------------------+-----------------------------------+ | | **Standard deviation** is the | | | measure of how far the signal | | | fluctuates from the mean. | +-----------------------------------+-----------------------------------+ | | **Variance** represents the power | | | of the standard deviation | +-----------------------------------+-----------------------------------+ | | **RMS (Root-mean-square)** | | | measure both the AC and DC | | | standard deviation, If a signal | | | do not have a DC component, the | | | RMS value is identical to its | | | standard deviation | +-----------------------------------+-----------------------------------+ | | **Signal-to-noise (SNR)** is | | | equal to the mean divided by the | | | standard deviation. | +-----------------------------------+-----------------------------------+ | | **Histogram** displays the number | | | of samples there are in the | | | signal that have each of these | | | possible values. Th sum of all | | | the values in the histogram must | | | be equal to the number of points | | | in the signal. | | | | | | The ***histogram*** is what is | | | formed from an acquired signal. | | | The curve for the process is | | | called the probability mass | | | function (pmf) | | | | | | The **pmf** describes the | | | *probability* that a certain | | | value will be generated. | +-----------------------------------+-----------------------------------+ | | Normal distribution the shape of | | | the usually bell shape | | | probability density function | +-----------------------------------+-----------------------------------+ | | Power spectrum | +-----------------------------------+-----------------------------------+ | | Density | +-----------------------------------+-----------------------------------+ | Precision vs Accuracy | Used to describe system and | | | methods that measure, estimate | | | and predict. | | | | | | Want to know the true value or | | | truth of the measured value. | | | Precision and accuracy are ways | | | of describing the error that can | | | happen. | +-----------------------------------+-----------------------------------+ | | **Precision** is a measure of | | | random noise. | | | | | | How much is the value is | | | fluctuating around. | | | | | | **Can improved by doing many | | | measurements**. | | | | | | To which extent is the individual | | | measurements do not agree with | | | each other. | +-----------------------------------+-----------------------------------+ | | **Accuracy** is a measure of | | | calibration. | | | | | | How close a measure is to the | | | true values. | | | | | | **Can be improved by | | | calibration.** | +-----------------------------------+-----------------------------------+ | Lecture 2 -- Number representatio | | | n | | | --------------------------------- | | | - | | +-----------------------------------+-----------------------------------+ | Integer (Fixed point) | **Unsigned** = Positive only (0 | | | to 255) | | | | | | **Signed** = Including negatives | | | ( -127 to 128) | | | | | | Representation: | | | | | | - **Offset binary**: Shifted | | | range for negatives | | | | | | - **Sign and magnitude**: | | | leftmost bit indicates sign | | | | | | - **Two's complement:** Most | | | commonly used, efficient for | | | hardware operations | +-----------------------------------+-----------------------------------+ | Real numbers (Floating point) | - Similar to scientific | | | notation but used base 2 | | | | | | - Example: | | | [*v* = (−1)^*S*^   *M*   2^(* | | | E*−127)^]{.math | | |.inline} | | | | | | - IEEE standards | | | | | | - **Single** precision (32 | | | bit) | | | [ ∼ 10^ − 38^ *to*  ∼ 10^ | | | 38^]{.math | | |.inline} | | | | | | - **Double** precision (64 | | | bit) | | | [ ∼ 10^ − 308^ *to*  ∼ 10 | | | ^308^]{.math | | |.inline} | | | | | | - MATLAB uses double precision | | | as default. | +-----------------------------------+-----------------------------------+ | Number precision | Integer = Fixed spacing between | | | numbers | +-----------------------------------+-----------------------------------+ | | Floats = Varies with magnitude | | | and lager gaps for larger numbers | | | | | | Limitations of floats | | | | | | - Gaps between representable | | | numbers increase with value | | | | | | - In loops, **rounding errors | | | can accumulate**, leading to | | | skipped values. | +-----------------------------------+-----------------------------------+ | | Round-off error | +-----------------------------------+-----------------------------------+ | Lecture 3 -- Linear systems | | | --------------------------- | | +-----------------------------------+-----------------------------------+ | Definition of linear system | System = Any process that | | | produces an output signal in | | | response to an input signal | +-----------------------------------+-----------------------------------+ | | A system is linear if its | | | satisfies: | | | | | | 1. Homogeneity (Scaling) | | | | | | 2. Additivity (Superposition) | +-----------------------------------+-----------------------------------+ | | Homogeneity (Scaling) | | | | | | - If you scale the input to a | | | system, the output scales by | | | the same factor | | | | | | - E.g. if doubling the input | | | voltage to a circuit result | | | in doubling the output | | | current, the circuit is | | | linear | +-----------------------------------+-----------------------------------+ | | Additivity (superposition) | | | | | | - If you input two signals into | | | the system, the output is the | | | sum of the outputs for each | | | signal individually | | | | | | - E.g. in a linear amplifier, | | | if you input two audio | | | signals, the output will be | | | the combined amplified | | | version of both signals. | +-----------------------------------+-----------------------------------+ | | **Static linearity** is where the | | | output is proportional to the | | | input by a constant factor | +-----------------------------------+-----------------------------------+ | | [Special properties of a linear | | | system: ] | | | | | | - Commutativity linear system | | | can be combined in any order | | | | | | - Superposition complex signals | | | can be broken into simpler | | | signals for analysis and | | | synthies | +-----------------------------------+-----------------------------------+ | Linear-time-invariant system | A system is linear and time | | (LTI) | variant if it satisfices two | | | additional properties | | | | | | 1. Linearity: Homogeneity and | | | Additivity | | | | | | 2. Shift invariance (Time | | | invariance) | | | | | | a. The systems behaviour | | | does not change over time | | | | | | b. E.g. A circuit behaves | | | the same today as it does | | | tomorrow. If you apply | | | the same input signal but | | | delayed by 2 seconds, the | | | output will also be | | | delayed by 2 seconds. | +-----------------------------------+-----------------------------------+ | | Why is it important? | | | | | | - Time-invariance system is | | | predictable, making them | | | easier to analyse and model. | | | | | | - If a system is a LIT then it | | | can be analysed with Fourier | | | transformation | +-----------------------------------+-----------------------------------+ | | **Examples** | | | | | | Linear and time-invariant systems | | | | | | - A resistors, capacitor, | | | inductor in a circuirt | | | | | | - An ideal amplifier | | | | | | - Wave propagation (Sound, | | | electromagnetic waves) | | | | | | - Mathematic operations like | | | differentiation, convolution | | | or recursion | | | | | | Nonlinear systems | | | | | | - A transistor operation in | | | saturation mode | | | | | | - A system where doubles the | | | input does not double the | | | output | | | | | | - Systems with thresholds, | | | saturation, hysteresis (e.g. | | | amplifiers, digital gates) | | | | | | - Voltage-power relationships | | | (P = V\^2 R) or light | | | intensity (I = e\^-aT) | | | | | | Time-variant system | | | | | | - A system whose | | | characteristics change over | | | time | | | | | | - Like a filter whose cut-off | | | frequency varies over time | +-----------------------------------+-----------------------------------+ | Synthesis | [Process of building or | | | reconstructing a signal from its | | | individual | | | components] | | | | | | In practice, **synthesis** helps | | | recreate or generate signals for | | | analysis, simulation, or testing. | | | | | | **Key concept in signal | | | analysis**: Any periodic or | | | non-periodic signal can be | | | synthesized using a sum of basic | | | waveforms | | | | | | **Key concept in system | | | analysis**: The response of a | | | system can be synthesized by | | | summing the response for an input | | | signal. This is possible for | | | *linear system.* | +-----------------------------------+-----------------------------------+ | Decomposition | Reverse of synthesis, breaking | | | down a complex signal or system | | | response into simpler components | | | for analysis | | | | | | Allowing to isolate different | | | parts of the signal, such as | | | noise or harmonics. | | | | | | **Key concept in signal | | | analysis**: Analysing a signal to | | | determine its individual | | | components. Using Fourier | | | transform to break a time-domain | | | signal into its frequency | | | components. | | | | | | **Key concept in system | | | analysis**: Break down overall | | | system behaviour into individual | | | response such as impulse response | | | (how the system reacts to a | | | single impulse) and frequency | | | response (How the system reacts | | | to inputs of varying frequencies) | +-----------------------------------+-----------------------------------+ | Superposition | Principle that the total response | | | of a system to multiple inputs is | | | the sum of the individual | | | responses to each input, when | | | assuming the system is linear | | | | | | **Key concept to signal | | | analysis**: Allows to combine | | | theses different components of a | | | signal mathematical to | | | reconstruct the signal. Analyse | | | each component separately, and | | | then sum their effects. | | | | | | **Key concept to system | | | analysis**: Property of linear | | | system, makes it possible to | | | analyse complex system behaviour | | | by breaking it into smaller | | | problems. | +-----------------------------------+-----------------------------------+ | Application of concepts | **Signal Analysis**: | | | | | | - **Synthesis**: Reconstructing | | | signals for simulations, | | | testing, or design. | | | | | | - **Decomposition**: Isolating | | | noise, harmonics, or features | | | of interest in a signal. | | | | | | - **Superposition**: | | | Understanding how different | | | signal components interact | | | (e.g., interference in | | | communication systems). | | | | | | **System Analysis**: | | | | | | - **Synthesis**: Reconstructing | | | the overall system response | | | by summing responses to | | | smaller inputs. | | | | | | - **Decomposition**: Breaking a | | | system's behavior into | | | simpler components (e.g., | | | impulse response, frequency | | | response). | | | | | | - **Superposition**: | | | Simplifying the analysis of | | | linear systems by considering | | | the response to individual | | | inputs separately. | +-----------------------------------+-----------------------------------+ | Impulse decomposition | Any signal is presented as a sum | | | (or integral) of scaled and | | | shifted impulse function. | | | | | | - Impulse functions are | | | idealized signals with | | | infinite amplitude over | | | infinitesimally short | | | duration, but with an area of | | | 1 | | | | | | - Focuses on time-domain | | | behaviour. | | | | | | - The output is determined via | | | convolution with the impulse | | | response. | | | | | | **Break signal into individual | | | samples for analysis** | +-----------------------------------+-----------------------------------+ | Step decomposition | A signal is represented as a | | | combination of scaled and shifted | | | step functions | | | | | | - Step response of a system is | | | critical in system design an | | | analysis | | | | | | - Step decomposition is used to | | | predict how a system reacts | | | to changes that occur in step | | | (e.g. switching on/off a | | | circuit) | | | | | | - Captures how a system reacts | | | to step changes, useful in | | | control system | | | | | | **Break signal into steps or step | | | functions** | +-----------------------------------+-----------------------------------+ | Fourier decomposition | **Concept**: | | | | | | - Any signal can be decomposed | | | into a sum (or integral) of | | | sinusoidal components (sines | | | and cosine) at different | | | frequencies, amplitudes and | | | phases. | | | | | | **Key Insight**: | | | | | | - Sines and cosines (or complex | | | exponentials) are the | | | **building blocks** of | | | signals. | | | | | | - Each component corresponds to | | | a specific frequency in the | | | signal. | | | | | | It is used to analyze, filter, | | | and manipulate signals in the | | | frequency domain. | | | | | | Provides a frequency-domain view | | | of signals and systems, essential | | | for understanding spectral | | | properties. | +-----------------------------------+-----------------------------------+ | Lecture 3 -- Fourier transform | | | ------------------------------ | | +-----------------------------------+-----------------------------------+ | Fourier theorem | Representing complex signals as | | | combinations of simpler sinudiod | | | signals (sine and cosine waves). | | | | | | It gives a way to analyse signals | | | in two different domains | | | | | | 1. Time domain. How the signal | | | changes over time | | | | | | 2. Frequency domain: What | | | frequency make up the signal | | | and how strong are they | | | | | | Key concepts: | | | | | | 1. **Signals as building | | | blocks** | | | | | | a. Sine and cosine waves are | | | the Lego blocks of the | | | signal | | | | | | b. A complex signals an be | | | broken down into a sum of | | | simple sine and cosine | | | waves with different | | | frequencies, amplitudes | | | and phases | | | | | | 2. **Frequency content** | | | | | | c. Every signal has energy | | | distributed across | | | different frequencies. | | | | | | d. The Fourier theorem helps | | | figure out: | | | | | | i. Which frequencies are | | | present, and how much | | | energy/strength is | | | associated with each | | | frequency | | | | | | 3. **Time and frequency | | | domains** | | | | | | e. The time domain shows how | | | a signal evolves over | | | time | | | | | | f. The frequency domain | | | shoes which frequency are | | | present and in what | | | proportions. | | | | | | g. The Fourie transforms | | | converts a signal from | | | one domain to the other | | | | | | 4. **Decomposition and | | | reconstruction** | | | | | | h. Decompose a signal to | | | find its frequency | | | components | | | | | | i. Reconstruct a signal by | | | adding all the components | | | back together = inverse | | | Fourier transform | +-----------------------------------+-----------------------------------+ | Discrete fourier transform (DFT) | DFT is a way to analyse signals | | | in the frequency domain when the | | | signal is represented by a finite | | | number of samples (discrete time | | | signals) | | | | | | - It takes a sequence of | | | sampled points from the | | | signal in the **time domain** | | | and decomposes it into a set | | | of **sinusoids** with | | | specific frequencies, | | | amplitudes, and phases. | | | | | | - The DFT provides information | | | about **which frequencies are | | | present** in the signal and | | | their corresponding | | | **magnitudes** and | | | **phases**. | | | | | | **Key Points:** | | | | | | - **Input:** A discrete-time | | | signal (finite number of | | | samples). | | | | | | - **Output:** A set of complex | | | numbers that describe the | | | amplitude and phase of the | | | frequency components. They | | | can be expressed in either | | | rectangular or polar notation | | | | | | - It's particularly useful for | | | signals sampled by digital | | | systems, like sound | | | recordings, sensor data, etc. | +-----------------------------------+-----------------------------------+ | Notation | Polar notation | | | | | | - Magnitude and phase | | | | | | - The magnitude represents the | | | amplitude of a frequency | | | components | | | | | | - The phase angle tells us the | | | offset of the sinusoid in | | | time. | +-----------------------------------+-----------------------------------+ | | Rectangular notation | | | | | | - Cartesian coordinates | | | | | | - Complex numbers with a real | | | and an imaginary part | | | | | | - The Real part is the | | | amplitudes of the cosine | | | waves | | | | | | - The imaginary parts are the | | | amplitudes of the sine waves | +-----------------------------------+-----------------------------------+ | What do we see in a DFT plot | [Magnitude spectrum] | | | | | | - **What do you see:** A plot | | | of the magnitude versus | | | frequency | | | | | | - **What does it show**: How | | | much energy the signal has at | | | each frequency. Peaks in the | | | spectrum corresponds to the | | | dominant frequencies in the | | | signal | | | | | | [Phase spectrum] | | | | | | - **What do you see:** A plot | | | of the phase angle versus | | | frequency | | | | | | - **What does it show:** The | | | relative phase (timing) of | | | the different frequency | | | components. Phase is not | | | always easy to interpret, but | | | its important to reconstruing | | | the signal correctly | | | | | | **Frequency bins** | | | | | | - The DFT divides the frequency | | | ranges into bins. Each bin | | | corresponds to a specific | | | frequency. | | | | | | - The spacing between the bins | | | depends on the sampling | | | frequency and the number of | | | points (N) in your signal. | | | | | | - Frequency resolution = fs / N | +-----------------------------------+-----------------------------------+ | Lecture 4 -- Frequency plot | | | --------------------------- | | +-----------------------------------+-----------------------------------+ | What to expect in the frequency | How does white noise look like? | | plot | | +-----------------------------------+-----------------------------------+ | | How does power line noise look | | | like? | +-----------------------------------+-----------------------------------+ | | Anti-alias filter roll-off | +-----------------------------------+-----------------------------------+ | | Signal content | +-----------------------------------+-----------------------------------+ | Fundamental frequency | The lowest frequency in a | | | periodic signal. It's the | | | frequency that determines the | | | overall repeating pattern of the | | | signal | | | | | | Key points: | | | | | | - **Periodicity**: If a signal | | | is periodic (it repeats | | | itself over time), it has | | | fundamental frequency, | | | denotes as f\_0. It's the | | | reciprocal of the period (T) | | | | | | \ | | | [\$\$f\_{0} = \\frac{1}{T}\\ | | | \$\$]{.math.display}\ | | | | | | - **Time domain**: In the time | | | domain the fundamental | | | frequency represents the | | | basic cycle of the signal | | | | | | - **Frequency domain**: In the | | | frequency spectrum, the | | | fundament frequency is the | | | typical the first peat | | | (excluding the DC) | +-----------------------------------+-----------------------------------+ | Higher harmonics | Harmonics are integer multiples | | | of the fundament frequency. These | | | represent additional frequencies | | | that contribute to the overall | | | shape of the signal | | | | | | Key points: | | | | | | - **Waveform shape**: The | | | combination of the | | | fundamental frequency and its | | | harmonics creates the signal | | | over shape | | | | | | - A pure sine wave only | | | contains fundamental | | | frequencies | | | | | | - A Square wave contains | | | both higher harmonics and | | | its fundamental | | | frequencies | +-----------------------------------+-----------------------------------+ | What defines the frequency | The frequency resolution is the | | resolution? | ability of the Fourier transform | | | to distinguish between closely | | | spaces frequency components in a | | | signal. | | | | | | Key factors: | | | | | | - **Signal duration** | | | | | | - The frequency resolution | | | improves as the duration | | | of the signal increases. | | | | | | - Resolution is defined as | | | [\$\\mathrm{\\Delta}f = | | | \\frac{1}{T}\$]{.math | | |.inline}. Where T is the | | | total time window of the | | | signal. | | | | | | - A longer signal provides | | | more detailed frequency | | | information, allowing | | | better separation of | | | close frequencies. | | | | | | - **Sampling frequency** | | | | | | - The sampling frequency | | | determines the highest | | | frequency that can be | | | analysed (the Nyquist | | | frequencies. | | | [\$f\_{\\text{nyuist}} = | | | \\frac{f\_{s}}{2}\$]{.mat | | | h | | |.inline}) | | | | | | - While fs does not | | | directly affect the | | | resolution, it dictates | | | the range of frequencies | | | visible in the DFT plot | | | | | | - **Number of points in | | | DFT (N)** | | | | | | - N affect the spacing | | | between frequency bins. | | | The bin spacing is: | | | | | | - [\$\\mathrm{\\Delta}f = | | | \\frac{f\_{s}}{N}\$]{.mat | | | h | | |.inline} | | | | | | - Where fs is the sampling | | | frequency and N is the | | | number of points in the | | | DFT. | | | | | | - Increasing N does not | | | improve the actual | | | resolution of the data, | | | but interpolates between | | | existing bins, making the | | | spectrum smoother. | +-----------------------------------+-----------------------------------+ | What is STFT | A tool to analyse non-stationary | | | signals, where the frequency | | | content changes over time. | | | | | | It dived the signal into smaller | | | overlapping segments and computes | | | the Fourier transform for each | | | segment. | | | | | | Key concepts | | | | | | Why STFT? | | | | | | - A standard Fourier transform | | | provides information about | | | which frequencies exist in a | | | signal but mot when they | | | occur. The STFT adds a time | | | dimension by analysing | | | smaller time windows. | | | | | | How does it work? | | | | | | - A windows function (e.g. | | | Hamming) is applied to | | | isolate a small segment of | | | the signal. | | | | | | - A Fourier transform is then | | | computed to the segment. | | | | | | - The process is repeated as | | | the windows slides across the | | | signal resulting in a | | | time-frequency representation | | | | | | Trade-off | | | | | | - There is a fundamental | | | trade-off between time | | | resolution and frequency | | | resolution | | | | | | - A narrow window gives better | | | time resolution but poor | | | frequency resolution | | | | | | - A wide window gives better | | | frequency resolution but poor | | | time resolution | | | | | | Output | | | | | | - The result is a spectrogram, | | | where time is one axis and | | | frequency is on other. | | | Amplitude is represented by | | | color or intensity. | +-----------------------------------+-----------------------------------+ | What Do We See in a DFT Plot? | When you look at a **DFT plot**, | | | you typically see: | | | | | | - **X-Axis (Frequency):** The | | | frequencies of the components | | | in the signal, ranging from 0 | | | to fs/2 (positive | | | frequencies) and sometimes | | | from −fs/2 to fs/2 if | | | symmetric frequencies are | | | plotted. | | | | | | - **Y-Axis (Amplitude or | | | Power):** The strength | | | (amplitude or power) of each | | | frequency component. | | | | | | - **Peaks:** Peaks in the plot | | | indicate dominant frequencies | | | in the signal. | +-----------------------------------+-----------------------------------+ | DFT of | Single cosine | | | | | | A cosine wave is: | | | [*x*(*t*) = *A*cos (2 *πf*~0~ *t* | | | )]{.math | | |.inline}, where [*f*~0~]{.math | | |.inline} is the frequency of the | | | cosine wave. | | | | | | In the frequency domain: | | | | | | - The DFT of a cosine wave | | | produces two peaks | | | | | | - One at + f\_0 (positive | | | frequency) | | | | | | - One -f\_0 (negative | | | frequency, represented | | | symmetrically) | | | | | | - The amplitude of each peak | | | corresponds to half the | | | amplitude of the cosine wave. | | | | | | Example: | | | | | | For | | | [*x*(*t*) = cos (2*π* 10 *t*)]{.m | | | ath | | |.inline} | | | | | | In the DFT, you see peaks at | | | [*f* =  ± 10 *Hz*]{.math.inline} | +-----------------------------------+-----------------------------------+ | | An impulse | | | | | | **An impulse signal** is | | | represented as: | | | | | | \ | | | [\$\$x\\left\\lbrack n | | | \\right\\rbrack = \\ \\left\\{ | | | \\begin{matrix} 1,\\ \\ n = 0 | | | \\\\ 0,\\ \\ otherwisse \\\\ | | | \\end{matrix} \\right.\\ | | | \$\$]{.math.display}\ | | | | | | In the frequency domain | | | | | | - The DFT of an impulse is | | | flat, meaning all frequency | | | components are equally | | | present. | | | | | | - The amplitude is constant | | | across all frequencies | | | | | | Why | | | | | | - An impulse contains all | | | possible frequencies with | | | equal contribution, which why | | | its spectrum is uniform | +-----------------------------------+-----------------------------------+ | | **A flat line** | | | | | | A flat/constant line is | | | represented as | | | [*x*\[*n*\] = *C*, ]{.math | | |.inline}where C is a constant | | | | | | In the Frequency domain | | | | | | - The DFT of a constant signal | | | produces a single spike at f | | | = 0 Hz (for the DC component) | | | | | | - There are no other frequency | | | components, as the signal | | | does not oscillate | | | | | | Why | | | | | | - A constant signal has no | | | variation over time, so it | | | only contains a DC component | | | (zero frequency) | +-----------------------------------+-----------------------------------+ | | | +-----------------------------------+-----------------------------------+ | Duality | ++, - - , X \* | +-----------------------------------+-----------------------------------+ | Lecture 5 -- Convolution | | | ------------------------

Use Quizgecko on...
Browser
Browser