summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cdffe4e)
raw | patch | inline | side by side (parent: cdffe4e)
author | Ming Wei <a0868762@ti.com> | |
Wed, 18 Jan 2017 20:57:23 +0000 (14:57 -0600) | ||
committer | Ming Wei <a0868762@ti.com> | |
Wed, 18 Jan 2017 20:57:23 +0000 (14:57 -0600) |
Signed-off-by: Ming Wei <a0868762@ti.com>
common/components/clk.c | patch | blob | history | |
file_demo_bios/k2g/.project | patch | blob | history | |
file_demo_bios/k2g/main.c | patch | blob | history |
index 40be13511efc0ffb3a6f93f47f06709c5c2596c9..e315298184ec922b70648b649228501c2579e0e6 100644 (file)
--- a/common/components/clk.c
+++ b/common/components/clk.c
/*
- * Copyright (c) 2016, Texas Instruments Incorporated
+ * Copyright (c) 2017, Texas Instruments Incorporated\r
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
\r
#include <strings.h>\r
\r
+#include "fil.h" /* FILE I/O implementation */\r
+#include "sys.h" /* System API and structures */\r
+#include "sysbfflt.h" /* System support for BF filters */\r
+\r
/* The infamous xdc/std.h must come before any header file which uses XDC symbols */\r
#include <xdc/std.h> /* mandatory - have to include first, for BIOS types */\r
#include <ti/mas/types/types.h>\r
//#include <ti/mas/aer/mss.h>\r
#include "mss/mss.h" /* local version used */\r
#include <ti/mas/vpe/asnr.h>\r
+#if (SYS_USE_DRC)\r
#include <ti/mas/vau/vau.h>\r
+#include <ti/mas/aer/drc.h>\r
+#endif\r
\r
/*----------------------------------------\r
* BIOS header files\r
\r
#include <ti/sysbios/knl/Semaphore.h> /* this looks obvious */\r
\r
-#include "fil.h" /* FILE I/O implementation */\r
-#include "sys.h" /* System API and structures */\r
-#include "sysbfflt.h" /* System support for BF filters */\r
-\r
#define Timestamp_get Timestamp_get32 /* use 32-bit time stamps */\r
\r
#define MIN(a,b) (((a)>(b))?(b):(a)) /* Min/Max macros */\r
*\r
*===========================================*/\r
\r
+#if (SYS_USE_DRC)\r
+/* Output frame for MSS, input for DRC */\r
+#pragma DATA_ALIGN(txOutFrame1,8)\r
+linSample txOutFrame1[SYS_FRAME_LENGTH];\r
+\r
+/* Output frame for DRC, input for VAU */\r
+#pragma DATA_ALIGN(txOutFrame2,8)\r
+linSample txOutFrame2[SYS_FRAME_LENGTH];\r
+#else\r
/* Output frame for MSS, input for VAU */\r
#pragma DATA_ALIGN(txOutFrame,8)\r
linSample txOutFrame[SYS_FRAME_LENGTH];\r
+#endif\r
\r
typedef struct txBfDebug_stc {\r
tulong frmcnt; /* normal frames */\r
txTaskProfileData_t bf; /* Beamformer profile */\r
txTaskProfileData_t asnr; /* ASNR profile */\r
txTaskProfileData_t mss; /* MSS profile */\r
+ txTaskProfileData_t drc; /* DRC profile */\r
txTaskProfileData_t vau; /* VAU profile */\r
} txTaskProfile_t;\r
volatile txTaskProfile_t txTaskProfile = {\r
{~(0uL), 0, 0, 0.0f},\r
{~(0uL), 0, 0, 0.0f},\r
{~(0uL), 0, 0, 0.0f},\r
+ {~(0uL), 0, 0, 0.0f},\r
{~(0uL), 0, 0, 0.0f}\r
};\r
\r
\r
t1 = Timestamp_get();\r
inst_p = sysContext.mssInst_p; /* fetch the MSS instance pointer */\r
+#if (SYS_USE_DRC)\r
+ frame_p = txOutFrame1; /* point to the output frame buffer */\r
+#else\r
frame_p = txOutFrame; /* point to the output frame buffer */\r
+#endif\r
\r
err = mssProcess(inst_p, (void*)frame_p, /* instance and output frame pointers */\r
(void*)frame_p, /* WORKAROUND (not used, but no NULL) */\r
}\r
\r
/* Done with MSS */\r
- /* Run VAU */\r
\r
+#if (SYS_USE_DRC)\r
+ /* Run DRC */\r
+ t1 = Timestamp_get();\r
+ inst_p = sysContext.drcInst_p; /* fetch the DRC instance pointer */\r
+ frame_p = txOutFrame1; /* point to the MSS output frame buffer and use it as input */\r
+ outframe_p = txOutFrame2; /* point to DRC output frame */\r
+ err = drcProcess(inst_p, frame_p, /* instance and input frame pointers */\r
+ outframe_p); /* pointer to output buffer pointer */\r
+ t2 = Timestamp_get();\r
+ delta = t2-t1;\r
+ txTaskProfile.drc.min = MIN(txTaskProfile.drc.min,delta);\r
+ txTaskProfile.drc.max = MAX(txTaskProfile.drc.max,delta);\r
+ txTaskProfile.drc.n++;\r
+ txTaskProfile.drc.total += (float)delta;\r
+ /* Done with DRC */\r
+#else\r
+ outframe_p = frame_p;\r
+#endif\r
+\r
+ /* Run VAU */\r
+#if 0\r
t1 = Timestamp_get();\r
inst_p = sysContext.vauInst_p; /* fetch the VAU instance pointer */\r
frame_p = txOutFrame; /* point to the Tx output frame buffer and use it as input */\r
\r
Log_write4(UIAEvt_intWithKey, 20*alert, 3, 0, (IArg)"VAU-ALERT");\r
}\r
+#endif\r
\r
/*---------------------------------*/\r
/* Save samples to the output file */\r
index 9d72fcaf759713392bd5417b7c5cefdf4882e377..c14ca5cc0104cb3f4fce3163e860726bf8f6f9b6 100644 (file)
<type>1</type>\r
<locationURI>PARENT-2-PROJECT_LOC/common/components/sysbfflt.h</locationURI>\r
</link>\r
+ <link>\r
+ <name>sysdrc.c</name>\r
+ <type>1</type>\r
+ <locationURI>PARENT-2-PROJECT_LOC/common/components/sysdrc.c</locationURI>\r
+ </link>\r
<link>\r
<name>syseram.c</name>\r
<type>1</type>\r
index be9f38ded4975b05ade968dd02586d0837c087b0..f70c07ae6d5ca118fd24e6452088a86ebba34c83 100644 (file)
/*
- * Copyright (c) 2016, Texas Instruments Incorporated
+ * Copyright (c) 2017, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
sysConfig_t sysConfig = {
SYS_MICS_MAX, /* #microphones */
SYS_VMICS_MAX, /* #virtual microphones */
+ 5, /* 5ms ASNR delay */
+ { 12, 9, 6}, /* ASNR band1=12dB, band2=9dB, band3=6dB */
+ TRUE, /* Enable ASNR */
FALSE, /* Do not use file I/O to load files (must use GEL to load into memory) */
- TRUE /* Use default angles for microphone configurations */
+ TRUE, /* Use default angles for microphone configurations */
+ FALSE, /* Enable VAD */
+ -50, /* drc expansion knee point in dBm0 (dBFS is dBm0-3dB */
+ 6, /* drc max gain in dB */
+ FALSE /* Disable DRC */
};
/* Global FILE I/O Configuration Structure (must be configured even when file I/O not used */
sysBfCreate(); /* Create beamformers */
sysAsnrCreate(); /* Create ASNR's */
sysMssCreate(); /* Create MSS */
- sysVauCreate(); /* Create VAU */
+#if (SYS_USE_DRC)
+ sysDrcCreate(); /* Create DRC */
+#endif
+ //sysVauCreate(); /* Create VAU */
BIOS_start();