aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorymherklotz <ymherklotz@gmail.com>2018-03-01 13:37:07 +0000
committerymherklotz <ymherklotz@gmail.com>2018-03-01 13:37:07 +0000
commitb3b6ca55b35c07cae4a7c4d50631f49204d759bb (patch)
treebbaa52cbd48a2997105c7ebf3dd707efc63e50b1
parent246af9b0523024caef21ec201d893c6e007cc357 (diff)
downloadNoiseSilencer-b3b6ca55b35c07cae4a7c4d50631f49204d759bb.tar.gz
NoiseSilencer-b3b6ca55b35c07cae4a7c4d50631f49204d759bb.zip
fixed filter
-rw-r--r--lab5/RTDSP/.launches/RTDSP.launch2
-rw-r--r--lab5/RTDSP/intio.c10
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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList/&gt;&#13;&#10;"/>
<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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;modules&gt;&#13;&#10;&lt;module name=&quot;C:\GIT\RTDSP\lab3\RTDSP\Debug\RTDSP.out&quot; time=&quot;Fri Jan 19 14:07:28 GMT 2018&quot; time_long=&quot;1516370848357&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\Github\RTDSP\lab3\RTDSP\Debug\RTDSP.out&quot; time=&quot;Tue Jan 23 11:15:11 GMT 2018&quot; time_long=&quot;1516706111426&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\GIT\RTDSP\lab4\RTDSP\Debug\RTDSP.out&quot; time=&quot;Thu Feb 01 11:44:21 GMT 2018&quot; time_long=&quot;1517485461898&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\github\RTDSP\lab4\RTDSP\Debug\RTDSP.out&quot; time=&quot;Thu Feb 15 13:55:55 GMT 2018&quot; time_long=&quot;1518702955359&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\Github\RTDSP\lab5\RTDSP\Debug\RTDSP.out&quot; time=&quot;Tue Feb 27 12:18:55 GMT 2018&quot; time_long=&quot;1519733935329&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\github\RTDSP\lab5\RTDSP\Debug\RTDSP.out&quot; time=&quot;Thu Mar 01 13:21:50 GMT 2018&quot; time_long=&quot;1519910510215&quot;/&gt;&#13;&#10;&lt;/modules&gt;&#13;&#10;"/>
+<stringAttribute key="com.ti.ccstudio.debug.core.MRU_MODULES" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;modules&gt;&#13;&#10;&lt;module name=&quot;C:\GIT\RTDSP\lab3\RTDSP\Debug\RTDSP.out&quot; time=&quot;Fri Jan 19 14:07:28 GMT 2018&quot; time_long=&quot;1516370848357&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\Github\RTDSP\lab3\RTDSP\Debug\RTDSP.out&quot; time=&quot;Tue Jan 23 11:15:11 GMT 2018&quot; time_long=&quot;1516706111426&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\GIT\RTDSP\lab4\RTDSP\Debug\RTDSP.out&quot; time=&quot;Thu Feb 01 11:44:21 GMT 2018&quot; time_long=&quot;1517485461898&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\github\RTDSP\lab4\RTDSP\Debug\RTDSP.out&quot; time=&quot;Thu Feb 15 13:55:55 GMT 2018&quot; time_long=&quot;1518702955359&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\Github\RTDSP\lab5\RTDSP\Debug\RTDSP.out&quot; time=&quot;Tue Feb 27 12:18:55 GMT 2018&quot; time_long=&quot;1519733935329&quot;/&gt;&#13;&#10;&lt;module name=&quot;C:\github\RTDSP\lab5\RTDSP\Debug\RTDSP.out&quot; time=&quot;Thu Mar 01 13:36:20 GMT 2018&quot; time_long=&quot;1519911380476&quot;/&gt;&#13;&#10;&lt;/modules&gt;&#13;&#10;"/>
<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="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;globalVariableList/&gt;&#13;&#10;"/>
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;
}