Эх сурвалжийг харах

调整接收频率(去掉两个高频频点,增加两个低频频点,以适配苹果手机),发布V3.0.01版本

zhoutao 1 долоо хоног өмнө
parent
commit
db31cc5ecb

+ 7 - 3
main.c

@@ -45,7 +45,7 @@ void main_read_wav()
 {
     // const char *pFileName = "E:\\work\\ips8000\\aplm8000sdk\\wave\\zcq(20251203-09).wav";
     //  const char *pFileName = "E:\\work\\ips8000\\aplm8000sdk\\wave\\rec5-0-5(0245)-btsx.wav";
-    const char *pFileName = "E:\\work\\ips8000\\aplm8000sdk\\wave\\zcq_one_40mi_huawei_3bts_.wav";
+    const char *pFileName = "E:\\work\\ips8000\\aplm8000sdk\\wave\\xiamen_office_line_2bts.wav";
     int16 *pwData = NULL; // 音频数据存储地址
     uint8 byIsOver = 0;
     uint16 wCounter = 0;
@@ -88,8 +88,12 @@ void main_read_wav()
         return;
     }
 
-    int bytesPerSample = header.bitsPerSample / 8;
-    int totalSamples = header.subchunk2Size / bytesPerSample;
+    // int bytesPerSample = header.bitsPerSample / 8;
+    // int totalSamples = header.subchunk2Size / bytesPerSample;
+
+    // 兼顾苹果
+    int bytesPerSample = 2;
+    int totalSamples = (header.chunkSize - 36) / bytesPerSample;
 
     int samplesToRead = 12000;
     int bytesRead = 0;

+ 16 - 16
src/modules/basestation/bts_main.c

@@ -256,7 +256,7 @@ void bts_main_gen_test_bts()
     pstHead->astLocalBtsList[0].adwTwoBtsList[0] = 10002;
     pstHead->astLocalBtsList[0].dwCoordX = 0;
     pstHead->astLocalBtsList[0].dwCoordY = 0;
-    pstHead->astLocalBtsList[0].dwCoordZ = 200;
+    pstHead->astLocalBtsList[0].dwCoordZ = 270;
 
     // 2号基站
     pstHead->astLocalBtsList[1].dwBuildId = 1;
@@ -265,28 +265,28 @@ void bts_main_gen_test_bts()
     pstHead->astLocalBtsList[1].dwFreqIndex = 4;
     pstHead->astLocalBtsList[1].dwSlot = 1;
     pstHead->astLocalBtsList[1].dwLctType = 1;
-    pstHead->astLocalBtsList[1].dwTwoBtsNum = 2;
+    pstHead->astLocalBtsList[1].dwTwoBtsNum = 1;
     pstHead->astLocalBtsList[1].adwTwoBtsList[0] = 10001;
     pstHead->astLocalBtsList[1].adwTwoBtsList[1] = 10003;
-    pstHead->astLocalBtsList[1].dwCoordX = 4000;
+    pstHead->astLocalBtsList[1].dwCoordX = 1700;
     pstHead->astLocalBtsList[1].dwCoordY = 0;
-    pstHead->astLocalBtsList[1].dwCoordZ = 200;
+    pstHead->astLocalBtsList[1].dwCoordZ = 270;
     pstHead->astLocalBtsList[1].adwBluetoothMac[0] = 1; // 蓝牙mac0
     pstHead->astLocalBtsList[1].adwBluetoothMac[1] = 2; // 蓝牙mac1
     pstHead->astLocalBtsList[1].adwBluetoothMac[2] = 3; // 蓝牙mac2
 
     // 3号基站
-    pstHead->astLocalBtsList[2].dwBuildId = 1;
-    pstHead->astLocalBtsList[2].dwLayerId = 15;
-    pstHead->astLocalBtsList[2].dwBtsId = 10003;
-    pstHead->astLocalBtsList[2].dwFreqIndex = 5;
-    pstHead->astLocalBtsList[2].dwSlot = 2;
-    pstHead->astLocalBtsList[2].dwLctType = 1;
-    pstHead->astLocalBtsList[2].dwTwoBtsNum = 0;
-    pstHead->astLocalBtsList[2].adwTwoBtsList[0] = 10002;
-    pstHead->astLocalBtsList[2].dwCoordX = 8000;
-    pstHead->astLocalBtsList[2].dwCoordY = 0;
-    pstHead->astLocalBtsList[2].dwCoordZ = 200;
+    // pstHead->astLocalBtsList[2].dwBuildId = 1;
+    // pstHead->astLocalBtsList[2].dwLayerId = 15;
+    // pstHead->astLocalBtsList[2].dwBtsId = 10003;
+    // pstHead->astLocalBtsList[2].dwFreqIndex = 5;
+    // pstHead->astLocalBtsList[2].dwSlot = 3;
+    // pstHead->astLocalBtsList[2].dwLctType = 1;
+    // pstHead->astLocalBtsList[2].dwTwoBtsNum = 0;
+    // pstHead->astLocalBtsList[2].adwTwoBtsList[0] = 10002;
+    // pstHead->astLocalBtsList[2].dwCoordX = 5000;
+    // pstHead->astLocalBtsList[2].dwCoordY = 0;
+    // pstHead->astLocalBtsList[2].dwCoordZ = 200;
 
     // // 4号基站
     // pstHead->astLocalBtsList[3].dwBuildId = 1;
@@ -327,7 +327,7 @@ void bts_main_gen_test_bts()
     // pstHead->astLocalBtsList[5].dwTwoBtsNum = 0;
     // pstHead->astLocalBtsList[5].adwTwoBtsList[0] = 10003;
 
-    pstHead->dwBtsNum = 3;
+    pstHead->dwBtsNum = 2;
 }
 
 // 显示安装基站

+ 3 - 1
src/modules/demodulation/dmdl_main.c

@@ -7,7 +7,9 @@
 
 //// 定义全局变量(仅在本模块中使用的全局变量)
 // 系统载波频率
-uint32 gDmdl_adwCarrierList[PUB_SYS_CARRIER_NUM] = {18200, 18800, 19400, 20000, 20600, 21200, 21800, 22400, 23000};
+
+// uint32 gDmdl_adwCarrierList[PUB_SYS_CARRIER_NUM] = {18200, 18800, 19400, 20000, 20600, 21200, 21800, 22400, 23000};
+uint32 gDmdl_adwCarrierList[PUB_SYS_CARRIER_NUM] = {17000, 17600, 18200, 18800, 19400, 20000, 20600, 21200, 21800};
 
 int16 *gDmdl_pwAudioDataList = NULL; // 音频采样数据存储地址
 

+ 1 - 1
src/modules/imu/imu.c

@@ -28,7 +28,7 @@ void imu_init()
 
     // 选峰参数
     gImu_stInitParam.dwPeakPeakDistance = 35; // 35; // 峰间距
-    gImu_stInitParam.dwPeakValueThres = 100;  // 100为了适配苹果手机  // 102; // 峰值门限
+    gImu_stInitParam.dwPeakValueThres = 102;  // 峰值门限
 
     printf("imu init ok \n");
 

+ 3 - 3
src/modules/location/lct_firstpath.c

@@ -94,7 +94,7 @@ void lct_firstpath_main(PUB_LCT_BTS_LIST_T *pstLctBtsList, PUB_LOCATION_DATA_T *
         // TODO测试
         if (PUB_DEBUG_ENABLE)
         {
-            if (pstLctData->dwFrameNo > 400)
+            if (pstLctData->dwFrameNo > 0)
             {
                 char *pfileName = "E:\\work\\ips8000\\aplm8000sdk\\output\\lctdata\\firstpath.bin";
                 util_write_flt32_to_bin_file(pfileName, PUB_SLOT_FRAME_LEN, gg_afOneFrameLocationData, 1);
@@ -142,7 +142,7 @@ void lct_firstpath_main(PUB_LCT_BTS_LIST_T *pstLctBtsList, PUB_LOCATION_DATA_T *
                 // TODO测试
                 if (PUB_DEBUG_ENABLE)
                 {
-                    if (pstLctData->dwFrameNo > 400)
+                    if (pstLctData->dwFrameNo > 0)
                     {
                         printf("frame no:%d, freq index:%d, sync index:%d, cal frame index:%d, cal index:%d\n", pstLctData->dwFrameNo - 1, pstFirstPath->byFreqIndex, pstLctData->dwSignalSyncIndex, pstFirstPath->wFrameCalIndex, pstFirstPath->dwCalPathIndex);
                         uint8 byTmp = 0;
@@ -189,7 +189,7 @@ void lct_firstpath_main(PUB_LCT_BTS_LIST_T *pstLctBtsList, PUB_LOCATION_DATA_T *
             // TODO测试
             if (PUB_DEBUG_ENABLE)
             {
-                if (pstLctData->dwFrameNo > 400)
+                if (pstLctData->dwFrameNo > 0)
                 {
                     printf("frame no:%d, freq index:%d, sync index:%d, track frame index:%d, track index:%d\n", pstLctData->dwFrameNo - 1, pstFirstPath->byFreqIndex, pstLctData->dwSignalSyncIndex, pstFirstPath->wFrameTrackIndex, pstFirstPath->dwTrackPathIndex);
                     uint8 byTmp = 0;

+ 3 - 3
src/sysdefine/struct_bts.h

@@ -12,9 +12,9 @@
 // 幅度模块宏
 #define BTS_AMPL_MIRROR_SECONDS 4                            // 镜像秒数,几秒计算一次最强频点
 #define BTS_AMPL_MIRROR_FRAMES (4 * BTS_AMPL_MIRROR_SECONDS) // 镜像帧数,每秒4帧
-#define BTS_AMPL_MAIN_BTS_AMPL_VALID_THRESHOLD 500           // 减低门限,适配基站安装较高的场景 //1500          // 主站幅度有效门限(用户在某个时刻一定会更靠近某个基站,所以该基站幅度至少要大于该门限值)
-#define BTS_AMPL_BTS_AMPL_VALID_THRESHOLD 250                // 减低门限,适配基站安装较高的场景 //350                // 基站幅度有效门限
-#define BTS_AMPL_BTS_SNR_VALID_THRESHOLD 3.5                 // 减低门限,适配基站安装较高的场景 //5                   // 基站SNR有效门限
+#define BTS_AMPL_MAIN_BTS_AMPL_VALID_THRESHOLD 1500          // 减低门限,适配基站安装较高的场景 //1500          // 主站幅度有效门限(用户在某个时刻一定会更靠近某个基站,所以该基站幅度至少要大于该门限值)
+#define BTS_AMPL_BTS_AMPL_VALID_THRESHOLD 350                // 250                // 减低门限,适配基站安装较高的场景 //350                // 基站幅度有效门限
+#define BTS_AMPL_BTS_SNR_VALID_THRESHOLD 5                   // 3.5                 // 减低门限,适配基站安装较高的场景 //5                   // 基站SNR有效门限
 
 // 同步模块宏
 #define BTS_SYNC_STABLE_SYNC_FRAMES BTS_AMPL_MIRROR_FRAMES // 同步帧数,即几帧进行一次同步

+ 2 - 1
src/sysdefine/sysmacro.h

@@ -18,7 +18,8 @@
 // V2.1.03 2025-04-25 by zt 增加基于toa计算第一径偏移量的代码(toa应用的代码还未写),修改代码中的缺陷(两处检查极小值点的错误)
 // V2.1.04 2025-05-08 by zt 完善toa模块代码,10秒钟后开始启用toa模块,之后每5秒统计一次toa偏移量,若前后两次偏移量小于门限值则后面5秒则用toa模式选择极小值点,反之则用tdoa。
 // 增加贝塞尔曲线插值,在当前点和上一个点之间插入3个点,以平滑曲线,并且实现每秒输出4个点的效果
-#define PUB_SOFTWARE_VERSION "V2.1.04" // 软件版本
+// V3.0.01 2025-05-27 by zt 调整接收频率,去掉两个高频频点,增加两个低频频点,以适配苹果手机
+#define PUB_SOFTWARE_VERSION "V3.0.01" // 软件版本
 
 #define PUB_M_PI 3.14159265358979323846
 #define PUB_2PI (2 * 3.14159265358979323846)

+ 2 - 2
src/sysmain/sysmain.c

@@ -92,8 +92,8 @@ void sysmain_init_lct()
     stLctCoordcalParam.dwFirstPathIndexJumpThres = 720; // 二维第一径跳变门限
 
     // 判断一维基站第一径是否有效参数,相比于二维门限要求有所提高
-    stLctCoordcalParam.dwOneFirstPahtValueThres = 250;     // 一维第一径幅度有效门限
-    stLctCoordcalParam.dwOneFirstPahtSnrThres = 40;        // 一维第一径信噪有效门限(放大10倍)
+    stLctCoordcalParam.dwOneFirstPahtValueThres = 350;     // 一维第一径幅度有效门限
+    stLctCoordcalParam.dwOneFirstPahtSnrThres = 50;        // 一维第一径信噪有效门限(放大10倍)
     stLctCoordcalParam.dwOneFirstPathIndexJumpThres = 500; // 一维第一径跳变门限
 
     stLctCoordcalParam.dwBtsEdgeExpendLen = 150;            // 基站围成的矩形框向外扩展长度,默认值150

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
wasm/aplm8000sdk.js


+ 0 - 182
wasm/aplm8000sdk.worker.js

@@ -1,182 +0,0 @@
-/**
- * @license
- * Copyright 2015 The Emscripten Authors
- * SPDX-License-Identifier: MIT
- */
-
-// Pthread Web Worker startup routine:
-// This is the entry point file that is loaded first by each Web Worker
-// that executes pthreads on the Emscripten application.
-
-'use strict';
-
-var Module = {};
-
-// Node.js support
-var ENVIRONMENT_IS_NODE = typeof process == 'object' && typeof process.versions == 'object' && typeof process.versions.node == 'string';
-if (ENVIRONMENT_IS_NODE) {
-  // Create as web-worker-like an environment as we can.
-
-  // See the parallel code in shell.js, but here we don't need the condition on
-  // multi-environment builds, as we do not have the need to interact with the
-  // modularization logic as shell.js must (see link.py:node_es6_imports and
-  // how that is used in link.py).
-
-  var nodeWorkerThreads = require('worker_threads');
-
-  var parentPort = nodeWorkerThreads.parentPort;
-
-  parentPort.on('message', (data) => onmessage({ data: data }));
-
-  var fs = require('fs');
-  var vm = require('vm');
-
-  Object.assign(global, {
-    self: global,
-    require,
-    Module,
-    location: {
-      // __filename is undefined in ES6 modules, and import.meta.url only in ES6
-      // modules.
-      href: __filename
-    },
-    Worker: nodeWorkerThreads.Worker,
-    importScripts: (f) => vm.runInThisContext(fs.readFileSync(f, 'utf8'), {filename: f}),
-    postMessage: (msg) => parentPort.postMessage(msg),
-    performance: global.performance || { now: Date.now },
-  });
-}
-
-// Thread-local guard variable for one-time init of the JS state
-var initializedJS = false;
-
-function threadPrintErr(...args) {
-  var text = args.join(' ');
-  // See https://github.com/emscripten-core/emscripten/issues/14804
-  if (ENVIRONMENT_IS_NODE) {
-    fs.writeSync(2, text + '\n');
-    return;
-  }
-  console.error(text);
-}
-function threadAlert(...args) {
-  var text = args.join(' ');
-  postMessage({cmd: 'alert', text, threadId: Module['_pthread_self']()});
-}
-var err = threadPrintErr;
-self.alert = threadAlert;
-
-Module['instantiateWasm'] = (info, receiveInstance) => {
-  // Instantiate from the module posted from the main thread.
-  // We can just use sync instantiation in the worker.
-  var module = Module['wasmModule'];
-  // We don't need the module anymore; new threads will be spawned from the main thread.
-  Module['wasmModule'] = null;
-  var instance = new WebAssembly.Instance(module, info);
-  // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193,
-  // the above line no longer optimizes out down to the following line.
-  // When the regression is fixed, we can remove this if/else.
-  return receiveInstance(instance);
-}
-
-// Turn unhandled rejected promises into errors so that the main thread will be
-// notified about them.
-self.onunhandledrejection = (e) => {
-  throw e.reason || e;
-};
-
-function handleMessage(e) {
-  try {
-    if (e.data.cmd === 'load') { // Preload command that is called once per worker to parse and load the Emscripten code.
-
-    // Until we initialize the runtime, queue up any further incoming messages.
-    let messageQueue = [];
-    self.onmessage = (e) => messageQueue.push(e);
-
-    // And add a callback for when the runtime is initialized.
-    self.startWorker = (instance) => {
-      // Notify the main thread that this thread has loaded.
-      postMessage({ 'cmd': 'loaded' });
-      // Process any messages that were queued before the thread was ready.
-      for (let msg of messageQueue) {
-        handleMessage(msg);
-      }
-      // Restore the real message handler.
-      self.onmessage = handleMessage;
-    };
-
-      // Module and memory were sent from main thread
-      Module['wasmModule'] = e.data.wasmModule;
-
-      // Use `const` here to ensure that the variable is scoped only to
-      // that iteration, allowing safe reference from a closure.
-      for (const handler of e.data.handlers) {
-        Module[handler] = (...args) => {
-          postMessage({ cmd: 'callHandler', handler, args: args });
-        }
-      }
-
-      Module['wasmMemory'] = e.data.wasmMemory;
-
-      Module['buffer'] = Module['wasmMemory'].buffer;
-
-      Module['ENVIRONMENT_IS_PTHREAD'] = true;
-
-      if (typeof e.data.urlOrBlob == 'string') {
-        importScripts(e.data.urlOrBlob);
-      } else {
-        var objectUrl = URL.createObjectURL(e.data.urlOrBlob);
-        importScripts(objectUrl);
-        URL.revokeObjectURL(objectUrl);
-      }
-    } else if (e.data.cmd === 'run') {
-      // Pass the thread address to wasm to store it for fast access.
-      Module['__emscripten_thread_init'](e.data.pthread_ptr, /*is_main=*/0, /*is_runtime=*/0, /*can_block=*/1);
-
-      // Await mailbox notifications with `Atomics.waitAsync` so we can start
-      // using the fast `Atomics.notify` notification path.
-      Module['__emscripten_thread_mailbox_await'](e.data.pthread_ptr);
-
-      // Also call inside JS module to set up the stack frame for this pthread in JS module scope
-      Module['establishStackSpace']();
-      Module['PThread'].receiveObjectTransfer(e.data);
-      Module['PThread'].threadInitTLS();
-
-      if (!initializedJS) {
-        initializedJS = true;
-      }
-
-      try {
-        Module['invokeEntryPoint'](e.data.start_routine, e.data.arg);
-      } catch(ex) {
-        if (ex != 'unwind') {
-          // The pthread "crashed".  Do not call `_emscripten_thread_exit` (which
-          // would make this thread joinable).  Instead, re-throw the exception
-          // and let the top level handler propagate it back to the main thread.
-          throw ex;
-        }
-      }
-    } else if (e.data.cmd === 'cancel') { // Main thread is asking for a pthread_cancel() on this thread.
-      if (Module['_pthread_self']()) {
-        Module['__emscripten_thread_exit'](-1);
-      }
-    } else if (e.data.target === 'setimmediate') {
-      // no-op
-    } else if (e.data.cmd === 'checkMailbox') {
-      if (initializedJS) {
-        Module['checkMailbox']();
-      }
-    } else if (e.data.cmd) {
-      // The received message looks like something that should be handled by this message
-      // handler, (since there is a e.data.cmd field present), but is not one of the
-      // recognized commands:
-      err(`worker.js received unknown command ${e.data.cmd}`);
-      err(e.data);
-    }
-  } catch(ex) {
-    Module['__emscripten_thread_crashed']?.();
-    throw ex;
-  }
-};
-
-self.onmessage = handleMessage;

BIN
wasm/aplm8000sdk.wasm → wasm/aplm8000sdk3.0.01.wasm


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно