summary refs log tree commit diff
path: root/pkgs/development/octave-modules
diff options
context:
space:
mode:
authorKarl Hallsby <karl@hallsby.com>2021-01-06 00:58:32 -0600
committerDoron Behar <doron.behar@gmail.com>2021-02-24 21:00:50 +0200
commitbc8d72e32f70b73a4f068c98e380167904a7808b (patch)
tree5bc528c85d17f3f1eca414e8a29d4d6589740f03 /pkgs/development/octave-modules
parent0b7b03d62cf013f8ebb0c134f9d992f28640dd24 (diff)
downloadnixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.tar
nixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.tar.gz
nixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.tar.bz2
nixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.tar.lz
nixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.tar.xz
nixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.tar.zst
nixpkgs-bc8d72e32f70b73a4f068c98e380167904a7808b.zip
octave.pkgs.ltfat: init at 2.3.1
Diffstat (limited to 'pkgs/development/octave-modules')
-rw-r--r--pkgs/development/octave-modules/ltfat/default.nix54
-rw-r--r--pkgs/development/octave-modules/ltfat/syntax-error.patch15
2 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/development/octave-modules/ltfat/default.nix b/pkgs/development/octave-modules/ltfat/default.nix
new file mode 100644
index 00000000000..505670f6298
--- /dev/null
+++ b/pkgs/development/octave-modules/ltfat/default.nix
@@ -0,0 +1,54 @@
+{ buildOctavePackage
+, lib
+, fetchurl
+, fftw
+, fftwSinglePrec
+, fftwFloat
+, fftwLongDouble
+, lapack
+, blas
+, portaudio
+, jdk
+}:
+
+buildOctavePackage rec {
+  pname = "ltfat";
+  version = "2.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/octave/${pname}-${version}.tar.gz";
+    sha256 = "0gghh5a4w649ff776wvidfvqas87m0n7rqs960pid1d11bnyqqrh";
+  };
+
+  patches = [
+    # Fixes a syntax error with performing multiplication.
+    ./syntax-error.patch
+  ];
+
+  buildInputs = [
+    fftw
+    fftwSinglePrec
+    fftwFloat
+    fftwLongDouble
+    lapack
+    blas
+    portaudio
+    jdk
+  ];
+
+  meta = with lib; {
+    name = "The Large Time-Frequency Analysis Toolbox";
+    homepage = "https://octave.sourceforge.io/ltfat/index.html";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ KarlJoad ];
+    description = "Toolbox for working with time-frequency analysis, wavelets and signal processing";
+    longDescription = ''
+      The Large Time/Frequency Analysis Toolbox (LTFAT) is a Matlab/Octave
+      toolbox for working with time-frequency analysis, wavelets and signal
+      processing. It is intended both as an educational and a computational
+      tool. The toolbox provides a large number of linear transforms including
+      Gabor and wavelet transforms along with routines for constructing windows
+      (filter prototypes) and routines for manipulating coefficients.
+    '';
+  };
+}
diff --git a/pkgs/development/octave-modules/ltfat/syntax-error.patch b/pkgs/development/octave-modules/ltfat/syntax-error.patch
new file mode 100644
index 00000000000..732030b7043
--- /dev/null
+++ b/pkgs/development/octave-modules/ltfat/syntax-error.patch
@@ -0,0 +1,15 @@
+diff --git a/inst/nonstatgab/nsdgt.m b/inst/nonstatgab/nsdgt.m
+index ac53963..81656cb 100644
+--- a/inst/nonstatgab/nsdgt.m
++++ b/inst/nonstatgab/nsdgt.m
+@@ -149,8 +149,8 @@ for ii = 1:N
+         col = ceil(Lg/M(ii));
+         
+         temp = zeros(col*M(ii),W,assert_classname(f,g{1}));
+-        temp([end-floor(Lg/2)+1:end,1:ceil(Lg/2)],:) = bsxfun(@ ...
+-                                                          times,f(win_range,:),g{ii}(idx));
++        temp([end-floor(Lg/2)+1:end,1:ceil(Lg/2)],:) = bsxfun(@times, ...
++                                                          f(win_range,:),g{ii}(idx));
+         
+         temp = reshape(temp,M(ii),col,W);
+         X = squeeze(fft(sum(temp,2)));