Skip to content
Snippets Groups Projects
Select Git revision
  • d0c0d2f2867422d9a3480fa20b658491e3db24eb
  • master default protected
  • ci39
  • ci39-python12
  • py39
  • issue#14
  • endianness
  • bugs_i686
  • bug_test_instfreqplot_arm64
  • bug_test_tfplot
  • gitlab-ci
  • debian
  • v1.1.2
  • v1.1.1
  • v1.0.17
  • v1.0.16
  • v1.0.15
  • v1.0.14
  • v1.0.13
  • v1.0.12
  • v1.0.9
  • v1.0.8
  • v1.0.7
  • v1.0.6
  • v1.0.0
25 results

comp_sigreshape_post.py

Blame
  • comp_sigreshape_post.py 2.34 KiB
    # -*- coding: utf-8 -*-
    # ######### COPYRIGHT #########
    # Credits
    # #######
    #
    # Copyright(c) 2015-2018
    # ----------------------
    #
    # * `LabEx Archimède <http://labex-archimede.univ-amu.fr/>`_
    # * `Laboratoire d'Informatique Fondamentale <http://www.lif.univ-mrs.fr/>`_
    #   (now `Laboratoire d'Informatique et Systèmes <http://www.lis-lab.fr/>`_)
    # * `Institut de Mathématiques de Marseille <http://www.i2m.univ-amu.fr/>`_
    # * `Université d'Aix-Marseille <http://www.univ-amu.fr/>`_
    #
    # This software is a port from LTFAT 2.1.0 :
    # Copyright (C) 2005-2018 Peter L. Soendergaard <peter@sonderport.dk>.
    #
    # Contributors
    # ------------
    #
    # * Denis Arrivault <contact.dev_AT_lis-lab.fr>
    # * Florent Jaillet <contact.dev_AT_lis-lab.fr>
    #
    # Description
    # -----------
    #
    # ltfatpy is a partial Python port of the
    # `Large Time/Frequency Analysis Toolbox <http://ltfat.sourceforge.net/>`_,
    # a MATLAB®/Octave toolbox for working with time-frequency analysis and
    # synthesis.
    #
    # Version
    # -------
    #
    # * ltfatpy version = 1.0.14
    # * LTFAT version = 2.1.0
    #
    # Licence
    # -------
    #
    # 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, see <http://www.gnu.org/licenses/>.
    #
    # ######### COPYRIGHT #########
    
    
    """ Module of comp_sigreshape_post calculation
    
    Ported from ltfat_2.1.0/comp/comp_sigreshape_post.m
    
    .. moduleauthor:: Denis Arrivault
    """
    
    from __future__ import print_function, division
    
    import numpy as np
    
    
    def comp_sigreshape_post(f, fl, wasrow, remembershape):
        """Get original dimensionality
    
        .. warning::
            This function returns **f** or a view of **f** if possible. In those
            cases, any value changed in the returned variable will also be
            changed in **f**.
        """
        fd = len(remembershape)
    
        if fd > 2:
            return f.reshape((fl,) + remembershape[1:fd])
        if wasrow:
            return f[np.newaxis, :]
        return f