Help with simulating basis set: adding freq. shifts and phase distorsions

Hi,

I am simulating a basis set with NMRScope-B and I need help on how to add random frequency shifts and random phase distorsion values with uniform distribution and damping variations in order to mimic in vivo MRS signal. Can someone suggest me software or script for that?

Thank you,
Milena

Hi Milena,

I’m not very familiar with NMRScope-B. I’d probably recommend exporting your simulated spectrum in jMRUI format, and then do the random frequency/phase variation outside of NMRScope-B. You can do that manually (they’re both simple time-domain multiplications), or resort to some sort of processing framework, for example using FID-A in MATLAB (feel free to browse our Software & Code section to find tools that suit your preferred programming environment).

I’m also tagging @agudmund in the hope that he has something more immediately useful to contribute than I’m doing here - I know he’s been simulating signals in NMRScope-B and then adding the phase/frequency variations in Python.

Let me know if that was (or wasn’t helpful) please.
Best,
Georg

1 Like

Hi Milena,
As Georg suggested, I would also recommend simulating your metabolites in NMR-Scope-B first and then add in your frequency, phase, and lw variations in whichever programming language you prefer.

In NMR-Scope-B, after you “Launch” your simulation you can save them as “NMR Scope-B.” This will give you a “.m” file that can be read as a text file. The first 8 or 9 lines of that file are just information about your simulation (dwell time, number of points, etc.) followed by your actual simulated data separated into 2 columns (Real and Imaginary).

From here, you can write some code that will read your data and apply random adjustments. What programming language do you usually work in? Happy to offer more specifics on the code implementation, just let me know what language you prefer.

Thanks,
Aaron Gudmundson
agudmund@uci.edu

2 Likes

Thanks for your reply. I will try the suggestions. @agudmund I’m using MATLAB for programming.

Hi,

Thanks for your suggestions about handling the data. I’ve simulated and saved the spectra in .m file format and also used FID-A for adding freq. and phase shifts, but I didn’t find a script to add random frequency shifts (from -0.09 ppm to +0.09 ppm), and random phase distorsion values with uniform distribution and damping variations (from -0.09 to +0.09 ppm). I’m new in programming (started using Matlab) so I would be grateful if you could give me some advice about this.

Thanks,
Milena

Hello,
Great, it sounds like you made a lot of progress! I would just use rand() or unifrnd() to add random shifts to your data. I’m not sure that there is a premade script to add these variations in, so you’ll likely need to write your own. Does this help or are you looking for a broader idea on how to setup and structure your code?

Thanks,
Aaron Gudmundson
agudmund@uci.edu