-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from filip-szczepankiewicz/fsz_dev_crosscomp
New feature: cross-term compensation
- Loading branch information
Showing
8 changed files
with
177 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function [n, nt, H] = now_cross_term_sensitivity(result) | ||
% function [n, nt, H] = now_cross_term_sensitivity(result) | ||
|
||
gwf = result.g; | ||
rf = result.rf; | ||
dt = result.dt; | ||
|
||
qt = now_gwf_to_q(gwf, dt); | ||
|
||
H = now_gamma * cumsum(rf)*dt; | ||
nt = cumsum(qt.*H)*dt; | ||
n = nt(end,:); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function gamma = now_gamma(nuc) | ||
% function gamma = now_gamma(nuc) | ||
% | ||
% Returns the gyromagnetic constant for given nucleus in units of 1/s/T. | ||
|
||
if nargin < 1 | ||
nuc = 'H'; | ||
end | ||
|
||
|
||
switch nuc | ||
case 'H' | ||
gamma = 42.6e6; | ||
|
||
otherwise | ||
error('Nucleus not recognized') | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
function q = now_gwf_to_q(gwf, dt) | ||
% function q = now_gwf_to_q(gwf, dt) | ||
% | ||
% Assume gwf is given as the effective waveform. | ||
|
||
q = 2 * pi * now_gamma * cumsum(gwf, 1) * dt; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters