Skip to content

Commit 8d93520

Browse files
committed
Initial commit
0 parents  commit 8d93520

44 files changed

Lines changed: 10644 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
# Created by https://www.gitignore.io/api/swift,macos
3+
4+
### macOS ###
5+
*.DS_Store
6+
.AppleDouble
7+
.LSOverride
8+
9+
# Icon must end with two \r
10+
Icon
11+
12+
# Thumbnails
13+
._*
14+
15+
# Files that might appear in the root of a volume
16+
.DocumentRevisions-V100
17+
.fseventsd
18+
.Spotlight-V100
19+
.TemporaryItems
20+
.Trashes
21+
.VolumeIcon.icns
22+
.com.apple.timemachine.donotpresent
23+
24+
# Directories potentially created on remote AFP share
25+
.AppleDB
26+
.AppleDesktop
27+
Network Trash Folder
28+
Temporary Items
29+
.apdisk
30+
31+
### Swift ###
32+
# Xcode
33+
#
34+
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
35+
36+
## Build generated
37+
build/
38+
DerivedData/
39+
40+
## Various settings
41+
*.pbxuser
42+
!default.pbxuser
43+
*.mode1v3
44+
!default.mode1v3
45+
*.mode2v3
46+
!default.mode2v3
47+
*.perspectivev3
48+
!default.perspectivev3
49+
xcuserdata/
50+
51+
## Other
52+
*.moved-aside
53+
*.xccheckout
54+
*.xcscmblueprint
55+
56+
## Obj-C/Swift specific
57+
*.hmap
58+
*.ipa
59+
*.dSYM.zip
60+
*.dSYM
61+
62+
## Playgrounds
63+
timeline.xctimeline
64+
playground.xcworkspace
65+
66+
# Swift Package Manager
67+
#
68+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
69+
# Packages/
70+
# Package.pins
71+
.build/
72+
73+
# CocoaPods - Refactored to standalone file
74+
75+
# Carthage - Refactored to standalone file
76+
77+
# fastlane
78+
#
79+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
80+
# screenshots whenever they are needed.
81+
# For more information about the recommended setup visit:
82+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
83+
84+
fastlane/report.xml
85+
fastlane/Preview.html
86+
fastlane/screenshots
87+
fastlane/test_output
88+
89+
# End of https://www.gitignore.io/api/swift,macos

Readme.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# waveSDR
2+
3+
A macOS native desktop Software Defined Radio application using the RTL-SDR USB device.
4+
5+
**NB**: This is purely experimental software. I am using this application as a platform for teaching myself macOS desktop application programming as well as DSP techniques. As it is, there are numerous sections of code where improvement is needed.
6+
7+
Features:
8+
9+
* RTL-SDR hardware
10+
* Spectrum Analyzer
11+
* Spectrogram
12+
* AM Demodulator
13+
* FM Narrow Demodulator
14+
* FM Wide Demodulator (mono only)
15+
16+
17+

waveSDR.xcodeproj/project.pbxproj

Lines changed: 536 additions & 0 deletions
Large diffs are not rendered by default.

waveSDR.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

waveSDR/AMDemodulatorBlock.swift

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
//
2+
// AMDemodulatorBlock.swift
3+
// waveSDR
4+
//
5+
// Copyright © 2017 GetOffMyHack. All rights reserved.
6+
//
7+
8+
import Foundation
9+
import Accelerate
10+
11+
class AMDemodulatorBlock: RadioBlock {
12+
13+
var notifyQueue: DispatchQueue?
14+
15+
var samplesOut: ((Samples) -> ())? = nil
16+
17+
var name: String = "AM"
18+
19+
var amGain: Float = 5.0
20+
21+
//--------------------------------------------------------------------------
22+
//
23+
//
24+
//
25+
//--------------------------------------------------------------------------
26+
27+
init() {
28+
notifyQueue = nil
29+
}
30+
31+
init(withNotifyQueue queue: DispatchQueue) {
32+
notifyQueue = queue
33+
}
34+
35+
deinit {
36+
self.unlink()
37+
}
38+
39+
//--------------------------------------------------------------------------
40+
//
41+
//
42+
//
43+
//--------------------------------------------------------------------------
44+
45+
func unlink() {
46+
self.samplesOut = nil
47+
}
48+
49+
//--------------------------------------------------------------------------
50+
//
51+
//
52+
//
53+
//--------------------------------------------------------------------------
54+
55+
func samplesIn(_ samples: Samples) {
56+
57+
// create mutable copy of sample struct
58+
var samples = samples
59+
60+
// create output buffer
61+
var output: [Float] = [Float](repeating: 0.0, count: samples.count)
62+
63+
// convert to DSPSplitComplex type
64+
var inSamples: DSPSplitComplex = samples.asDSPSplitComplex()
65+
66+
// process samples
67+
vDSP_zvabs(&inSamples, vDSP_Stride(1), &output, vDSP_Stride(1), vDSP_Length(samples.count))
68+
69+
// apply amGain
70+
vDSP_vsmul(&output, vDSP_Stride(1), &amGain, &output, vDSP_Stride(1), vDSP_Length(samples.count))
71+
72+
// update samples struct
73+
samples.audio = output
74+
samples.type = .audio
75+
76+
// the reference to samplesOut may become nil at any time so
77+
// check to make sure it exists before sending samples out
78+
if(samplesOut != nil) {
79+
self.samplesOut!(samples)
80+
}
81+
82+
}
83+
84+
//--------------------------------------------------------------------------
85+
//
86+
//
87+
//
88+
//--------------------------------------------------------------------------
89+
90+
func getStatusFor(key: String) -> Any? {
91+
return nil
92+
}
93+
94+
}

0 commit comments

Comments
 (0)