From 1c7ecd1b22a9bb7377c9a4db8214f28493b8ba05 Mon Sep 17 00:00:00 2001 From: ymherklotz Date: Tue, 27 Feb 2018 12:00:18 +0000 Subject: Adding working --- lab5/RTDSP/.launches/RTDSP.launch | 2 +- lab5/RTDSP/intio.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'lab5/RTDSP') diff --git a/lab5/RTDSP/.launches/RTDSP.launch b/lab5/RTDSP/.launches/RTDSP.launch index 086e65e..d970f38 100644 --- a/lab5/RTDSP/.launches/RTDSP.launch +++ b/lab5/RTDSP/.launches/RTDSP.launch @@ -13,7 +13,7 @@ - + diff --git a/lab5/RTDSP/intio.c b/lab5/RTDSP/intio.c index 2c47420..567324c 100644 --- a/lab5/RTDSP/intio.c +++ b/lab5/RTDSP/intio.c @@ -133,20 +133,23 @@ void init_HWI() void ISR_AIC() { int i = N-1; - - y[0] = 0.0; //Shift the values for (; i > 0; --i) { x[i] = x[i-1]; y[i] = y[i-1]; - - y[0] += b[i] * x[i] - a[i] * y[i]; } x[0] = mono_read_16Bit(); - - y[0] += b[0] * x[0]; + + y[0] = 0.0; + + for (i = 0; i < N; ++i) { + y[0] += x[i] * b[i]; + if(i != 0) { + y[0] -= y[i] * a[i]; + } + } mono_write_16Bit((short)y[0]); } -- cgit