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 6, 2024
1 parent dc2a01a commit 09dd0c3
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 97 deletions.
58 changes: 29 additions & 29 deletions docs/digital-signal-processing/01-signal/signal.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,52 @@ title: Signal
description: Signal
---

**Main Source : [Wikipedia Signal](https://en.wikipedia.org/wiki/Signal)**
**Main Source:**

**Signal** refers to a function, variable or quantity that carries information. It can represent different types of data or information, such as electrical, acoustic, optical, or digital information.
- **[Signal — Wikipedia](https://en.wikipedia.org/wiki/Signal)**

Example of signal :
**Signal** refers to a function, variable, or quantity that carries information. It can represent different types of data or information, such as electrical, acoustic, optical, or digital information.

- Audio signal from sound wave
- Voltage signal from electronic
- Image signal from image pixels color
Example of signal:

### Signal Types Based On Periodicity
- Audio signal from sound wave.
- Voltage signal from electronic devices.
- Image, can also be represented in signal by their pixels color.

- **Periodic Signal** : A periodic signal repeats its pattern over time at regular intervals. This means that the signal waveform or pattern recurs identically after a specific time duration called the period.
### Types of Signals Based On Periodicity

- **Periodic signal**: A periodic signal repeats its pattern over time at regular intervals. This means that the signal waveform or pattern recurs identically after a specific time duration called the period.

![An example of periodic signal which is sine wave that has some waves properties such as amplitude and period or cycle](./periodic-signal.png)
Source : https://www.open.edu/openlearn/science-maths-technology/exploring-communications-technology/content-section-1.1
Source: https://www.open.edu/openlearn/science-maths-technology/exploring-communications-technology/content-section-1.1

Examples of periodic signals include sine waves, square waves, sawtooth waves, triangle waves, semicircle waves, and etc.
Examples of periodic signals include sine waves, square waves, sawtooth waves, triangle waves, semicircle waves, etc.

![Example of various periodic signal including sawtooth](./signal-variation.png)
Source : https://byjus.com/maths/fourier-series/
![Example of various periodic signal including sawtooth](./signal-variation.png)
Source: https://byjus.com/maths/fourier-series/

- **Non Periodic Signal** : Also known as aperiodic signals or transient signals, do not exhibit repetitive patterns over time. Examples of non-periodic signals include a single pulse, a burst of noise, or a speech signal.
- **Non-periodic signal**: Also known as aperiodic signal or transient signal, it doesn't exhibit repetitive patterns over time. Examples of non-periodic signals include a single pulse, a burst of noise, or a speech signal.

![Example of non periodic signal, sound wave](./non-periodic-signal.jpeg)
Source : https://www.k-space.org/Class_Info/EE470/SigSys_chapter1_lec.pdf
![Example of non-periodic signal, sound wave](./non-periodic-signal.jpeg)
Source: https://www.k-space.org/Class_Info/EE470/SigSys_chapter1_lec.pdf

- **Quasi-Periodic Signal** : Quasi-periodic signals exhibit a pattern that is similar to periodic signals, but not exactly identical. They have a repetitive nature, but with slight variations or irregularities.
- **Quasi-periodic signal**: Quasi-periodic signal exhibit a pattern that is similar to periodic signals, but not exactly identical. They have a repetitive nature, but with slight variations or irregularities.

![A signal that has period but not exactly identical](./quasi-periodic-signal.png)
Source : https://www.researchgate.net/figure/Predictability-Periodic-quasi-periodic-and-chaotic-regimes-Prediction-Zt-x-of_fig2_341395962

### Signal Types Based On Continuity

- **Continuous Time Signal** : Continuous-time signal are defined and exist for all values of time within a specified interval. They are represented by a continuous function of time. Examples of continuous-time signals are typically encountered in analog systems or natural phenomena including audio signals, analog electrical signals, sine waves, etc.
Source: https://www.researchgate.net/figure/Predictability-Periodic-quasi-periodic-and-chaotic-regimes-Prediction-Zt-x-of_fig2_341395962

- **Discrete-Time Signal** : Discrete-time signal are defined only at specific instances or discrete points in time. They are represented by a sequence of values called sample taken at specific time intervals or time instances. Examples of discrete-time signal are commonly encountered in digital systems such as computer systems including digital audio signals, sampled analog signals, and sequences of numbers representing measurements or data such as image colors.
### Types of Signals Based On Continuity

![Discrete signals has gap between while continous signals not](./continuity-signals.png)
Source : https://electronicsprojects.in/signals_and_systems/continuous-time-signal-and-discrete-time-signal-difference-diagram-and-information/ (with modification)
- **Continuous Time Signal**: Continuous-time signal are defined and exist for all values of time within a specified interval. They are represented by a continuous function of time. Examples of continuous-time signals are typically encountered in analog systems or natural phenomena including audio signals, analog electrical signals, sine waves, etc.
- **Discrete-Time Signal**: Discrete-time signal are defined only at specific instances or discrete points in time. They are represented by a sequence of values called _sample_, which is taken at specific time intervals or time instances. Discrete-time signal are commonly encountered in digital systems including digital audio signals, sampled analog signals, and sequences of numbers representing measurements or data such as image colors.

### Signal Types Based On Representation
![Discrete signals have gap between while continuous signals not](./continuity-signals.png)
Source: https://electronicsprojects.in/signals_and_systems/continuous-time-signal-and-discrete-time-signal-difference-diagram-and-information/ (with modification)

- **Analog Signal** : Analog signal are continuous-time signals that represent physical quantities with a continuous range of values. They can take on any value within a specified range. Analog signal typically represent varying voltage or current levels. Examples of analog signals commonly encountered in natural phenomena including audio signals, analog electrical signals, and continuous variations of physical quantities such as temperature, pressure, or light intensity.
### Types of Signals Based On Representation

- **Digital Signal** : Digital signal are discrete-time signals that represent information using a finite set of discrete values or levels. These discrete values are typically represented by binary digits, or bits, such as 0s (low voltage) and 1s (high voltage). Digital signal are commonly encountered in digital world example of it includes digital audio signals, binary data streams, and sequences of discrete values representing measurements or data.
- **Analog signals**: Analog signals are continuous-time signals that represent physical quantities with a continuous range of values. They can take on any value within a specified range. Analog signal typically represent varying voltage or current levels. Examples of analog signals commonly encountered in natural phenomena including audio signals, analog electrical signals, and continuous variations of physical quantities such as temperature, pressure, or light intensity.
- **Digital signals**: Digital signals are discrete-time signals that represent information using a finite set of discrete values or levels. These discrete values are typically represented by binary digits, or bits, such as 0s (low voltage) and 1s (high voltage). Digital signal are commonly encountered in digital world example of it includes digital audio signals, binary data streams, and sequences of discrete values representing measurements or data.

![Analog signal such as sine wave represents voltage and digital signal shows square wave varying only between 0 volt and 5 volt](./signal-representation.png)
Source : https://instrumentationtools.com/what-are-analog-and-digital-signals-differences-examples/
![Analog signal such as sine wave represents voltage and digital signal shows square wave varying only between 0 volts and 5 volts](./signal-representation.png)
Source: https://instrumentationtools.com/what-are-analog-and-digital-signals-differences-examples/
65 changes: 34 additions & 31 deletions docs/digital-signal-processing/02-fourier-series/fourier-series.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,79 +5,82 @@ title: Fourier Series
description: Fourier Series
---

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

- **[Dr. Trefor Bazett, Intro to Fourier Series](https://youtu.be/wmCIrpLBFds)**
- **Various source from Google and Youtube**
- **[Intro to FOURIER SERIES: The Big Idea — Dr. Trefor Bazett](https://youtu.be/wmCIrpLBFds)**

**Fourier Series** is a mathematical method for representing a periodic function as a sum of sine and cosine functions with different frequencies.
**Fourier series** is a mathematical method for representing (approximating) a periodic function as a sum of sine and cosine functions with different frequencies.

We can approximate various of function such as below
Common types of waves exhibit sine or cosine-like pattern. With Fourier series, we can even represent a square or triangle waves.

![Fourier series can approximate square, sawtooth, triangle, semicircle wave](./fourier-series-variation.png)
Source : https://byjus.com/maths/fourier-series/
Source: https://byjus.com/maths/fourier-series/

### Approximating Square Wave

A function is called periodic when it satisfies the following : $f(t + T) = f(t)$.
Meaning function will repeats its values at some intervals or periods.
A function is called periodic when it satisfies the following: $f(t + T) = f(t)$. This means the function will repeat its values at some intervals or periods.

![A wave that starts and ends in some x value](./periodic-function.png)
Source : https://www.analyzemath.com/function/periodic.html
Source: https://www.analyzemath.com/function/periodic.html

A square wave like below is considered as a periodic function.

A square wave like this is also a periodic function
![Square wave that repeats every pi or have period of pi](square-wave-periodic-function.png)
Source : https://youtu.be/wmCIrpLBFds?t=89
Source: https://youtu.be/wmCIrpLBFds?t=89

We can approximate a square wave with the sum of sine wave. With a single sine wave, we will get a pretty bad approximation.
We will attempt to create a function that behaves similarly like that square wave using sine waves. With a single sine wave, we will get a pretty bad approximation. We see that the output is not always -1 or 1, so our approximation is still pretty far.

![An inaccurate approximation of square wave using sine wave](./approximate-square-wave-1.png)
Source : https://youtu.be/wmCIrpLBFds?t=131
Source: https://youtu.be/wmCIrpLBFds?t=131

Here, a closer look at the approximation using $\frac{4}{\pi} \sin(x)$ function.

![A zoomed in approximation of square wave using some sin x function](./approximate-square-wave-2.png)
Source : https://youtu.be/wmCIrpLBFds?t=195
Source: https://youtu.be/wmCIrpLBFds?t=195

We can add another sine wave so that the amplitude will lower down. Adding wave will either add up or cancel each other.
To improve our approximation, we will add another sine wave. This will cause some amplitude to decrease and increase where they are required (we must add the corresponding wave). This is the constructive and destructive interference property of waves, in which two waves added together will either add up (constructive interference) or cancel each other out (destructive interference).

![A sine wave addition that lowers down the amplitude](./approximate-square-wave-3.png)
Source : https://youtu.be/wmCIrpLBFds?t=221
Source: https://youtu.be/wmCIrpLBFds?t=221

It will result in much better approximation.
The addition results in better approximation.

![Better approximation after adding another sine wave with different frequency](./approximate-square-wave-4.png)
Source : https://youtu.be/wmCIrpLBFds?t=257
Source: https://youtu.be/wmCIrpLBFds?t=257

We can keep adding sine wave until we are satisfied with the result.

![More sine wave addition making the wave fits the square wave better](./approximate-square-wave-5.png)
Source : https://youtu.be/wmCIrpLBFds?t=312
Source: https://youtu.be/wmCIrpLBFds?t=312

#### Gibbs Phenomena

We may encounter a problem in our series of sine wave. While approximating a discontinued function, the Fourier series attempts to "fill in" the gaps with the sum of the sine and cosine functions. However, the sum of the infinite number of sine and cosine functions is not able to perfectly match the discontinuous function, resulting in the overshoot or ringing effect.
Now that our function looks square-ish, we encounter a problem in our series of sine wave. While approximating a discontinued function, such as the square wave, the Fourier series attempts to "fill in" the gaps with the sum of the sine and cosine functions, so that a continuous function can look like a discontinuous function. However, the sum of the infinite number of sine and cosine functions is not able to perfectly match the discontinuous function, resulting in the overshoot or ringing effect.

![Approximation "jumps" in discontinuity](./gibbs-phenomenon.png)
Source: https://youtu.be/wmCIrpLBFds?t=384

![Approximation "jumps" in discontiunity](./gibbs-phenomenon.png)
Source : https://youtu.be/wmCIrpLBFds?t=384
This is a fundamental limitation in representing discontinuous functions using Fourier series. Some method, such as [filtering](/digital-signal-processing/filtering) can dampen the oscillations near the discontinuities.

### Fourier Series Formula

Below are the formula for Fourier series for a periodic function $f(x)$ with period of $2\pi$, note that we can also add up with cosine wave.
The formula for Fourier series for a periodic function $f(x)$ with period of $2\pi$.

![Fourier series formula involving coefficient terms](./fourier-series-formula.png)
Source : https://www.cuemath.com/fourier-series-formula/
Source: https://www.cuemath.com/fourier-series-formula/

These coefficient can be thought of as how we will represent the amplitude and phase of each frequency component in the Fourier series expansion of a periodic function.
So, with a given function $f(x)$, we can compute this formula to obtain the approximation of that function with the sum of sine and cosine function.

### Complex Fourier Series

Fourier series is represented in sine and cosine wave, we can represent this as a sum of complex exponential functions using Euler's formula.
Fourier series is represented as sum of sine and cosine wave. We may also represent this as a sum of complex exponential functions, utilizing the Euler's identity.

![Euler formula connecting exponential function with sine and cosine terms](./euler-formula.png)

The formula for complex Fourier series with period of $2\pi$:

![Euler formula connecting exponential function with sine and cosine terms](./euler-formula.png)
The formula for complex Fourier series with period of $2\pi$ :
![Formula for complex fourier series involving imaginary terms](./complex-fourier-series-formula.png)
![Formula for complex Fourier series involving imaginary terms](./complex-fourier-series-formula.png)
Where $n$ is frequency and $i$ is the imaginary terms.

![Sine wave converted to circle using euler's formula involving exponential function](./complex-representation.png)
Source : https://pidlaboratory.com/4-complex-fourier-series/ (With modification)
![Sine wave converted to circle using Euler's formula involving exponential function](./complex-representation.png)
Source: https://pidlaboratory.com/4-complex-fourier-series/ (With modification)
Loading

0 comments on commit 09dd0c3

Please sign in to comment.