Compare commits

...

2 commits

Author SHA1 Message Date
Ahmet Inan 5e2d28ee7f added frequency markers 2025-08-20 12:12:34 +02:00
Ahmet Inan 1502f20af1 updated libs and tools 2025-08-20 10:38:30 +02:00
4 changed files with 15 additions and 9 deletions

View file

@ -4,12 +4,12 @@ plugins {
android { android {
namespace 'xdsopl.robot36' namespace 'xdsopl.robot36'
compileSdk 35 compileSdk = 36
defaultConfig { defaultConfig {
applicationId "xdsopl.robot36" applicationId "xdsopl.robot36"
minSdk 24 minSdk 24
targetSdk 35 targetSdk 36
versionCode 65 versionCode 65
versionName "2.15" versionName "2.15"

View file

@ -89,6 +89,8 @@ public class MainActivity extends AppCompatActivity {
private int tintColor; private int tintColor;
private boolean autoSave; private boolean autoSave;
private boolean showSpectrogram; private boolean showSpectrogram;
private final int binWidthHz = 10;
private final int[] freqMarkers = { 1100, 1300, 1500, 2300 };
private void setStatus(int id) { private void setStatus(int id) {
setTitle(id); setTitle(id);
@ -223,8 +225,12 @@ public class MainActivity extends AppCompatActivity {
double lowest = Math.log(1e-9); double lowest = Math.log(1e-9);
double highest = Math.log(1); double highest = Math.log(1);
double range = highest - lowest; double range = highest - lowest;
int minFreq = 140;
int minBin = minFreq / binWidthHz;
for (int i = 0; i < stride; ++i) for (int i = 0; i < stride; ++i)
waterfallPlotBuffer.pixels[line + i] = rainbow((Math.log(stft.power[i + 14]) - lowest) / range); waterfallPlotBuffer.pixels[line + i] = rainbow((Math.log(stft.power[i + minBin]) - lowest) / range);
for (int freq : freqMarkers)
waterfallPlotBuffer.pixels[line + (freq - minFreq) / binWidthHz] = 0;
System.arraycopy(waterfallPlotBuffer.pixels, line, waterfallPlotBuffer.pixels, line + stride * (waterfallPlotBuffer.height / 2), stride); System.arraycopy(waterfallPlotBuffer.pixels, line, waterfallPlotBuffer.pixels, line + stride * (waterfallPlotBuffer.height / 2), stride);
} }
} }
@ -315,7 +321,7 @@ public class MainActivity extends AppCompatActivity {
if (rateChanged) { if (rateChanged) {
decoder = new Decoder(scopeBuffer, imageBuffer, getString(R.string.raw_mode), recordRate); decoder = new Decoder(scopeBuffer, imageBuffer, getString(R.string.raw_mode), recordRate);
decoder.setMode(currentMode); decoder.setMode(currentMode);
stft = new ShortTimeFourierTransform(recordRate / 10, 3); stft = new ShortTimeFourierTransform(recordRate / binWidthHz, 3);
} }
startListening(); startListening();
} else { } else {

View file

@ -1,9 +1,9 @@
[versions] [versions]
agp = "8.9.0" agp = "8.12.1"
junit = "4.13.2" junit = "4.13.2"
junitVersion = "1.2.1" junitVersion = "1.3.0"
espressoCore = "3.6.1" espressoCore = "3.7.0"
appcompat = "1.7.0" appcompat = "1.7.1"
material = "1.12.0" material = "1.12.0"
activity = "1.10.1" activity = "1.10.1"
constraintlayout = "2.2.1" constraintlayout = "2.2.1"

View file

@ -1,6 +1,6 @@
#Fri Apr 12 11:35:07 CEST 2024 #Fri Apr 12 11:35:07 CEST 2024
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists