diff options
author | unknown <dm2515@eews303a-004.ic.ac.uk> | 2018-03-05 11:32:57 +0000 |
---|---|---|
committer | unknown <dm2515@eews303a-004.ic.ac.uk> | 2018-03-05 11:32:57 +0000 |
commit | fcaf88ac27152cf3c553fb5976ce2aed3b64f6f2 (patch) | |
tree | 8acaa55d8bae3429c446f68f9f3fc0670404a207 /Project/RTDSP | |
parent | 940fc1e52823dfdeb635e07fa161d98ab283bc0b (diff) | |
download | NoiseSilencer-fcaf88ac27152cf3c553fb5976ce2aed3b64f6f2.tar.gz NoiseSilencer-fcaf88ac27152cf3c553fb5976ce2aed3b64f6f2.zip |
EX2 code
Diffstat (limited to 'Project/RTDSP')
-rw-r--r-- | Project/RTDSP/.launches/RTDSP.launch | 6 | ||||
-rw-r--r-- | Project/RTDSP/frame.c | 19 |
2 files changed, 18 insertions, 7 deletions
diff --git a/Project/RTDSP/.launches/RTDSP.launch b/Project/RTDSP/.launches/RTDSP.launch index 4e69bfc..b408121 100644 --- a/Project/RTDSP/.launches/RTDSP.launch +++ b/Project/RTDSP/.launches/RTDSP.launch @@ -12,8 +12,8 @@ <stringAttribute key="com.ti.ccstudio.debug.core.DISPLAY_NAME_FORMAT" value="RTDSP [Debug] - {0}"/> <stringAttribute key="CCEDebugOptions.TARGET_CONFIGURATION_OPTION" value="full"/> <stringAttribute key="org.eclipse.cdt.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8"?> <memoryBlockExpressionList/> "/> -<stringAttribute key="com.ti.ccstudio.debug.core.MRU_PROGRAM_NAME" value="C:\github\RTDSP\Project\RTDSP\Debug\RTDSP.out"/> -<stringAttribute key="com.ti.ccstudio.debug.core.MRU_MODULES" value="<?xml version="1.0" encoding="UTF-8"?> <modules> <module name="C:\GIT\RTDSP\lab3\RTDSP\Debug\RTDSP.out" time="Fri Jan 19 14:07:28 GMT 2018" time_long="1516370848357"/> <module name="C:\Github\RTDSP\lab3\RTDSP\Debug\RTDSP.out" time="Tue Jan 23 11:15:11 GMT 2018" time_long="1516706111426"/> <module name="C:\GIT\RTDSP\lab4\RTDSP\Debug\RTDSP.out" time="Thu Feb 01 11:44:21 GMT 2018" time_long="1517485461898"/> <module name="C:\github\RTDSP\lab4\RTDSP\Debug\RTDSP.out" time="Thu Feb 15 13:55:55 GMT 2018" time_long="1518702955359"/> <module name="C:\Github\RTDSP\lab5\RTDSP\Debug\RTDSP.out" time="Tue Feb 27 12:18:55 GMT 2018" time_long="1519733935329"/> <module name="C:\github\RTDSP\lab5\RTDSP\Debug\RTDSP.out" time="Thu Mar 01 13:36:20 GMT 2018" time_long="1519911380476"/> <module name="C:\github\RTDSP\Project\RTDSP\Debug\RTDSP.out" time="Mon Mar 05 10:28:49 GMT 2018" time_long="1520245729915"/> </modules> "/> +<stringAttribute key="com.ti.ccstudio.debug.core.MRU_PROGRAM_NAME" value="C:\GIT\RTDSP\Project\RTDSP\Debug\RTDSP.out"/> +<stringAttribute key="com.ti.ccstudio.debug.core.MRU_MODULES" value="<?xml version="1.0" encoding="UTF-8"?> <modules> <module name="C:\GIT\RTDSP\lab3\RTDSP\Debug\RTDSP.out" time="Fri Jan 19 14:07:28 GMT 2018" time_long="1516370848357"/> <module name="C:\Github\RTDSP\lab3\RTDSP\Debug\RTDSP.out" time="Tue Jan 23 11:15:11 GMT 2018" time_long="1516706111426"/> <module name="C:\GIT\RTDSP\lab4\RTDSP\Debug\RTDSP.out" time="Thu Feb 01 11:44:21 GMT 2018" time_long="1517485461898"/> <module name="C:\github\RTDSP\lab4\RTDSP\Debug\RTDSP.out" time="Thu Feb 15 13:55:55 GMT 2018" time_long="1518702955359"/> <module name="C:\Github\RTDSP\lab5\RTDSP\Debug\RTDSP.out" time="Tue Feb 27 12:18:55 GMT 2018" time_long="1519733935329"/> <module name="C:\github\RTDSP\lab5\RTDSP\Debug\RTDSP.out" time="Thu Mar 01 13:36:20 GMT 2018" time_long="1519911380476"/> <module name="C:\github\RTDSP\Project\RTDSP\Debug\RTDSP.out" time="Mon Mar 05 10:28:49 GMT 2018" time_long="1520245729915"/> <module name="C:\GIT\RTDSP\Project\RTDSP\Debug\RTDSP.out" time="Mon Mar 05 11:30:19 GMT 2018" time_long="1520249419272"/> </modules> "/> <stringAttribute key="CCEDebugOptions.CPU_NAME" value="Spectrum Digital DSK-EVM-eZdsp onboard USB Emulator_0/TMS320C671X"/> <stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RTDSP"/> <stringAttribute key="org.eclipse.cdt.launch.GLOBAL_VARIABLES" value="<?xml version="1.0" encoding="UTF-8"?> <globalVariableList/> "/> @@ -21,6 +21,6 @@ <stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="Debug/RTDSP.out"/> <stringAttribute key="CCEDebugOptions.CPU_ISA" value="TMS320C671X"/> <stringAttribute key="com.ti.ccstudio.debug.core.BUILD_CONFIGURATION" value="Debug"/> -<stringAttribute key="CCEDebugOptions.TARGET_CONFIGURATION_FILE" value="C:\github\RTDSP\Project\RTDSP\NewTargetConfiguration.ccxml"/> +<stringAttribute key="CCEDebugOptions.TARGET_CONFIGURATION_FILE" value="C:\GIT\RTDSP\Project\RTDSP\NewTargetConfiguration.ccxml"/> <stringAttribute key="org.eclipse.debug.core.source_locator_id" value="com.ti.ccstudio.debug.core.sourceLocator"/> </launchConfiguration> diff --git a/Project/RTDSP/frame.c b/Project/RTDSP/frame.c index a8fd350..1db240e 100644 --- a/Project/RTDSP/frame.c +++ b/Project/RTDSP/frame.c @@ -78,6 +78,8 @@ float *input; float *intermediate; float *output; volatile int index = 0; +float* mag; +complex C[BUFLEN]; /******************************* Function prototypes *******************************/ @@ -181,7 +183,7 @@ void ISR_AIC(void) void wait_buffer(void) { float *p; - + int i; /* wait for array index to be set to zero by ISR */ while(index); @@ -191,10 +193,19 @@ void wait_buffer(void) output = intermediate; intermediate = p; + /************************* DO PROCESSING OF FRAME HERE **************************/ - - - /*please add your code */ + + // Copy data elements to complex + for (i = 0; i < BUFLEN; ++i) + C[i].r = intermediate[i]; + + fft(BUFLEN, C); + + // Calculate the magnitude of the complex numbers + for (i = 0; i < BUFLEN; ++i) + mag[i] = cabs(C[i]); + /**********************************************************************************/ |