From 1e04f2cde4b36d9af7988dcedb317de32938dc32 Mon Sep 17 00:00:00 2001 From: ymherklotz Date: Wed, 28 Feb 2018 13:19:47 +0000 Subject: Adding new matlab --- lab5/RTDSP/.launches/RTDSP.launch | 2 +- lab5/RTDSP/Matlab/coeff.txt | 4 ++-- lab5/RTDSP/Matlab/elliptical.m | 3 +-- lab5/RTDSP/Matlab/gen_filter.m | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lab5/RTDSP/.launches/RTDSP.launch b/lab5/RTDSP/.launches/RTDSP.launch index 7b78715..bcd1937 100644 --- a/lab5/RTDSP/.launches/RTDSP.launch +++ b/lab5/RTDSP/.launches/RTDSP.launch @@ -13,7 +13,7 @@ - + diff --git a/lab5/RTDSP/Matlab/coeff.txt b/lab5/RTDSP/Matlab/coeff.txt index 1b9f5ae..50b2b2b 100644 --- a/lab5/RTDSP/Matlab/coeff.txt +++ b/lab5/RTDSP/Matlab/coeff.txt @@ -1,2 +1,2 @@ -double a[] = {0.0, -3.622738280081862e+00, 5.063887790131743e+00, -3.234610259864946e+00, 7.984164681552797e-01, }; -double b[] = {9.756494393306392e-02, -3.428674269973439e-01, 4.911005379625814e-01, -3.428674269973437e-01, 9.756494393306386e-02, }; +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, }; diff --git a/lab5/RTDSP/Matlab/elliptical.m b/lab5/RTDSP/Matlab/elliptical.m index 7b603c7..20a6fa2 100644 --- a/lab5/RTDSP/Matlab/elliptical.m +++ b/lab5/RTDSP/Matlab/elliptical.m @@ -1,6 +1,5 @@ -function [b,a] = elliptical (Fs) +function [b,a] = elliptical (order, Fs) -order = 4; % Order of the bandpass filter startband = 270*2/Fs; % Normalised startband frequency stopband = 450*2/Fs; % Normalised stopband frequency ripple = 0.3; % The passband ripple (in dB) diff --git a/lab5/RTDSP/Matlab/gen_filter.m b/lab5/RTDSP/Matlab/gen_filter.m index 6822bfe..f718912 100644 --- a/lab5/RTDSP/Matlab/gen_filter.m +++ b/lab5/RTDSP/Matlab/gen_filter.m @@ -1,5 +1,5 @@ Fs = 8000; -[b,a] = elliptical (Fs); +[b,a] = elliptical (32, Fs); freqz(b, a); fileID = fopen('coeff.txt','w'); -- cgit