Skip to content

Commit 0032b0d

Browse files
committed
rebuilt website
1 parent 2ae4baa commit 0032b0d

File tree

4 files changed

+163
-263
lines changed

4 files changed

+163
-263
lines changed

docs/Lectures/Week 8/lec_16_freq_domain.Rmd

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
---
2-
title: "Time series analysis in the frequency domain"
2+
title: "Time series analysis<br>in the frequency domain"
33
subtitle: "FISH 550 – Applied Time Series Analysis"
44
author: "Mark Scheuerell"
5-
date: "23 May 2023"
5+
date: "22 May 2025"
66
output:
77
ioslides_presentation:
88
css: lecture_slides.css
9+
widescreen: true
10+
mathjax: "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js"
911
---
1012

1113

1214
```{r setup, include=FALSE}
13-
knitr::opts_chunk$set(echo = FALSE)
15+
knitr::opts_chunk$set(echo = FALSE, fig.align = "center")
1416
library(MARSS)
1517
set.seed(123)
1618
```
@@ -45,9 +47,23 @@ We can think of this as comparing changes in amplitude (displacement) with time
4547

4648
## Frequency domain
4749

48-
Today we'll consider how amplitude changes with frequency
50+
Analyzing time series in the frequency domain involves examining the signal's frequency components, rather than its time-based behavior
4951

5052

53+
## Some advantages | Simplified mathematics
54+
55+
For systems governed by _linear differential equations_ (many real-world examples)
56+
57+
converting from the time domain to the frequency domain converts the system to _algebraic equations_
58+
59+
60+
## Some advantages | More intuitive
61+
62+
Terms like bandwidth, gain, phase shift are common
63+
64+
For example, musical notes are just component frequencies
65+
66+
5167
## Jean-Baptiste Fourier (1768 - 1830)
5268

5369
French mathematician & physicist best known for his studies of heat transfer
@@ -127,8 +143,21 @@ par(mai = c(0.9,0.9,0.3,0.1), omi = c(0,0,0,0))
127143
plot.ts(xt, type = "n", las = 1,
128144
ylab = expression(italic(x[t])))
129145
matlines(t(fs), lty = "solid",
130-
col = viridis::plasma(nn, 0.7, 0.1, 0.5))
131-
lines(xt, lwd = 2)
146+
col = viridis::plasma(nn, 0.7, 0.1, 0.7), lwd = 2)
147+
# lines(xt, lwd = 2)
148+
```
149+
150+
151+
## Fourier series
152+
153+
```{r fourier_ex_2}
154+
par(mai = c(0.9,0.9,0.3,0.1), omi = c(0,0,0,0))
155+
156+
plot.ts(xt, type = "n", las = 1,
157+
ylab = expression(italic(x[t])))
158+
matlines(t(fs), lty = "solid",
159+
col = viridis::plasma(nn, 0.7, 0.1, 0.7), lwd = 2)
160+
lines(xt, lwd = 3)
132161
```
133162

134163

@@ -137,7 +166,7 @@ lines(xt, lwd = 2)
137166
```{r}
138167
par(mai = c(0.9,0.9,0.3,0.1), omi = c(0,0,0,0))
139168
140-
plot(seq(nn), apply(fs, 1, max), type = "h", las = 1,
169+
plot(seq(nn), apply(fs, 1, max), type = "h", las = 1, lwd = 3,
141170
ylab = "Amplitude", xlab = "Frequency")
142171
```
143172

@@ -514,9 +543,11 @@ where the $c_k$ are filter coefficients*
514543
Simple, but commonly used, where $\small K = 1; ~ c_0 = 1; ~ c_1 = 1$
515544

516545
$$
546+
\begin{gather}
517547
\psi(t) = \sum_{k=0}^K c_k \psi(2t - k) \\
518548
\big \Downarrow \\
519549
\psi(t) = \psi(2t) + \psi(2t - 1)
550+
\end{gather}
520551
$$
521552

522553
The only function that satisfies this is:
@@ -632,7 +663,7 @@ $$
632663
\psi_{j,k}(t) = 2^{j/2} \psi(2^j t - k)
633664
$$
634665

635-
The basic Haar wavelet has $j = 0$
666+
The mother Haar wavelet has $j = 0$
636667

637668
Setting $j = 1$ yields a daughter
638669

@@ -670,13 +701,13 @@ plot(ti, haar4(ti), type = "l", lwd = 2,
670701

671702
## Other wavelets
672703

673-
There are many forms of wavelets, many of which were developed in the past 50 years
704+
There are many forms of wavelets, many of which were developed<br>in the past 50 years
674705

675706

676-
## Morlet {data-background=morlet.png data-background-size=cover}
707+
## Morlet {data-background=morlet.png data-background-size=75% data-background-position='50% 65%'}
677708

678709

679-
## Mexican Hat {data-background=hat.png data-background-size=cover}
710+
## Mexican Hat {data-background=hat.png data-background-size=75% data-background-position='50% 65%'}
680711

681712

682713
## Who does this?
@@ -689,7 +720,7 @@ Wavelet analysis is used widely in audio & video compression
689720

690721
## Estimating wavelet transforms in R
691722

692-
We'll use the __WaveletComp__ package, which uses the Morlet wavelet
723+
We'll use the __{WaveletComp__} package, which uses the Morlet wavelet
693724

694725
We'll also use the L Washington temperature data from the __MARSS__ package
695726

@@ -706,11 +737,11 @@ dat <- data.frame(tmp = tmp)
706737

707738
Use `analyze.wavelet()` to estimate the wavelet transform
708739

709-
```{r, echo = TRUE, progress = FALSE}
710-
w_est <- analyze.wavelet(dat, "tmp", ## need both df & colname
711-
loess.span = 0, ## no de-trending
712-
dt = 1/12, ## monthly sampling
713-
lowerPeriod = 1/6, ## default = 2*dt
740+
```{r, echo = TRUE, progress = FALSE, message = FALSE}
741+
w_est <- analyze.wavelet(dat, "tmp", ## need both df & colname
742+
loess.span = 0, ## no de-trending
743+
dt = 1/12, ## monthly sampling
744+
lowerPeriod = 1/6, ## default = 2*dt
714745
n.sim = 100,
715746
verbose = FALSE)
716747
```

docs/Lectures/Week 8/lec_16_freq_domain.html

Lines changed: 109 additions & 243 deletions
Large diffs are not rendered by default.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ <h2>
349349
</center>
350350
<p><br></p>
351351
<center>
352-
<em>This site was last updated at 09:49 on 19 May 2025</em>
352+
<em>This site was last updated at 16:37 on 21 May 2025</em>
353353
</center>
354354

355355

docs/lectures.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,10 +796,13 @@ <h4>Navigating through a slide deck</h4>
796796
<br>Wavelet analysis <br>
797797
</td>
798798
<td style="text-align:center;">
799-
<br><br>
799+
<a href="Lectures/Week%208/lec_16_freq_domain.pdf">pdf 1</a><br><a
800+
href="Lectures/Week%208/lec_16_freq_domain.html">html 1</a><br><a
801+
href="Lectures/Week%208/lec_16_freq_domain.Rmd">Rmd 1</a>
800802
</td>
801803
<td style="text-align:center;">
802-
<br>
804+
<a href="https://youtu.be/XCnHQve-Tmk"
805+
class="uri">https://youtu.be/XCnHQve-Tmk</a> <br>
803806
</td>
804807
<td style="text-align:center;">
805808
<br>

0 commit comments

Comments
 (0)