From 887bb3606025ec008802f320e57110db731b55fd Mon Sep 17 00:00:00 2001 From: veirs Date: Wed, 10 Apr 2024 08:49:47 -0700 Subject: [PATCH] Update README.md --- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ index.html | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ea93da..8381a67 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,47 @@ This is a Javascript playground for experimenting with synthesizing call-like si The overall plan is to synthesize 'click-like' signals at a high sampling rate (1 million samples per second). Then, lowpass filter and resample to our 'normal' orcasound sampling rate range (< 48 kilo samples per second)) And, listen to the synthesized signal and observe the power spectral density and a spectrogram of the synthesized signal. + +This page is being served via Github Pages. To run locally, clone the repository and then open a terminal window in your local directory and run a local server from there. + +Under Ubuntu: python3 -m http.server --bind 127.0.0.1 9000 + +Find your program locally at: http://127.0.0.1:9000/index.html + +The program is designed as a pipeline which can be entered at a variety of points. After entry, the pipeline continues to the end. +The Javascript is mostly in the HTML file and is more-or-less in the order of the pipeline calls. + + function runPipeline(iStart){ + if (iStart === 0) { + msg.innerHTML = "Calculating clicks ..."; + buildClicks(); + plotClicks(); + msg.innerHTML = ""; + } + if (iStart <= 1){ + msg.innerHTML = "Calculating call ..."; + buildCall(); + // plotCall(); + msg.innerHTML = ""; + } + if (iStart <= 2){ + msg.innerHTML = "Resampling call ..."; + window.global_audioSamplerate = parseInt(document.getElementById('Audio samplerate').value); + resampleCall(); + msg.innerHTML = ""; + } + if (iStart <= 3){ + msg.innerHTML = "Plotting call ..."; + plotCall(); + plotResampledCall(); + msg.innerHTML = ""; + } + if (iStart <= 4){ + msg.innerHTML = "Plotting spectrogram ..."; + plotSpectrogram(); + msg.innerHTML = ""; + } + + } +Currently, the screen does NOT update via the msg.innerHTML statement. This is an Issue! +There are more, as well. Check the Github Issues. diff --git a/index.html b/index.html index b8abafa..e8cc56c 100644 --- a/index.html +++ b/index.html @@ -256,7 +256,7 @@ if (doSinAmpMod) { // apply sin envelope to the call for (n = 0; n < global_yAmpCall.length; n += 1) { if ((n > 0.1 * global_yAmpCall.length) && (n < 0.9 * global_yAmpCall.length)) { - var amp = Math.sin(Math.PI * (n - 0.1 * global_yAmpCall.length) / (2*lenCall)); + var amp = Math.sin(Math.PI * (n - 0.1 * global_yAmpCall.length) / (lenCall/2)); global_yAmpCall[n] *= amp+Math.random()/10; } else { global_yAmpCall[n] = Math.random()/10;