From 872242a213709453e101ed61b107305bbec4ad02 Mon Sep 17 00:00:00 2001 From: Justin Ackers Date: Mon, 8 Sep 2025 14:07:55 +0200 Subject: [PATCH 1/3] use FFTA --- Project.toml | 4 ++-- src/Derived.jl | 4 ++-- src/MDF.jl | 4 ++-- src/MPIFiles.jl | 2 +- src/Measurements.jl | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index 9103658d..2b33a9df 100644 --- a/Project.toml +++ b/Project.toml @@ -9,7 +9,7 @@ CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" +FFTA = "b86e33f2-c0db-4aa1-a6e0-ab43e668529e" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" Graphics = "a2bd30eb-e257-5431-a919-1863eab51364" HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" @@ -49,7 +49,7 @@ Dagger = "0.18, 0.19" Dates = "1" DelimitedFiles = "1" DocStringExtensions = "0.8, 0.9" -FFTW = "1.3" +FFTA = "0.2.5" FileIO = "1.0" Graphics = "0.4, 1.0" HDF5 = "0.14, 0.15, 0.16, 0.17" diff --git a/src/Derived.jl b/src/Derived.jl index 9bf8a950..493db645 100644 --- a/src/Derived.jl +++ b/src/Derived.jl @@ -106,9 +106,9 @@ function measDataTD(f, frames=1:acqNumFrames(f), periods=1:acqNumPeriodsPerFrame if measIsFrequencySelection(f) dataPadded = zeros(eltype(data2), (rxNumFrequencies(f), size(data2, 2), size(data2, 3), size(data2, 4))) dataPadded[measFrequencySelection(f), :, :, :] .= data2 - dataTD = irfft(dataPadded, rxNumSamplingPoints(f), 1) + dataTD = real.(irfft(dataPadded, rxNumSamplingPoints(f), 1)) else - dataTD = irfft(data2, rxNumSamplingPoints(f), 1) + dataTD = real.(irfft(data2, rxNumSamplingPoints(f), 1)) end else dataTD = data2 diff --git a/src/MDF.jl b/src/MDF.jl index 419fc8a8..9eb70321 100644 --- a/src/MDF.jl +++ b/src/MDF.jl @@ -290,7 +290,7 @@ function measData(f::MDFFileV1, frames=1:acqNumFrames(f), periods=1:acqNumPeriod end dataFD = reshape(reinterpret(Complex{eltype(data)}, vec(data)), (size(data,2),size(data,3),size(data,4))) - dataTD = irfft(dataFD, 2*(size(data,2)-1), 1) + dataTD = real.(irfft(dataFD, 2*(size(data,2)-1), 1)) return reshape(dataTD,size(dataTD,1),size(dataTD,2),1,size(dataTD,3)) end end @@ -310,7 +310,7 @@ function measDataTDPeriods(f::MDFFileV1, periods=1:acqNumPeriods(f), data = f.mmap_measData[:, :, receivers, periods] dataFD = reshape(reinterpret(Complex{eltype(data)}, vec(data)), (size(data,2),size(data,3),size(data,4))) - dataTD = irfft(dataFD, 2*(size(data,2)-1), 1) + dataTD = real.(irfft(dataFD, 2*(size(data,2)-1), 1)) return dataTD end end diff --git a/src/MPIFiles.jl b/src/MPIFiles.jl index 875b0716..77c8974c 100644 --- a/src/MPIFiles.jl +++ b/src/MPIFiles.jl @@ -5,7 +5,7 @@ using Graphics: @mustimplement using RelocatableFolders using LinearOperatorCollection -using FFTW +using FFTA using AxisArrays const axes = Base.axes using Interpolations diff --git a/src/Measurements.jl b/src/Measurements.jl index 6efcd63e..2091d57e 100644 --- a/src/Measurements.jl +++ b/src/Measurements.jl @@ -308,7 +308,7 @@ function getMeasurements(f::MPIFile, neglectBGFrames=true; dataF[:,k,:,:] ./= inductionFactor[k] end end - data = irfft(dataF,J,1) + data = real.(irfft(dataF,J,1)) end return map(Float32,data) From 06e6ab6133fa368fe3a25303bed1b2b7d0091883 Mon Sep 17 00:00:00 2001 From: Justin Ackers Date: Fri, 9 Jan 2026 12:39:14 +0100 Subject: [PATCH 2/3] FFTA now returns real values --- src/Derived.jl | 4 ++-- src/MDF.jl | 4 ++-- src/Measurements.jl | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Derived.jl b/src/Derived.jl index 493db645..9bf8a950 100644 --- a/src/Derived.jl +++ b/src/Derived.jl @@ -106,9 +106,9 @@ function measDataTD(f, frames=1:acqNumFrames(f), periods=1:acqNumPeriodsPerFrame if measIsFrequencySelection(f) dataPadded = zeros(eltype(data2), (rxNumFrequencies(f), size(data2, 2), size(data2, 3), size(data2, 4))) dataPadded[measFrequencySelection(f), :, :, :] .= data2 - dataTD = real.(irfft(dataPadded, rxNumSamplingPoints(f), 1)) + dataTD = irfft(dataPadded, rxNumSamplingPoints(f), 1) else - dataTD = real.(irfft(data2, rxNumSamplingPoints(f), 1)) + dataTD = irfft(data2, rxNumSamplingPoints(f), 1) end else dataTD = data2 diff --git a/src/MDF.jl b/src/MDF.jl index 9eb70321..419fc8a8 100644 --- a/src/MDF.jl +++ b/src/MDF.jl @@ -290,7 +290,7 @@ function measData(f::MDFFileV1, frames=1:acqNumFrames(f), periods=1:acqNumPeriod end dataFD = reshape(reinterpret(Complex{eltype(data)}, vec(data)), (size(data,2),size(data,3),size(data,4))) - dataTD = real.(irfft(dataFD, 2*(size(data,2)-1), 1)) + dataTD = irfft(dataFD, 2*(size(data,2)-1), 1) return reshape(dataTD,size(dataTD,1),size(dataTD,2),1,size(dataTD,3)) end end @@ -310,7 +310,7 @@ function measDataTDPeriods(f::MDFFileV1, periods=1:acqNumPeriods(f), data = f.mmap_measData[:, :, receivers, periods] dataFD = reshape(reinterpret(Complex{eltype(data)}, vec(data)), (size(data,2),size(data,3),size(data,4))) - dataTD = real.(irfft(dataFD, 2*(size(data,2)-1), 1)) + dataTD = irfft(dataFD, 2*(size(data,2)-1), 1) return dataTD end end diff --git a/src/Measurements.jl b/src/Measurements.jl index 2091d57e..6efcd63e 100644 --- a/src/Measurements.jl +++ b/src/Measurements.jl @@ -308,7 +308,7 @@ function getMeasurements(f::MPIFile, neglectBGFrames=true; dataF[:,k,:,:] ./= inductionFactor[k] end end - data = real.(irfft(dataF,J,1)) + data = irfft(dataF,J,1) end return map(Float32,data) From c1373c229ff6f53e3aa11b5263f6950c095a7019 Mon Sep 17 00:00:00 2001 From: Justin Ackers Date: Fri, 9 Jan 2026 12:40:11 +0100 Subject: [PATCH 3/3] increase FFTA compat --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 2b33a9df..2eb74463 100644 --- a/Project.toml +++ b/Project.toml @@ -49,7 +49,7 @@ Dagger = "0.18, 0.19" Dates = "1" DelimitedFiles = "1" DocStringExtensions = "0.8, 0.9" -FFTA = "0.2.5" +FFTA = "0.3" FileIO = "1.0" Graphics = "0.4, 1.0" HDF5 = "0.14, 0.15, 0.16, 0.17"