Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
veirs committed Apr 10, 2024
1 parent 366bf8c commit 887bb36
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 887bb36

Please sign in to comment.