diff options
-rw-r--r-- | Complex/Complex.swift | 18 | ||||
-rw-r--r-- | DSP/FFT.swift | 11 | ||||
-rw-r--r-- | IQ/IQ.swift | 7 | ||||
-rw-r--r-- | LA/Lib/Matrix.swift | 73 | ||||
-rw-r--r-- | LA/Test/MatrixBenchmark.swift | 7 | ||||
-rw-r--r-- | LA/Test/MatrixOperations.swift | 8 | ||||
-rw-r--r-- | LA/Test/MatrixXT/MatrixXT.swift | 53 | ||||
-rw-r--r-- | Mod/ModAM.swift | 7 | ||||
-rw-r--r-- | Mod/ModCW.swift | 7 | ||||
-rw-r--r-- | Mod/ModFM.swift | 7 | ||||
-rw-r--r-- | PrySDR/WaterfallAirSpy.swift | 7 | ||||
-rw-r--r-- | PrySDR/WaterfallAirSpyHF.swift | 7 | ||||
-rw-r--r-- | PrySDR/WaterfallBladerRF.swift | 7 | ||||
-rw-r--r-- | PrySDR/WaterfallRtlSdr.swift | 7 | ||||
-rw-r--r-- | PrySDR/main.swift | 2 | ||||
-rw-r--r-- | Radio/HW/AirSpy/AirSpy.swift | 11 | ||||
-rw-r--r-- | Radio/HW/AirSpyHF/AirSpyHF.swift | 11 | ||||
-rw-r--r-- | Radio/HW/BladeRF/BladeRF.swift | 12 | ||||
-rw-r--r-- | Radio/HW/RtlSdr/RtlSdr.swift | 12 | ||||
-rw-r--r-- | Radio/Test/TestAirSpy.swift | 7 | ||||
-rw-r--r-- | Radio/Test/TestAirSpyHF.swift | 7 | ||||
-rw-r--r-- | Radio/Test/TestBladeRF.swift | 7 | ||||
-rw-r--r-- | Radio/Test/TestRtlSdr.swift | 7 | ||||
-rw-r--r-- | Stats/Stats.swift | 21 | ||||
-rw-r--r-- | Utils/FileIQStat.swift | 7 | ||||
-rw-r--r-- | Utils/LoadWav.swift | 7 |
26 files changed, 336 insertions, 1 deletions
diff --git a/Complex/Complex.swift b/Complex/Complex.swift new file mode 100644 index 0000000..e3efb64 --- /dev/null +++ b/Complex/Complex.swift @@ -0,0 +1,18 @@ +// +// Complex.swift +// PrySDR +// +// Created by Jacky Jack on 22/10/2024. +// + +/// Complex number +class Complex { + var i: Float + var q: Float + + /// Create complex number + init(i: Float, q: Float) { + self.i = i + self.q = q + } +} diff --git a/DSP/FFT.swift b/DSP/FFT.swift new file mode 100644 index 0000000..7d1b652 --- /dev/null +++ b/DSP/FFT.swift @@ -0,0 +1,11 @@ +// +// FFT.swift +// PrySDR +// +// Created by Jacky Jack on 22/10/2024. +// + +/// High level abstraction to process FFT from a stream +class FFT { + +} diff --git a/IQ/IQ.swift b/IQ/IQ.swift new file mode 100644 index 0000000..11092be --- /dev/null +++ b/IQ/IQ.swift @@ -0,0 +1,7 @@ +// +// IQ.swift +// PrySDR +// +// Created by Jacky Jack on 22/10/2024. +// + diff --git a/LA/Lib/Matrix.swift b/LA/Lib/Matrix.swift new file mode 100644 index 0000000..8b3f538 --- /dev/null +++ b/LA/Lib/Matrix.swift @@ -0,0 +1,73 @@ +// +// Matrix.swift +// PrySDR +// +// Created by Jacky Jack on 20/10/2024. +// + +enum MatrixOperationError:Error { + case columnValue + case rowValue +} + +/// Matrix Data Type +class Matrix { + /// matrix row number + let rows: Int + /// matrix column number + let columns: Int + /// array where matrix is stored + var data: [Float] + + /// Create NxM matrix + /// - Parameters: + /// - rows: number of rows in matrix + /// - columns: number of columns in matrix + /// - val: default value of matrix elements + init(rows: Int, columns: Int, val: Float) throws { + if (rows < 1) { + throw MatrixOperationError.columnValue + } + if (columns < 1) { + throw MatrixOperationError.rowValue + } + self.rows = rows + self.columns = columns + self.data = Array(repeating: 0.0, count: rows*columns) + //print(self.data) + } + + /// Set elements to value + /// - Parameters: + /// - val: value to set + func set(_ val: Float) { + for idx in 0..<self.data.count { + self.data[idx] = val + } + } + /// Set all elements to 0 + func zero() { + self.set(0.0) + } + + /// Set all elements to 1 + func one() { + self.set(1.0) + } +} + +/// Return 0 matrix +/// - Parameters: +/// - rows: number of rows in matrix +/// - columns: number of columns in matrix +func zero(_ rows: Int, _ columns: Int) -> Matrix { + return try! Matrix.init(rows: rows, columns: columns, val: 0.0) +} + +/// Return identity matrix +/// - Parameters: +/// - rows: number of rows in matrix +/// - columns: number of columns in matrix +func one(_ rows: Int, _ columns: Int) -> Matrix { + return try! Matrix.init(rows: rows, columns: columns, val: 1.0) +} diff --git a/LA/Test/MatrixBenchmark.swift b/LA/Test/MatrixBenchmark.swift new file mode 100644 index 0000000..7057b9e --- /dev/null +++ b/LA/Test/MatrixBenchmark.swift @@ -0,0 +1,7 @@ +// +// MatrixBenchmark.swift +// PrySDR +// +// Created by Jacky Jack on 21/10/2024. +// + diff --git a/LA/Test/MatrixOperations.swift b/LA/Test/MatrixOperations.swift new file mode 100644 index 0000000..a5ff995 --- /dev/null +++ b/LA/Test/MatrixOperations.swift @@ -0,0 +1,8 @@ +// +// MatrixOperations.swift +// PrySDR +// +// Created by Jacky Jack on 21/10/2024. +// + + diff --git a/LA/Test/MatrixXT/MatrixXT.swift b/LA/Test/MatrixXT/MatrixXT.swift new file mode 100644 index 0000000..55661be --- /dev/null +++ b/LA/Test/MatrixXT/MatrixXT.swift @@ -0,0 +1,53 @@ +// +// MatrixXT.swift +// MatrixXT +// +// Created by Jacky Jack on 21/10/2024. +// + +import Testing + +struct MatrixXT { + + @Test func example() async throws { + // Write your test here and use APIs like `#expect(...)` to check expected conditions. + } + + @Test func matrix_create_with_init() async throws { + do { + let _ = try Matrix(row:-1,column: -1,val:0.0) + Issue.record("Should fail") + } catch { + //should allway get here, + } + do { + let _ = try Matrix(row: 0, column: 0, val: 0.0) + Issue.record("Should fail") + } catch { + //should allways get here + } + do { + let _ = try Matrix(row: 1, column: 1, val: 0.0) + } catch { + Issue.record("Failed") + } + + do { + let _ = try Matrix(row: 2, column: 2, val: 0.0) + } catch { + Issue.record("Failed") + } + do { + let _ = try Matrix(row: 3, column: 3, val: 0.0) + } catch { + Issue.record("Failed") + } + do { + let _ = try Matrix(row:16, column: 16, val: 0.0) + } catch { + Issue.record("Failed") + } + +} + +} diff --git a/Mod/ModAM.swift b/Mod/ModAM.swift new file mode 100644 index 0000000..4e15acb --- /dev/null +++ b/Mod/ModAM.swift @@ -0,0 +1,7 @@ +// +// ModAM.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/Mod/ModCW.swift b/Mod/ModCW.swift new file mode 100644 index 0000000..7c4fd11 --- /dev/null +++ b/Mod/ModCW.swift @@ -0,0 +1,7 @@ +// +// ModCW.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/Mod/ModFM.swift b/Mod/ModFM.swift new file mode 100644 index 0000000..142a0dc --- /dev/null +++ b/Mod/ModFM.swift @@ -0,0 +1,7 @@ +// +// ModFM.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/PrySDR/WaterfallAirSpy.swift b/PrySDR/WaterfallAirSpy.swift new file mode 100644 index 0000000..d3aef9c --- /dev/null +++ b/PrySDR/WaterfallAirSpy.swift @@ -0,0 +1,7 @@ +// +// WaterfallAirSpy.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/PrySDR/WaterfallAirSpyHF.swift b/PrySDR/WaterfallAirSpyHF.swift new file mode 100644 index 0000000..28b564a --- /dev/null +++ b/PrySDR/WaterfallAirSpyHF.swift @@ -0,0 +1,7 @@ +// +// WaterfallAirSpyHF.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/PrySDR/WaterfallBladerRF.swift b/PrySDR/WaterfallBladerRF.swift new file mode 100644 index 0000000..56c9027 --- /dev/null +++ b/PrySDR/WaterfallBladerRF.swift @@ -0,0 +1,7 @@ +// +// WaterfallBladerRF.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/PrySDR/WaterfallRtlSdr.swift b/PrySDR/WaterfallRtlSdr.swift new file mode 100644 index 0000000..6bcf338 --- /dev/null +++ b/PrySDR/WaterfallRtlSdr.swift @@ -0,0 +1,7 @@ +// +// WaterfallRtlSdr.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/PrySDR/main.swift b/PrySDR/main.swift index f5ab4c2..47bdc00 100644 --- a/PrySDR/main.swift +++ b/PrySDR/main.swift @@ -7,5 +7,5 @@ import Foundation -print("Hello, World!") +print("PrySDR") diff --git a/Radio/HW/AirSpy/AirSpy.swift b/Radio/HW/AirSpy/AirSpy.swift new file mode 100644 index 0000000..1db0cd6 --- /dev/null +++ b/Radio/HW/AirSpy/AirSpy.swift @@ -0,0 +1,11 @@ +// +// AirSpy.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + +/// Wrapper for libairspy library +class AirSpy { + +} diff --git a/Radio/HW/AirSpyHF/AirSpyHF.swift b/Radio/HW/AirSpyHF/AirSpyHF.swift new file mode 100644 index 0000000..e399d24 --- /dev/null +++ b/Radio/HW/AirSpyHF/AirSpyHF.swift @@ -0,0 +1,11 @@ +// +// AirSpyHF.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + +/// Wrapper for libairspyhf library +class AirSpyHF { + +} diff --git a/Radio/HW/BladeRF/BladeRF.swift b/Radio/HW/BladeRF/BladeRF.swift new file mode 100644 index 0000000..1b72f62 --- /dev/null +++ b/Radio/HW/BladeRF/BladeRF.swift @@ -0,0 +1,12 @@ +// +// BladeRF.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + + +/// Wrapper and routines for BladeRF +class BladeRF { + +} diff --git a/Radio/HW/RtlSdr/RtlSdr.swift b/Radio/HW/RtlSdr/RtlSdr.swift new file mode 100644 index 0000000..3b9063c --- /dev/null +++ b/Radio/HW/RtlSdr/RtlSdr.swift @@ -0,0 +1,12 @@ +// +// RtlSdr.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + + +/// Wrapper for librtlsdr library +class RtlSdr { + +} diff --git a/Radio/Test/TestAirSpy.swift b/Radio/Test/TestAirSpy.swift new file mode 100644 index 0000000..2a60862 --- /dev/null +++ b/Radio/Test/TestAirSpy.swift @@ -0,0 +1,7 @@ +// +// TestAirSpy.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/Radio/Test/TestAirSpyHF.swift b/Radio/Test/TestAirSpyHF.swift new file mode 100644 index 0000000..86d093c --- /dev/null +++ b/Radio/Test/TestAirSpyHF.swift @@ -0,0 +1,7 @@ +// +// TestAirSpyHF.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/Radio/Test/TestBladeRF.swift b/Radio/Test/TestBladeRF.swift new file mode 100644 index 0000000..b71b5b0 --- /dev/null +++ b/Radio/Test/TestBladeRF.swift @@ -0,0 +1,7 @@ +// +// TestBladeRF.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/Radio/Test/TestRtlSdr.swift b/Radio/Test/TestRtlSdr.swift new file mode 100644 index 0000000..f58dd5d --- /dev/null +++ b/Radio/Test/TestRtlSdr.swift @@ -0,0 +1,7 @@ +// +// TestRtlSdr.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + diff --git a/Stats/Stats.swift b/Stats/Stats.swift new file mode 100644 index 0000000..a2d835a --- /dev/null +++ b/Stats/Stats.swift @@ -0,0 +1,21 @@ +// +// Stats.swift +// PrySDR +// +// Created by Jacky Jack on 25/10/2024. +// + +/// Return mean value +func mean() { + +} + +/// Return average value +func average() { + +} + +/// Return median value +func median() { + +} diff --git a/Utils/FileIQStat.swift b/Utils/FileIQStat.swift new file mode 100644 index 0000000..4ab6ecf --- /dev/null +++ b/Utils/FileIQStat.swift @@ -0,0 +1,7 @@ +// +// FileIQStat.swift +// PrySDR +// +// Created by Jacky Jack on 22/10/2024. +// + diff --git a/Utils/LoadWav.swift b/Utils/LoadWav.swift new file mode 100644 index 0000000..e454719 --- /dev/null +++ b/Utils/LoadWav.swift @@ -0,0 +1,7 @@ +// +// LoadWav.swift +// PrySDR +// +// Created by Jacky Jack on 22/10/2024. +// + |