-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into JS/apapt-tf-loading
- Loading branch information
Showing
20 changed files
with
327 additions
and
119 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 |
---|---|---|
@@ -1,64 +1,66 @@ | ||
name = "MPIFiles" | ||
uuid = "371237a9-e6c1-5201-9adb-3d8cfa78fa9f" | ||
authors = ["Tobias Knopp <[email protected]>"] | ||
version = "0.13.0" | ||
version = "0.14.1" | ||
|
||
[deps] | ||
AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9" | ||
CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" | ||
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" | ||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" | ||
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" | ||
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" | ||
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" | ||
Graphics = "a2bd30eb-e257-5431-a919-1863eab51364" | ||
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" | ||
ImageMetadata = "bc367c6b-8a6b-528e-b4bd-a4b897500b49" | ||
ImageAxes = "2803e5a7-5153-5ecf-9a86-9b4c37f5f5ac" | ||
ImageMetadata = "bc367c6b-8a6b-528e-b4bd-a4b897500b49" | ||
Inflate = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" | ||
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" | ||
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
LinearOperatorCollection = "a4a2c56f-fead-462a-a3ab-85921a5f2575" | ||
Mmap = "a63ad114-7e13-5084-954f-fe012c677804" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" | ||
LinearOperatorCollection = "a4a2c56f-fead-462a-a3ab-85921a5f2575" | ||
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | ||
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" | ||
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" | ||
UnitfulAngles = "6fb2a4bd-7999-5318-a3b2-8ad61056cd98" | ||
UnitfulParsableString = "06c00241-927a-4d5b-bb5e-6b5a2ada3567" | ||
|
||
[compat] | ||
Aqua = "0.6" | ||
AxisArrays = "0.3, 0.4" | ||
CodecZlib = "0.7" | ||
FileIO = "1.0" | ||
DelimitedFiles = "1" | ||
DocStringExtensions = "0.8, 0.9" | ||
FFTW = "1.3" | ||
FileIO = "1.0" | ||
Graphics = "0.4, 1.0" | ||
HDF5 = "0.14, 0.15, 0.16" | ||
ImageMetadata = "0.9" | ||
ImageAxes = "0.6" | ||
ImageMetadata = "0.9" | ||
Inflate = "0.1.2" | ||
Interpolations = "0.12, 0.13, 0.14" | ||
Reexport = "1.0" | ||
LinearOperatorCollection = "1.1" | ||
StableRNGs = "1.0.0" | ||
Unitful = "0.17, 1.2" | ||
Unitful = "1.13, 1.14, 1.15, 1.16, 1.17" | ||
UnitfulAngles = "0.6.1" | ||
DocStringExtensions = "0.8, 0.9" | ||
UnitfulParsableString = "0.1.6" | ||
julia = "1.5" | ||
|
||
[extras] | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" | ||
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3" | ||
Scratch = "6c6a2e73-6563-6170-7368-637461726353" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test", "HTTP", "LazyArtifacts", "Scratch"] | ||
test = ["Aqua", "Test", "HTTP", "LazyArtifacts", "Scratch"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
|
||
[compat] | ||
Documenter = "1" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Transfer functions | ||
|
||
MPIFiles defines the type `TransferFunction` which represents the system-properties of a linear time-invariant system in frequency space ([see also](https://en.wikipedia.org/wiki/Transfer_function)). In the context of MPIFiles this usually includes the properties of the receive chain of an MPI system, but can also hold information about other parts of the signal chain. | ||
|
||
## Basic construction and data access | ||
The `TransferFunction` object is constructed from samples in frequency space and offers two ways to access the underlying data. The first uses indexing to directly access the underlying data: | ||
|
||
```@setup tf | ||
using MPIFiles | ||
``` | ||
```@repl tf | ||
f = collect(range(0,1e6,step=1e3)); | ||
# TransferFunction of a simple lowpass filter | ||
tf = TransferFunction(f, 1 ./ (1 .+ im*f/1e4 )) | ||
tf[1] # Value of tf at first frequency sample (f = 0 Hz) | ||
``` | ||
|
||
The second method has to be called on the object itself and uses linear interpolation to access the tf at any frequency: | ||
```@repl tf | ||
tf(0) # Value of tf at f = 0 Hz | ||
tf(1e4) # Value of tf at f = 10000 Hz | ||
``` | ||
|
||
A `TransferFunction` can have multiple channels, which adds a second index to both data access functions. Directly accessing multiple channels is also possible. The complex array used to construct the `TransferFunction` needs to have the shape [number of frequency samples, channels]. | ||
|
||
```@repl tf | ||
tf = TransferFunction(f, [1 ./(1 .+im*f/1e4) 1 ./(1 .+im*f/1e3)]) | ||
tf[11,1] | ||
tf[11,2] | ||
tf(1e4,1) | ||
tf(1e4,2) | ||
tf(1e4, [1,2]) | ||
tf(1e4,:) | ||
``` | ||
## Units | ||
To attach units to the `TransferFunction` the keyword-parameter `units` can to be used to give a `Unitful` unit to every channel of the tf. This can be useful if the transfer function is not dimensionless but relates two physical quantities, e.g. voltage and current in the form of an impedance. All **interpolated** accesses to tf data then return a `Unitful.Quantity`. | ||
|
||
```@repl tf | ||
R = 1; # Ohm | ||
L = 10e-6; # Henry | ||
RL = TransferFunction(f, R .+ im*2pi*f*L, units=["V/A"]) | ||
RL([0,100e3]) | ||
``` | ||
|
||
## Saving and loading | ||
A `TransferFunction` object can be saved to and loaded from a .h5 file. | ||
|
||
```@docs | ||
MPIFiles.save(filename::String, tf::TransferFunction) | ||
MPIFiles.TransferFunction(::String) | ||
``` | ||
|
||
## Additional constructors | ||
|
||
In addition to the constructor taking a single (complex) array it is also possible to give two arrays representing amplitude and phase. | ||
|
||
It is also possible to construct a `TransferFunction` from the transfer function data included in an `MPIFile`. | ||
|
||
```@docs | ||
MPIFiles.TransferFunction(freq::Vector{<:Real}, ampdata::Array{<:Real,N}, phasedata::Array{<:Real,N}) where N | ||
MPIFiles.TransferFunction(::MPIFile) | ||
``` | ||
|
||
## Other interesting functions | ||
```@docs | ||
TransferFunction | ||
combine(::TransferFunction, ::TransferFunction) | ||
``` | ||
|
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
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
Oops, something went wrong.