Skip to content

Commit 7004b19

Browse files
committed
transforms wip
1 parent 44673d7 commit 7004b19

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

src/dsp/transforms_comprehensive.clj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
;;
9494
;; Let's begin by learning to generate the signals we'll be transforming!
9595

96-
;; # Part 1: Signal Generation and Visualization
96+
;; # Signal Generation and Visualization
9797

9898
;; Before we can analyze frequencies, we need signals to analyze. This section introduces
9999
;; signal generation and visualization—the foundation for everything that follows.
@@ -276,7 +276,7 @@
276276
;; Next, we'll explore the FFT—but first, we need to understand why its output is complex-valued
277277
;; even though our input signals are real numbers.
278278

279-
;; ## Part 1.5: Understanding Complex Transform Outputs
279+
;; ## Understanding Complex Transform Outputs
280280

281281
;; Before we dive into the FFT, we need to address a puzzling fact: when we transform a
282282
;; real-valued signal (just regular numbers like 1.5, -0.3, 2.7), the FFT returns
@@ -462,7 +462,7 @@
462462
;;
463463
;; Now that we understand the complex output format, let's put the FFT to work!
464464

465-
;; ## Part 2: DFT and FFT - Discovering Frequencies in Signals
465+
;; ## DFT and FFT - Discovering Frequencies in Signals
466466

467467
;; We're finally ready to answer our opening question: how do we write code to discover the
468468
;; frequencies in a signal? The answer is the **[Discrete Fourier Transform](https://en.wikipedia.org/wiki/Discrete_Fourier_transform) (DFT)**, computed
@@ -790,7 +790,7 @@
790790
;; But the FFT has a weakness: it's not optimal for compression. Let's explore why the Discrete
791791
;; Cosine Transform (DCT) outperforms FFT for smooth signals.
792792

793-
;; ## Part 3: DCT - The Compression Transform
793+
;; ## DCT - The Compression Transform
794794

795795
;; The FFT is excellent for finding frequencies, but it's not the best choice for compression.
796796
;; Here's why: the FFT uses both sines AND cosines (complex output), which means we're storing
@@ -964,7 +964,7 @@
964964
;; whole signal—it can't tell us that a frequency appears only briefly. Let's explore wavelets,
965965
;; which solve this problem.
966966

967-
;; ## Part 4: Wavelets - Time-Frequency Localization
967+
;; ## Wavelets - Time-Frequency Localization
968968

969969
;; Remember our chirp signal—frequency increasing from 5 to 50 Hz over time? The FFT told us
970970
;; "this signal contains frequencies between 5 and 50 Hz," but it couldn't tell us WHEN each
@@ -1181,7 +1181,7 @@
11811181
(kind/table
11821182
(map #(update % :wavelet name) wavelet-tests))
11831183

1184-
;; ## Part 5: Other Transforms - DST and DHT
1184+
;; ## Other Transforms - DST and DHT
11851185

11861186
;; ### Discrete Sine Transform (DST)
11871187

@@ -1236,7 +1236,7 @@
12361236
{:transform "DHT" :use-case "Real-valued convolution" :basis "Hartley" :output "Real" :algorithm "Fast DHT"}
12371237
{:transform "Wavelet" :use-case "Time-frequency, denoising" :basis "Localized" :output "Real" :algorithm "Fast Wavelet"}])
12381238

1239-
;; ## Part 6: 2D Transforms for Images
1239+
;; ## 2D Transforms for Images
12401240

12411241
;; ### Creating a 2D Signal
12421242

@@ -1351,7 +1351,7 @@
13511351
;; - Baseline JPEG keeps low-frequency basis (top-left) and discards high-frequency (bottom-right)
13521352
;; - This is why JPEG compression works well for natural images (most energy in low frequencies)
13531353

1354-
;; ## Part 7: Practical Applications
1354+
;; ## Practical Applications
13551355

13561356
;; Now that we understand the theory behind FFT, DCT, and wavelets, let's see how to apply
13571357
;; these transforms to solve real-world problems. We'll build practical tools for filtering,
@@ -1454,7 +1454,7 @@
14541454
:magnitude-rmse (format "%.4f" (Math/sqrt (dfn/mean (dfn/sq (dfn/- original compressed-magnitude)))))
14551455
:note "Keeping largest coefficients works better than keeping first N!"}
14561456

1457-
;; ## Part 8: Testing and Validation Framework
1457+
;; ## Testing and Validation Framework
14581458

14591459
;; Transform operations can seem like black boxes. How do we know they're working correctly?
14601460
;; This section builds a comprehensive testing framework to validate transform properties:
@@ -1566,7 +1566,7 @@
15661566

15671567
(:all-passed? final-test-results)
15681568

1569-
;; ## Part 9: Best Practices and Decision Guide
1569+
;; ## Best Practices and Decision Guide
15701570

15711571
;; ### dtype-next Best Practices Summary
15721572

0 commit comments

Comments
 (0)