aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorymherklotz <ymherklotz@gmail.com>2018-03-01 13:22:37 +0000
committerymherklotz <ymherklotz@gmail.com>2018-03-01 13:22:37 +0000
commit246af9b0523024caef21ec201d893c6e007cc357 (patch)
tree8f90574e10dfed6861a2b4a0545482a75f232343
parent1e04f2cde4b36d9af7988dcedb317de32938dc32 (diff)
downloadNoiseSilencer-246af9b0523024caef21ec201d893c6e007cc357.tar.gz
NoiseSilencer-246af9b0523024caef21ec201d893c6e007cc357.zip
Adding files
-rw-r--r--lab5/RTDSP/.launches/RTDSP.launch2
-rw-r--r--lab5/RTDSP/Matlab/coeff.txt4
-rw-r--r--lab5/RTDSP/Matlab/gen_filter.m2
-rw-r--r--lab5/RTDSP/intio.c7
4 files changed, 9 insertions, 6 deletions
diff --git a/lab5/RTDSP/.launches/RTDSP.launch b/lab5/RTDSP/.launches/RTDSP.launch
index bcd1937..a36423e 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;Wed Feb 28 12:30:22 GMT 2018&quot; time_long=&quot;1519821022128&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:21:50 GMT 2018&quot; time_long=&quot;1519910510215&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/Matlab/coeff.txt b/lab5/RTDSP/Matlab/coeff.txt
index 50b2b2b..2849703 100644
--- a/lab5/RTDSP/Matlab/coeff.txt
+++ b/lab5/RTDSP/Matlab/coeff.txt
@@ -1,2 +1,2 @@
-double a[] = {1.000000000000000e+00, -3.049850168927851e+01, 4.518219979745301e+02, -4.330568375340208e+03, 3.017680165238581e+04, -1.628761117040925e+05, 7.083789447100600e+05, -2.549943805499000e+06, 7.743889480668208e+06, -2.012290905048920e+07, 4.522326696255741e+07, -8.861603844569437e+07, 1.523508956789228e+08, -2.308863204635539e+08, 3.094998449451197e+08, -3.678300347249148e+08, 3.881054118761563e+08, -3.637157697088127e+08, 3.026148917241598e+08, -2.232250495844627e+08, 1.456480003818601e+08, -8.376961823486008e+07, 4.227179687333500e+07, -1.859918758217013e+07, 7.077447220356787e+06, -2.304423124860145e+06, 6.330109382091770e+05, -1.439185427681492e+05, 2.636611842984756e+04, -3.741376162471272e+03, 3.859821380464503e+02, -2.576271373584020e+01, 8.352689156803546e-01, };
-double b[] = {9.369360487907812e-02, -2.864818892621460e+00, 4.255773741419589e+01, -4.091031012581832e+02, 2.859712896572771e+03, -1.548649022591978e+04, 6.759164673120990e+04, -2.442167709453068e+05, 7.445734232202021e+05, -1.942803804170768e+06, 4.385069059291627e+06, -8.631571972423440e+06, 1.490982529221888e+07, -2.270715845041017e+07, 3.059491535922983e+07, -3.655506142442168e+07, 3.878366747099619e+07, -3.655506142442170e+07, 3.059491535922986e+07, -2.270715845041021e+07, 1.490982529221891e+07, -8.631571972423460e+06, 4.385069059291639e+06, -1.942803804170775e+06, 7.445734232202050e+05, -2.442167709453079e+05, 6.759164673121022e+04, -1.548649022591987e+04, 2.859712896572789e+03, -4.091031012581860e+02, 4.255773741419620e+01, -2.864818892621481e+00, 9.369360487907882e-02, };
+double a[] = {0.000000000000000e+00, -3.622738280081860e+00, 5.063887790131738e+00, -3.234610259864942e+00, 7.984164681552781e-01, };
+double b[] = {9.756494393306392e-02, -3.428674269973439e-01, 4.911005379625814e-01, -3.428674269973439e-01, 9.756494393306395e-02, };
diff --git a/lab5/RTDSP/Matlab/gen_filter.m b/lab5/RTDSP/Matlab/gen_filter.m
index f718912..2709e48 100644
--- a/lab5/RTDSP/Matlab/gen_filter.m
+++ b/lab5/RTDSP/Matlab/gen_filter.m
@@ -1,5 +1,5 @@
Fs = 8000;
-[b,a] = elliptical (32, Fs);
+[b,a] = elliptical (4, Fs);
freqz(b, a);
fileID = fopen('coeff.txt','w');
diff --git a/lab5/RTDSP/intio.c b/lab5/RTDSP/intio.c
index d7f841b..bbe98c0 100644
--- a/lab5/RTDSP/intio.c
+++ b/lab5/RTDSP/intio.c
@@ -142,7 +142,10 @@ void ISR_AIC()
void iir_dir_form_transposed()
{
int i;
- for (i = 0; i < N; ++i) {
- d[i] = b[i] * xin + d[i+1] - a[i] * d[0];
+ 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;
}
+ d[N-1] = b[N-1] * xin - a[N-1] * y;
}