~ubuntu-branches/ubuntu/wily/octave-ltfat/wily-proposed

« back to all changes in this revision

Viewing changes to inst/comp/comp_nyquistfilt.m

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Rafael Laboissiere
  • Date: 2015-07-18 23:36:41 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20150718233641-jhuf3f551a3523qc
Tags: 2.1.0+dfsg-1
* Team upload.

[ Rafael Laboissiere ]
* Imported Upstream version 2.1.0+dfsg
* d/rules: Prevent unit testing on armhf and mips.
  This avoids FTBFS on theses architectures (see Bug#765545).
* Unit testing does not need X-window anymore
  + d/rules: Do not use xfvb-run to run the tests.
  + d/control: Drop xauth, xvfb, and gnuplot-nox from Build-Depends.
    Also, the versioned dependency on octave-pkg-dev is relaxed.
* Drop .jar file from upstream tarball, complying with the Debian Policy
  + d/copyright: Exclude file blockproc.jar
  + d/rules: Add get-orig-source target
  + d/watch: Mangle upstream version to cope with "+dfsg" tag
* Build blockproc.jar, which is deleted from the upstream tarball
  + d/rules: Add commands for building blockproc.jar
  + d/control: Build-depend on default-jdk
  + d/p/fix-path-of-included-makefile.patch: New patch
* Bump Standard-Versions to 3.9.6 (no changes needed)
* d/p/autoload-yes.patch: Remove patch (deprecated upstream)
* Bump Build-Depends on octave to >> 4.0.0~rc4-1 (for sndfile support)
* d/check.m: Avoid verbose output of unit tests
* d/watch: Add the repacksuffix option
* d/p/add-hardening-flags.patch: Drop patch (applied upstream)
* d/p/fix-path-of-included-makefile.patch: Drop patch (applied upstream)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function H = comp_nyquistfilt(wintype,fs,chan_max,freqtoscale,scaletofreq,bwmul,bins,Ls)
 
2
%-*- texinfo -*-
 
3
%@deftypefn {Function} comp_nyquistfilt
 
4
%@verbatim
 
5
%COMP_NYQUISTFILT high-pass filter for warped filter banks
 
6
%@end verbatim
 
7
%@strong{Url}: @url{http://ltfat.github.io/doc/comp/comp_nyquistfilt.html}
 
8
%@end deftypefn
 
9
 
 
10
% Copyright (C) 2005-2015 Peter L. Soendergaard <peter@sonderport.dk>.
 
11
% This file is part of LTFAT version 2.1.0
 
12
%
 
13
% This program is free software: you can redistribute it and/or modify
 
14
% it under the terms of the GNU General Public License as published by
 
15
% the Free Software Foundation, either version 3 of the License, or
 
16
% (at your option) any later version.
 
17
%
 
18
% This program is distributed in the hope that it will be useful,
 
19
% but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
% GNU General Public License for more details.
 
22
%
 
23
% You should have received a copy of the GNU General Public License
 
24
% along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
25
 
 
26
    kk = chan_max;
 
27
    while scaletofreq(kk-bwmul) < fs/2;
 
28
      kk = kk+1/bins;
 
29
    end
 
30
    Maxfilt = kk;
 
31
    
 
32
    Minpos = ceil(Ls/fs*scaletofreq(chan_max+1/bins-bwmul));
 
33
    samples = freqtoscale((Minpos-1:floor(Ls/2))*fs/Ls);
 
34
    
 
35
    FILTS = zeros(round(bins*(Maxfilt-chan_max)),numel(samples));
 
36
    for kk = 1:size(FILTS,1)
 
37
       FILTS(kk,:) = firwin(wintype,(samples-(chan_max+kk/bins))/(2*bwmul));
 
38
    end
 
39
    H = zeros(2*numel(samples)-1,1);
 
40
    H(1:numel(samples)) = sqrt(sum(abs(FILTS.^2),1));
 
41
    H(numel(samples)+1:end) = H(numel(samples)-1:-1:1); 
 
42