Skip to content

Commit

Permalink
update writing styles, fix grammar or typos, and clarify informations.
Browse files Browse the repository at this point in the history
  • Loading branch information
glennhenry committed Aug 7, 2024
1 parent faf0204 commit 4030996
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 59 deletions.
30 changes: 12 additions & 18 deletions docs/digital-signal-processing/08-wavelets/wavelets.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,29 @@ title: Wavelets
description: Wavelets
---

**Main Source :**
**Main Source:**

- [MATLAB : Understanding Wavelets, Part 1: What Are Wavelets](https://youtu.be/QX1-xGVFqmw)
- **[What Are Wavelets | Understanding Wavelets, Part 1 — MATLAB](https://youtu.be/QX1-xGVFqmw)**

Fourier transform represent signal in sinusoidal function, sometimes this is not suitable for some signal that has abrupt changes. For example, a sine wave is periodic meaning that the wave will have the same value at some intervals. If a signal changes abruptly, we will need another sine wave that represents another frequency. But adding another sine wave will also change the other side of the wave.
[Fourier transform](/digital-signal-processing/fourier-transform) represent signal in sinusoidal function. Sometimes, this is not suitable for signals that has abrupt changes. For example, sine wave is periodic, which means it will repeat at some point. If a signal changes abruptly, like sudden jumps or discontinuities, the Fourier Transform may struggle to accurately represent these features.

**Wavelets** is a short periodic function meaning that the function doesn't oscillates forever unlike sinusoidal function. Because it doesn't oscillates forever, Wavelets is localized meaning that the same function can have various shape. Wavelets can adapt their shape and size to match different regions of a signal, capturing localized information at different scales.

The purpose of Wavelets is like Fourier transforms, it is used to analyze and separate signals into different frequency components. Unlike Fourier transforms that decompose a signal into a series of sinusoidal components of different frequencies, Wavelets decompose signal into specific time or frequency region of the signal and is able to localized it.

![Example of various wavelets function](./wavelets-example.png)
Source : https://medium.com/@andrewtan_36013/electrocardiograms-qrs-detection-using-wavelet-analysis-a1070505efee

These are some example of common and general purpose wavelets function (called basis function).
**Wavelet** is a short periodic function, meaning that the function doesn't oscillate forever unlike sinusoidal function. This characteristic make wavelets _localized_, which means that the same function can have various shape to match different regions of a signal. Wavelets can adapt their shape and size, capturing localized information at different scales.

### Wavelets Operations

Using basis wavelets function, we can construct any signal shape. We can do this by doing transformation into these basis function such as scaling or shifting.
![Example of various wavelets function](./wavelets-example.png)
Source: https://medium.com/@andrewtan_36013/electrocardiograms-qrs-detection-using-wavelet-analysis-a1070505efee

#### Scaling
These are some examples of common and general purpose wavelets function (also called **mother wavelet** or **basis function**). They serve as prototype, from which other wavelets and localized shape are derived through stretching (scaling) and translation (shifting).

![A scaled by 2 and 4 of a wavelets function](./wavelets-scaling.png)
Source : https://www.mathworks.com/help/wavelet/gs/continuous-wavelet-transform-and-scale-based-analysis.html
Source: https://www.mathworks.com/help/wavelet/gs/continuous-wavelet-transform-and-scale-based-analysis.html

#### Shifting
A scaling operation of wave function $\psi (t)$ to a scale of 1/2 and 1/4.

![A shifted wavelets function by k](./wavelets-shifting.png)
Source : https://inst.eecs.berkeley.edu/~ee225b/sp14/lectures/wavelets-g&w.pdf
Source: https://inst.eecs.berkeley.edu/~ee225b/sp14/lectures/wavelets-g&w.pdf

The wavelets basis function are multiplied by the original signal to obtain wavelet coefficients, the similar concept as Tourier transform which is the contribution of each wavelets to the signal.
A shifting operation by $k$.

And using the wavelets coefficient we can do further analysis such as filtering noise, compression, etc by removing or discarding specific portion of signal based on the coefficient.
Wavelet basis functions are multiplied by the original signal to obtain wavelet coefficients. Similar to the Fourier transform, this process effectively measures the contribution of each wavelet to the signal. We can efficiently represent signals using these wavelet coefficients. These coefficients can now be used to filter noise, compression, or etc. by discarding specific frequency of the signal.
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,35 @@ title: Laplace Transform
description: Laplace Transform
---

**Main Source : Various source from Google and Youtube**
**Main Source:**

**Laplace Transform** is a mathematical operation that converts a function of a real variable (time) $f(t)$ to a function of a complex variable (frequency) $F(s)$.
- **Various source from Google and YouTube**

Laplace transform can be thought as the generalized Fourier transform. Laplace transform extends the concept of the Fourier transform by allowing the analysis of a broader class of functions, including those that are not necessarily periodic or defined over an infinite time interval.
**Laplace transform** is a mathematical operation that converts a time-domain function $f(t)$ into a complex frequency-domain representation $F(s)$.

Fourier transform is Laplace transform with the real part of the complex variable (s) set to 0. The additional complexity in the output complex variable (s) which has real that can represents exponential growth or decay behavior, and the imaginary part determines the frequency content of the transformed function.
Laplace transform can be thought as the generalized [Fourier transform](/digital-signal-processing/fourier-transform). Laplace transform extends the concept of the Fourier transform by allowing the analysis of a broader class of functions, including those functions that are not necessarily periodic or defined over an infinite time interval.

The Laplace transformed is defined as the following :
Fourier transform uses a complex exponential term to capture sinusoidal waves. This complex variable has only an imaginary part, representing the frequency component of the signal. On the other hand, the Laplace Transform involves both a real and an imaginary part in its complex variable.

![Laplace transform formula with input signal of time and output a function of complex number](./laplace-transform-formula.png)
The real part helps to represent exponential growth and exponential decay in the signal. These are characteristics of signal whose amplitude increases or decreases exponentially over time.

The Laplace transform is defined as the following:

Laplace transform has many properties, the properties are useful to simplify the function. Laplace transform are used many fields such as reducing differential equation into an algebraic equation.
![Laplace transform formula with input signal of time and output a function of complex number](./laplace-transform-formula.png)

#### How does it works
Where:

The idea of Laplace transform is same as the Fourier transform, the function of time is multiplied by complex term to capture the frequency component and we will integrate it to combine all of the signal information with respect to time.
- $s = \sigma + j \omega$
- $\sigma$: the real part of $s$
- $j \omega$: the imaginary part of $s$, where $j$ is the imaginary unit $j^2 = −1$ and $\omega$ is the angular frequency.

### Laplace Transform Visualization
The concept of Laplace transform is same as Fourier transform. The complex term is multiplied by the original signal to capture the contribution of each frequency components.

Laplace transform is typically represented in 3D graph, where x-axis represent the real part, y-axis represent the imaginary part, and the z-axis represent the magnitude or phase.
### Visualization

In Fourier transform, because the real part is set to 0, then it will be flat 2D graph instead.
Laplace transform is typically represented in 3D graph, where x-axis represents the real part, y-axis represent the imaginary part, and the z-axis represent the magnitude or phase. If Fourier transform were to be visualized, it would be a flat 2D graph instead.

![Laplace transform visualization](./laplace-transform-visualization.png)
Source : https://www.sharetechnote.com/html/EngMath_LaplaceTransform.html
Source: https://www.sharetechnote.com/html/EngMath_LaplaceTransform.html

The part of visualization where it goes to infinity generally suggests that the corresponding function exhibits exponential growth or decay.
The part where it creates a hole is when the function go into discontinuity or oscillatory behavior.
Some regions may go to infinity, indicating that the corresponding frequency exhibits exponential growth or decay without limit. The presence of holes suggests that the function has discontinuities or exhibits oscillatory behavior.
Binary file not shown.
41 changes: 15 additions & 26 deletions docs/digital-signal-processing/10-z-transform/z-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,27 @@ title: Z-Transform
description: Z-Transform
---

**Main Source : Various source from Google and Youtube**
**Main Source:**

**Z-Transform** is the discrete version of [Laplace transform](/digital-signal-processing/laplace-transform). The discrete input of signal makes Z-transform usable in the digital world.
- **Various source from Google and YouTube**

![Comparison between continous and discrete signal](./continous-discrete-signal.png)
Source : https://www.geeksforgeeks.org/what-is-z-transform/
**Z-transform** is the discrete version of [Laplace transform](/digital-signal-processing/laplace-transform), often used in the digital world.

Z-transform is defined as follows :
![Comparison between continuous and discrete signal](./continous-discrete-signal.png)
Source: https://www.geeksforgeeks.org/what-is-z-transform/

![Z-transform formula](./z-transform-formula.png)

- $x(n)$ : the n-th term of the sample
- z : complex variable
- A : magnitude of z
- j : imaginary unit
- $\phi$ : angle or phase in radian

Because Z-transform is discrete, $\sum$ is used instead of continous sum integral. Typically we don't sum all the way from negative infninity up to positive infinity, because it's not always possible to compute as the discrete signal may not be defined for all n values.

Instead, we truncate the sum. it won't affect the accuracy of the Z-transform as long as the number of terms is sufficiently large.
Z-transform is defined as follows:

### How does it works

Z-transform is just the discrete version of Laplace transform, the way of how it works is similar as the [Discrete Fourier Transform](/digital-signal-processing/discrete-fourier-transform) to [Fourier Transform](/digital-signal-processing/fourier-transform). Multiplying each discrete sample by the complex variable would capture the phase and magnitude.

Z-transform is just the discrete version of Laplace transform, the way of how it works is similar as the Discrete Fourier Transform toFourier Transform. Multiplying each discrete sample by the complex variable $z^{-n}$, we are essentially converting the sample from the time domain to the frequency domain by shifting the sample to a different frequency. It will be shifted by power of n that vary between samples.
![Z-transform formula](./z-transform-formula.png)

After getting the complex function output, it can be used for a variety of purposes, such as frequency analysis, filter design, system analysis.
- $x(n)$: the n-th term of the sample
- $z$: complex variable
- $A$: magnitude
- $j$: imaginary unit
- $\phi$: phase angle in radian.

#### Visualization
Discrete sum $\sum$ is used instead of continuous integration. The sum goes from negative infinity to positive infinity, which is not possible in the real world. Typically, only some number of sample is used, as long as the number of sample is sufficiently large, so it doesn't affect the accuracy of the Z-transform.

![Z-transform visualization](./z-transform-visualization.png)
Source : https://wirelesspi.com/a-visualization-of-causality-and-stability-in-z-transform/
### How does it work

Same as Laplace transform, x-axis represents real part, y-axis represents imaginary part, and z-axis represents magnitude.
Z-transform is just the discrete version of Laplace transform, the way of how it works is similar as the [discrete Fourier transform](/digital-signal-processing/discrete-fourier-transform) to [Fourier transform](/digital-signal-processing/fourier-transform). By multiplying each discrete sample by the complex variable $z^{-n}$, we are essentially converting the sample from the time domain to the frequency domain by shifting the sample to a different frequency. The shifts depend on the power of $n$ that vary between samples.

0 comments on commit 4030996

Please sign in to comment.