Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (86 sloc) 4.39 KB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Filename: twelvebfltr.m
%%
%% Project: DSP Filtering Example Project
%%
%% Purpose: To bring our filter taps into Octave for examination
%%
%% Creator: Dan Gisselquist, Ph.D.
%% Gisselquist Technology, LLC
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Copyright (C) 2017, Gisselquist Technology, LLC
%%
%% This program is free software (firmware): you can redistribute it and/or
%% modify it under the terms of the GNU General Public License as published
%% by the Free Software Foundation, either version 3 of the License, or (at
%% your option) any later version.
%%
%% This program is distributed in the hope that it will be useful, but WITHOUT
%% ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
%% for more details.
%%
%% You should have received a copy of the GNU General Public License along
%% with this program. (It's in the $(ROOT)/doc directory. Run make with no
%% target there if the PDF file isn't present.) If not, see
%% <http://www.gnu.org/licenses/> for a copy.
%%
%% License: GPL, v3, as defined and found on www.gnu.org,
%% http://www.gnu.org/licenses/gpl.html
%%
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%
design = [ ...
-4.565423e-05, 0.000000e+00, 5.807274e-05, 0.000000e+00, ...
-9.387644e-05, 0.000000e+00, 1.431971e-04, 0.000000e+00, ...
-2.092803e-04, 0.000000e+00, 2.958316e-04, 0.000000e+00, ...
-4.070250e-04, 0.000000e+00, 5.475428e-04, 0.000000e+00, ...
-7.225928e-04, 0.000000e+00, 9.379540e-04, 0.000000e+00, ...
-1.200030e-03, 0.000000e+00, 1.515914e-03, 0.000000e+00, ...
-1.893517e-03, 0.000000e+00, 2.341714e-03, 0.000000e+00, ...
-2.870587e-03, 0.000000e+00, 3.491778e-03, 0.000000e+00, ...
-4.218988e-03, 0.000000e+00, 5.068737e-03, 0.000000e+00, ...
-6.061476e-03, 0.000000e+00, 7.223278e-03, 0.000000e+00, ...
-8.588452e-03, 0.000000e+00, 1.020368e-02, 0.000000e+00, ...
-1.213477e-02, 0.000000e+00, 1.447830e-02, 0.000000e+00, ...
-1.738249e-02, 0.000000e+00, 2.108737e-02, 0.000000e+00, ...
-2.600886e-02, 0.000000e+00, 3.293482e-02, 0.000000e+00, ...
-4.355716e-02, 0.000000e+00, 6.228094e-02, 0.000000e+00, ...
-1.052696e-01, 0.000000e+00, 3.180311e-01, 5.000000e-01, ...
3.180311e-01, 0.000000e+00, -1.052696e-01, 0.000000e+00, ...
6.228094e-02, 0.000000e+00, -4.355716e-02, 0.000000e+00, ...
3.293482e-02, 0.000000e+00, -2.600886e-02, 0.000000e+00, ...
2.108737e-02, 0.000000e+00, -1.738249e-02, 0.000000e+00, ...
1.447830e-02, 0.000000e+00, -1.213477e-02, 0.000000e+00, ...
1.020368e-02, 0.000000e+00, -8.588452e-03, 0.000000e+00, ...
7.223278e-03, 0.000000e+00, -6.061476e-03, 0.000000e+00, ...
5.068737e-03, 0.000000e+00, -4.218988e-03, 0.000000e+00, ...
3.491778e-03, 0.000000e+00, -2.870587e-03, 0.000000e+00, ...
2.341714e-03, 0.000000e+00, -1.893517e-03, 0.000000e+00, ...
1.515914e-03, 0.000000e+00, -1.200030e-03, 0.000000e+00, ...
9.379540e-04, 0.000000e+00, -7.225928e-04, 0.000000e+00, ...
5.475428e-04, 0.000000e+00, -4.070250e-04, 0.000000e+00, ...
2.958316e-04, 0.000000e+00, -2.092803e-04, 0.000000e+00, ...
1.431971e-04, 0.000000e+00, -9.387644e-05, 0.000000e+00, ...
5.807274e-05, 0.000000e+00, -4.565423e-05 ];
quantized = [ ...
1, 0, -1, 0, 2, 0, -2, 0, ...
3, 0, -4, 0, 6, 0, -7, 0, ...
9, 0, -11, 0, 14, 0, -17, 0, ...
20, 0, -24, 0, 29, 0, -35, 0, ...
41, 0, -49, 0, 59, 0, -71, 0, ...
86, 0, -106, 0, 134, 0, -178, 0, ...
254, 0, -430, 0, 1302, 2047, 1302, 0, ...
-430, 0, 254, 0, -178, 0, 134, 0, ...
-106, 0, 86, 0, -71, 0, 59, 0, ...
-49, 0, 41, 0, -35, 0, 29, 0, ...
-24, 0, 20, 0, -17, 0, 14, 0, ...
-11, 0, 9, 0, -7, 0, 6, 0, ...
-4, 0, 3, 0, -2, 0, 2, 0, ...
-1, 0, 1
];