GIRFModel
A GIRF model stores the frequency response from the three device-coordinate gradient channels to the calibrated output channels. It represents a linear, time-invariant prediction model; it is not a measured waveform. See field preprocessing for the physical assumptions and reference.
Matched-grid identity example
This self-contained CPU example uses a diagonal identity response. Its eight frequency samples already match the FFT length, so it does not exercise the current response-expansion limitation.
using HighOrderMRI
T = Float64
n = 8
dt = T(1e-5)
freqs = T.(-4:3) ./ (n * dt)
Hw = zeros(Complex{T}, n, 3, 3)
for axis in 1:3
Hw[:, axis, axis] .= 1
end
model = GIRFModel(Hw, freqs)
nominal = reshape(T.(1:3n), 3, n)
predicted = apply_girf(nominal, model)
@assert predicted ≈ nominalSupply the actual calibrated response and its channel units for acquisition data. The constructor stores CPU arrays but does not guarantee independent copies; use copy before construction if later mutation must be isolated.
Sampling metadata does not resample the response
apply_girf(nominal, model) forwards model.Hw. The stored frequency vector does not adapt the response to a different waveform dwell time. Check both sampling and the FFT boundary limitations.
API
Model storage
GIRFModel{T <: AbstractFloat}Container for a centred frequency-domain gradient impulse response model. Hw::Array{Complex{T},3} has intended shape (nFreq,3,nOut) and freqs::Vector{T} records the corresponding frequencies in Hz. The three input channels are device-coordinate gradient axes; the output channels and their units must match the measured model calibration.
These fields are CPU arrays, not a promise of independent copies: compatible input arrays may remain aliased. Shape, frequency-grid consistency and Hermitian symmetry are not fully validated by construction. apply_girf uses Hw and does not resample it using freqs. A model alone therefore does not establish compatible waveform sampling or a finite-record boundary condition. See GIRF prediction.
Constructor
GIRFModel(Hw::AbstractArray{Complex{T}, 3}, freqs::AbstractVector{T}) where T <: AbstractFloatConstruct the model from complex transfer samples and a frequency vector with the same real precision T. The outer method converts Hw with Array and uses vec(freqs); an already compatible array can remain shared. The frequency-vector length and monotonicity are caller responsibilities. This constructor does not estimate a GIRF or resample its frequency grid.