diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-08-24 22:18:19 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-08-26 18:11:04 +0200 |
commit | 1c5711e867c96f5f61615d440857af7d27e15de4 (patch) | |
tree | 53fcd8d289365fd7575826d14d8c41ff7b8c943e | |
parent | 0243caf40dbe40596b7fd0198bdfc47c36f7c048 (diff) |
Removed unused, obsolete and special-purpose octave files
none of the functions defined in these files are used outside of this
directory.
The color palette generators have long been upstreamed in octave.
The rest is extremely specific and partially trivial code (runsum,
really?).
-rw-r--r-- | gr-utils/octave/cool.m | 50 | ||||
-rw-r--r-- | gr-utils/octave/db_width.m | 35 | ||||
-rw-r--r-- | gr-utils/octave/filter_tools.m | 42 | ||||
-rw-r--r-- | gr-utils/octave/is_complex.m | 24 | ||||
-rw-r--r-- | gr-utils/octave/lp_to_bp.m | 27 | ||||
-rw-r--r-- | gr-utils/octave/plotfft.m | 40 | ||||
-rw-r--r-- | gr-utils/octave/plotfftavgk.m | 61 | ||||
-rw-r--r-- | gr-utils/octave/plotfftavgk_db.m | 73 | ||||
-rw-r--r-- | gr-utils/octave/plotfftk.m | 41 | ||||
-rw-r--r-- | gr-utils/octave/plotfftk_db.m | 43 | ||||
-rw-r--r-- | gr-utils/octave/put_markers.m | 32 | ||||
-rw-r--r-- | gr-utils/octave/rainbow.m | 53 | ||||
-rw-r--r-- | gr-utils/octave/read_xambi.m | 46 | ||||
-rw-r--r-- | gr-utils/octave/runsum.m | 9 |
14 files changed, 0 insertions, 576 deletions
diff --git a/gr-utils/octave/cool.m b/gr-utils/octave/cool.m deleted file mode 100644 index f8b8a5cea6..0000000000 --- a/gr-utils/octave/cool.m +++ /dev/null @@ -1,50 +0,0 @@ -%% Copyright (C) 1999,2000 Kai Habel -%% -%% This program is free software; 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 -%% MERCHANTABILITY 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; if not, write to the Free Software -%% Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - -%% -*- texinfo -*- -%% @deftypefn {Function File} {} cool (@var{n}) -%% Create color colormap. -%% (cyan to magenta) -%% The argument @var{n} should be a scalar. If it -%% is omitted, the length of the current colormap or 64 is assumed. -%% @end deftypefn -%% @seealso{colormap} - -%% Author: Kai Habel <kai.habel@gmx.de> - -function map = cool (number) - - if (nargin == 0) - number = rows (colormap); - elseif (nargin == 1) - if (! is_scalar (number)) - error ("cool: argument must be a scalar"); - end - else - usage ("cool (number)"); - end - - if (number == 1) - map = [0, 1, 1]; - elseif (number > 1) - r = (0:number - 1)' ./ (number - 1); - g = 1 - r; - b = ones (number, 1); - map = [r, g, b]; - else - map = []; - end - diff --git a/gr-utils/octave/db_width.m b/gr-utils/octave/db_width.m deleted file mode 100644 index e9c64cc795..0000000000 --- a/gr-utils/octave/db_width.m +++ /dev/null @@ -1,35 +0,0 @@ -% -% Copyright 2001 Free Software Foundation, Inc. -% -% This file is part of GNU Radio -% -% GNU Radio is free software; 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, or (at your option) -% any later version. -% -% GNU Radio is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -% the Free Software Foundation, Inc., 51 Franklin Street, -% Boston, MA 02110-1301, USA. - -%% find the N-dB width of the given filter -%% E.g., to find the 3-dB width, use width = db_width (taps, -3.0) -%% the result is normalized to nyquist == 1 - -function width = db_width (taps, db) - [H,w] = freqz (taps, 1, 4096); - Habs = abs(H); - max_H = max(Habs); - min_H = min(Habs); - threshold = max_H * 10^(db/20); - if (min_H > threshold) - error ("The %g dB point is never reached", db); - end - above = Habs >= threshold; - width = sum(above) / length (above); diff --git a/gr-utils/octave/filter_tools.m b/gr-utils/octave/filter_tools.m deleted file mode 100644 index 552791e334..0000000000 --- a/gr-utils/octave/filter_tools.m +++ /dev/null @@ -1,42 +0,0 @@ -% -% Copyright 2001 Free Software Foundation, Inc. -% -% This file is part of GNU Radio -% -% GNU Radio is free software; 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, or (at your option) -% any later version. -% -% GNU Radio is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -% the Free Software Foundation, Inc., 51 Franklin Street, -% Boston, MA 02110-1301, USA. -% -%% equivalent to the C++ code in VrComplexFIRfilter::buildFilterComplex - -1; - -%% hamming window, nothing fancy - -function taps = build_filter_complex_lp (gain, ntaps) - - taps = gain * (0.54 - 0.46 * cos (2 * pi * (0:ntaps-1)' / (ntaps-1))); - -end - -%% old_taps describes a low pass filter, convert it to bandpass -%% centered at center_freq. center_freq is normalized to Fs (sampling freq) - -function new_taps = freq_shift_filter (old_taps, center_freq) - - ntaps = length(old_taps); - - new_taps = exp (j*2*pi*center_freq*(0:ntaps-1)') .* old_taps; - -end diff --git a/gr-utils/octave/is_complex.m b/gr-utils/octave/is_complex.m deleted file mode 100644 index 4700467b15..0000000000 --- a/gr-utils/octave/is_complex.m +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright 2004 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function p = is_complex (x) - p = any (imag (x) != 0); -endfunction; diff --git a/gr-utils/octave/lp_to_bp.m b/gr-utils/octave/lp_to_bp.m deleted file mode 100644 index 4e73f6cc73..0000000000 --- a/gr-utils/octave/lp_to_bp.m +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright 2002 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -## transform low pass coefficients into bandpass coefficients - -function bp_taps = lp_to_bp (lp_taps, center_freq, sampling_freq) - arg = 2 * pi * center_freq / sampling_freq; - bp_taps = lp_taps .* exp (j*arg*(0:length(lp_taps)-1)'); -endfunction diff --git a/gr-utils/octave/plotfft.m b/gr-utils/octave/plotfft.m deleted file mode 100644 index 20a2efd4c2..0000000000 --- a/gr-utils/octave/plotfft.m +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright 2001 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function plotfft (data, sample_rate) - - if (nargin == 1) - sample_rate = 1.0; - endif; - - if ((m = nargchk (1,2,nargin))) - usage (m); - endif; - - len = length(data); - s = fft (data.*kaiser(len, 5)); - - incr = sample_rate/len; - min_x = -sample_rate/2; - max_x = sample_rate/2 - incr; - plot (min_x:incr:max_x, abs(fftshift(s))); - -endfunction diff --git a/gr-utils/octave/plotfftavgk.m b/gr-utils/octave/plotfftavgk.m deleted file mode 100644 index c82c540f39..0000000000 --- a/gr-utils/octave/plotfftavgk.m +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright 2002 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function plotfftavgk_db (all_data, k, sample_rate) - - if (nargin == 2) - sample_rate = 1.0; - endif; - - if ((m = nargchk (2,3,nargin))) - usage (m); - endif; - - ## len = 1024; - len = 8192; - ##window = ones (len, 1); - window = kaiser (len, 5); - - s = zeros (len,1); - - count = min (100, floor (length (all_data)/len)); - - for i = 0:count-1; - data = all_data((k+i)*len + 1 : (k+i+1)*len); - s = s + abs (fft (data.*window)); - endfor; - - s = s ./ count; - - incr = sample_rate/len; - min_x = -sample_rate/2; - max_x = sample_rate/2 - incr; - - x = min_x:incr:max_x; - ## y = 20 * log10(fftshift(s)); - y = (fftshift(s)); - plot (x, y); - - i = find (y == max(y)) - x(i) - y(i) - -endfunction diff --git a/gr-utils/octave/plotfftavgk_db.m b/gr-utils/octave/plotfftavgk_db.m deleted file mode 100644 index 73cee140d0..0000000000 --- a/gr-utils/octave/plotfftavgk_db.m +++ /dev/null @@ -1,73 +0,0 @@ -# -# Copyright 2001 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function plotfftavgk_db (all_data, k, sample_rate) - - if (nargin == 2) - sample_rate = 1.0; - endif; - - if ((m = nargchk (2,3,nargin))) - usage (m); - endif; - - len = 1024; - ## len = 8192; - ##window = ones (len, 1); - #window = kaiser (len, 5); - window = hanning (len); - - s = zeros (len,1); - - count = min (100, floor (length (all_data)/len)); - - for i = 0:count-1; - data = all_data((k+i)*len + 1 : (k+i+1)*len); - s = s + abs (fft (data.*window)); - endfor; - - s = s ./ count; - - incr = sample_rate/len; - - if is_complex (all_data); - min_x = -sample_rate/2; - max_x = sample_rate/2 - incr; - - x = min_x:incr:max_x; - y = 20 * log10(fftshift(s)); - plot (x, y); - else - min_x = 0 - max_x = sample_rate/2 - incr; - - x = min_x:incr:max_x; - y = 20 * log10(s(1:len/2)); - plot (x, y); - - endif; - - - i = find (y == max(y)) - x(i) - y(i) - -endfunction diff --git a/gr-utils/octave/plotfftk.m b/gr-utils/octave/plotfftk.m deleted file mode 100644 index df2bf3aca0..0000000000 --- a/gr-utils/octave/plotfftk.m +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright 2001 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function plotfftk (all_data, k, sample_rate) - - if (nargin == 2) - sample_rate = 1.0; - endif; - - if ((m = nargchk (2,3,nargin))) - usage (m); - endif; - - len = 1024; - data = all_data(k*len + 1 : (k+1)*len); - s = fft (data.*kaiser(len, 5)); - - incr = sample_rate/len; - min_x = -sample_rate/2; - max_x = sample_rate/2 - incr; - plot (min_x:incr:max_x, abs(fftshift(s))); - -endfunction diff --git a/gr-utils/octave/plotfftk_db.m b/gr-utils/octave/plotfftk_db.m deleted file mode 100644 index b2c85412f7..0000000000 --- a/gr-utils/octave/plotfftk_db.m +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright 2001 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function plotfftk_db (all_data, k, sample_rate) - - if (nargin == 2) - sample_rate = 1.0; - endif; - - if ((m = nargchk (2,3,nargin))) - usage (m); - endif; - - len = 1024; - data = all_data(k*len + 1 : (k+1)*len); - ## s = fft (data.*kaiser(len, 5)); - ## s = fft (data.*hamming(len)); - s = fft (data.*hanning(len)); - - incr = sample_rate/len; - min_x = -sample_rate/2; - max_x = sample_rate/2 - incr; - plot (min_x:incr:max_x, 20 * log10(abs(fftshift(s)))); - -endfunction diff --git a/gr-utils/octave/put_markers.m b/gr-utils/octave/put_markers.m deleted file mode 100644 index 1244d31aaf..0000000000 --- a/gr-utils/octave/put_markers.m +++ /dev/null @@ -1,32 +0,0 @@ -# -# Copyright 2002 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function put_markers (y) - - if (nargin == 0) - y = 25; - endif; - - hold on; - plot (3.06e6, y, '@'); - plot (8.44e6, y, '@'); - -endfunction diff --git a/gr-utils/octave/rainbow.m b/gr-utils/octave/rainbow.m deleted file mode 100644 index 35fab19b89..0000000000 --- a/gr-utils/octave/rainbow.m +++ /dev/null @@ -1,53 +0,0 @@ -## Copyright (C) 1999,2000 Kai Habel -## -## This program is free software; 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 -## MERCHANTABILITY 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; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA - -## -*- texinfo -*- -## @deftypefn {Function File} {} rainbow (@var{n}) -## Create color colormap. -## (red through yellow, green, cyan,blue,magenta to red) -## The argument @var{n} should be a scalar. If it -## is omitted, the length of the current colormap or 64 is assumed. -## @end deftypefn -## @seealso{colormap} - -## Author: Kai Habel <kai.habel@gmx.de> - -## 2001-09-13 Paul Kienzle <pkienzle@users.sf.net> -## * renamed to rainbow for use with tk_octave -## * remove reference to __current_color_map__ - -function map = rainbow (number) - - if (nargin == 0) - number = length(colormap); - elseif (nargin == 1) - if (! is_scalar (number)) - error ("rainbow: argument must be a scalar"); - endif - else - usage ("rainbow (number)"); - endif - - if (number == 1) - map = [1, 0, 0]; - elseif (number > 1) - h = linspace (0, 1, number)'; - map = hsv2rgb ([h, ones(number, 1), ones(number, 1)]); - else - map = []; - endif - -endfunction diff --git a/gr-utils/octave/read_xambi.m b/gr-utils/octave/read_xambi.m deleted file mode 100644 index 5adb94264e..0000000000 --- a/gr-utils/octave/read_xambi.m +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright 2001,2005 Free Software Foundation, Inc. -# -# This file is part of GNU Radio -# -# GNU Radio is free software; 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, or (at your option) -# any later version. -# -# GNU Radio is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -function v = read_xambi (filename) - - ## usage: read_xambi (filename) - ## - ## read binary cross-ambiguity data from radar tools. - ## The file has an 8 float header, the first word of which specifies - ## the number of doppler bins. - ## returns a matrix - - if ((m = nargchk (1,1,nargin))) - usage (m); - endif; - - f = fopen (filename, "rb"); - if (f < 0) - v = 0; - else - header = fread(f, 8, "float"); - ndoppler_bins = header(1) - min_doppler = header(2) - max_doppler = header(3) - v = fread (f, [ndoppler_bins, Inf], "float"); - fclose (f); - endif; -endfunction; diff --git a/gr-utils/octave/runsum.m b/gr-utils/octave/runsum.m deleted file mode 100644 index 0f530b0159..0000000000 --- a/gr-utils/octave/runsum.m +++ /dev/null @@ -1,9 +0,0 @@ -function r = runsum(x) - len = length(x); - r = zeros (1, len); - r(1) = x(1); - for i = 2:len; - r(i) = r(i-1) + x(i); - endfor; -endfunction; - |