Closed FrankZijlstra closed 3 months ago
Python output for seq.calculate_gradient_spectrum(max_frequency=10000, combine_mode='rss')
(parameters to be compatible with MATLAB defaults):
MATLAB output:
The different Y-scale is due to scipy's spectrogram
function using different units than the computations in the MATLAB script. For now the Y-scale is arbitrary anyway, until we can figure out reasonable limits for acoustic resonances.
This PR adds the gradient spectrum calculation as available in MATLAB Pulseq: https://github.com/pulseq/pulseq/blob/master/matlab/demoUnsorted/gradSpectrum.m
The implementation provides a fair number of parameters to control how the calculation is actually done (as we're not entirely sure what is the best way to go about this). The defaults should be sufficient to avoid peaks in the spectrum at the acoustic resonances of your scanner (and avoid damaging the gradient coils).
Basic usage (will plot the spectrums and also return them):
Or including plotting the acoustic resonance ranges from a Siemens .asc file: