Simulates the coalescence of peaks in an ensemble of variable-frequency oscillators, often encountered with exchanging protons in NMR experiments (also an exercise in using JavaScript generators for signal generation/processing). The 1H signal emitted by the above system depends on which one of X or Y the H is bonded to. With slow exchange (fexchange ≪ | fX-H – fY-H |), two distinct peaks result:
Fast exchange (fexchange ≫ | fX-H – fY-H |) gives a single peak at the average of fX-H and fY-H:
Intall node.js, then
npm install -g typescript
git clone https://github.com/hessammehr/coalescence
cd coalescence
npm install
tsc -w
You will need to fire up a local dev server
# Python 3
python -m http.server
# Python 2
python -m SimpleHTTPServer
# something a bit faster?
caddy -host localhost -port 8000
Then go to http://localhost:8000
.
- Display the (phase-adjusted) real part of the FFT instead of its magnitude.
- Package
fft-asm.js
as npm package, then pull it in as a proper dependency.
- g200kg/Fft-asm.js for FFT calculation