diff options
author | ymherklotz <ymherklotz@gmail.com> | 2018-03-01 13:37:07 +0000 |
---|---|---|
committer | ymherklotz <ymherklotz@gmail.com> | 2018-03-01 13:37:07 +0000 |
commit | b3b6ca55b35c07cae4a7c4d50631f49204d759bb (patch) | |
tree | bbaa52cbd48a2997105c7ebf3dd707efc63e50b1 | |
parent | 246af9b0523024caef21ec201d893c6e007cc357 (diff) | |
download | NoiseSilencer-b3b6ca55b35c07cae4a7c4d50631f49204d759bb.tar.gz NoiseSilencer-b3b6ca55b35c07cae4a7c4d50631f49204d759bb.zip |
fixed filter
-rw-r--r-- | lab5/RTDSP/.launches/RTDSP.launch | 2 | ||||
-rw-r--r-- | lab5/RTDSP/intio.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/lab5/RTDSP/.launches/RTDSP.launch b/lab5/RTDSP/.launches/RTDSP.launch index a36423e..e394078 100644 --- a/lab5/RTDSP/.launches/RTDSP.launch +++ b/lab5/RTDSP/.launches/RTDSP.launch @@ -13,7 +13,7 @@ <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\lab5\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:21:50 GMT 2018" time_long="1519910510215"/> </modules> "/> +<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"/> </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/> "/> diff --git a/lab5/RTDSP/intio.c b/lab5/RTDSP/intio.c index bbe98c0..e9c5cd7 100644 --- a/lab5/RTDSP/intio.c +++ b/lab5/RTDSP/intio.c @@ -82,8 +82,8 @@ void ISR_AIC(void); void iir_dir_form_transposed(void); /********************************** Main routine ************************************/ void main(){ - d = (double*)malloc(N * sizeof(double)); - memset(d, 0.0, N * sizeof(double)); + d = (double*)malloc((N+1) * sizeof(double)); + memset(d, 0.0, (N+1) * sizeof(double)); // initialize board and the audio port init_hardware(); @@ -142,10 +142,8 @@ void ISR_AIC() void iir_dir_form_transposed() { int i; - double y = d[0]; d[0] = b[0] * xin + d[1]; - for (i = 1; i < N-1; ++i) { - d[i] = b[i] * xin + d[i+1] - a[i] * y; + for (i = 1; i < N; ++i) { + d[i] = b[i] * xin + d[i+1] - a[i] * d[0]; } - d[N-1] = b[N-1] * xin - a[N-1] * y; } |