Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] - Basis set resolution smaller than data resolution… #539

Merged
merged 1 commit into from
Dec 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libraries/FID-A/fitTools/fit_resampleBasis.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@
for ll=1:(basisSet.nMets + basisSet.nMM)
% Loop over the number of sub-spectra (MEGA, HERMES, HERCULES)
for rr = 1:size(basisSet.fids, 3)
specs_interp(:,ll,rr) = interp1(ppmRangeBasis(ppmIsInDataRange), basisSet.specs(ppmIsInDataRange,ll,rr), ppmRangeData, 'pchip', 'extrap');
if size(ppmRangeData,1) > size(ppmRangeBasis,2)
specs_interp(:,ll,rr) = interp1(ppmRangeBasis(ppmIsInDataRange), basisSet.specs(ppmIsInDataRange,ll,rr), ppmRangeData, 'pchip', 0);
else
specs_interp(:,ll,rr) = interp1(ppmRangeBasis(ppmIsInDataRange), basisSet.specs(ppmIsInDataRange,ll,rr), ppmRangeData, 'pchip', 'extrap');
end
%convert back to time domain
%if the length of Fids is odd, then you have to do a circshift of one to
%make sure that you don't introduce a small frequency shift into the fids
Expand Down