Skip to content

Commit ec47e3a

Browse files
committed
Norway meetup wip
1 parent 9bc4ad6 commit ec47e3a

1 file changed

Lines changed: 29 additions & 11 deletions

File tree

src/clojure_norway/meetup_2025_12/violin.clj

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
[tech.v3.datatype :as dtype]
1212
[clojure.math :as math]))
1313

14+
;; ## Exploring a violin Tremolo
15+
16+
;; ## Relevant community projects
17+
18+
;; ![](https://scicloj.github.io/sci-cloj-logo-transparent.png){width=100}
19+
20+
;; [DSP Study group](https://scicloj.github.io/docs/community/groups/dsp-study/)
21+
22+
;; [Clojure Jam 2026](https://scicloj.github.io/clojure-jam-2026/)
23+
1424
;; ## Data source
1525
;;
1626
;; [violin tremolo G#2.aif](https://freesound.org/people/ldk1609/sounds/56085/)
@@ -28,17 +38,14 @@
2838
(require '[babashka.fs :as fs])
2939

3040
(def violin-file-path
31-
(fs/file (fs/parent *file*)
41+
(fs/file "src/clojure_norway/meetup_2025_12/"
3242
violin-file-name))
3343

3444
;; ## Listening to the file
3545

3646
(kind/audio
3747
{:src violin-file-name})
3848

39-
(kind/audio
40-
{:src (str "clojure_norway/meetup_2025_12/" violin-file-name)})
41-
4249
;; ## Reading the Wav file as data
4350

4451
;; [Reading WAV files](https://clojurecivitas.github.io/dsp/wav_files.html).
@@ -136,7 +143,7 @@ wav-ds
136143
(apply concat))
137144
:sample-rate sample-rate}
138145

139-
;; ## Computing the Discrete Fouried Transform the data
146+
;; ## Computing the Discrete Fouriee Transform the data
140147

141148
(import 'com.github.psambit9791.jdsp.transform.DiscreteFourier)
142149

@@ -194,6 +201,23 @@ wav-ds
194201
(tc/head 20))
195202

196203

204+
;; ## Variation in time
205+
206+
;; > After a few minutes in a restaurant we cease to notice the annoying
207+
;; > hubbub of surrounding conversations but a sudden silence reminds
208+
;; > us of the presence of neighbors Our attention is clearly attracted by
209+
;; > transients and movements as opposed to stationary stimuli which we
210+
;; > soon ignore Concentrating on transients is probably a strategy for
211+
;; > selecting important information from the overwhelming amount of data
212+
;; > recorded by our senses Yet classical signal processing has devoted
213+
;; > most of its e orts to the design of time invariant and space invariant
214+
;; > operators that modify stationary signal properties This has led to the
215+
;; > indisputable hegemony of the Fourier transform but leaves aside many
216+
;; > information processing applications
217+
218+
;; St´ephane Mallat, [A Wavelet Tour of Signal Processing](https://coehuman.uodiyala.edu.iq/uploads/Coehuman%20library%20pdf/%D9%83%D8%AA%D8%A8%20%D8%A7%D9%84%D8%B1%D9%8A%D8%A7%D8%B6%D9%8A%D8%A7%D8%AA%20Mathematics%20books/Wavelets/Mallat_Wavelet-Tour-of-Signal-Processing.pdf)
219+
220+
;; ## DFT of a piece of data
197221

198222
(def some-dft-ds
199223
(values->dft-ds
@@ -249,11 +273,6 @@ wav-ds
249273
(into {:time time})
250274
tc/dataset)))
251275

252-
(-> some-dft-ds
253-
(dft-ds->peaks-ds {:n-peaks 10})
254-
(peaks-ds->components-ds {:duration 1})
255-
(tc/head 500))
256-
257276
(-> some-dft-ds
258277
(dft-ds->peaks-ds {:n-peaks 10})
259278
(peaks-ds->components-ds {:duration 1})
@@ -423,4 +442,3 @@ wav-ds
423442
(apply tc/concat))
424443
:combined
425444
audio)
426-

0 commit comments

Comments
 (0)