Skip to content

shannon_wavelet

Bases: discrete_wavelet

Shannon wavelet implementation.

This wavelet uses sinusoidal functions for its wavelet definition.

Source code in tinybig/koala/signal_processing/wavelet.py
class shannon_wavelet(discrete_wavelet):
    """
    Shannon wavelet implementation.

    This wavelet uses sinusoidal functions for its wavelet definition.
    """
    def __init__(self, name: str = 'shannon_wavelet', *args, **kwargs):
        """
        Initialize the Shannon wavelet.

        Parameters
        ----------
        name : str, optional
            Name of the wavelet. Default is 'shannon_wavelet'.
        *args, **kwargs
            Additional parameters.
        """
        super().__init__(name=name, *args, **kwargs)

    def psi(self, tau: torch.Tensor):
        """
        Define the Shannon wavelet function.

        Parameters
        ----------
        tau : torch.Tensor
            Transformed input values.

        Returns
        -------
        torch.Tensor
            Wavelet values for the input.
        """
        return (torch.sin(2*torch.pi*tau) - torch.sin(torch.pi*tau))/(torch.pi*tau)

__init__(name='shannon_wavelet', *args, **kwargs)

Initialize the Shannon wavelet.

Parameters:

Name Type Description Default
name str

Name of the wavelet. Default is 'shannon_wavelet'.

'shannon_wavelet'
*args

Additional parameters.

()
**kwargs

Additional parameters.

()
Source code in tinybig/koala/signal_processing/wavelet.py
def __init__(self, name: str = 'shannon_wavelet', *args, **kwargs):
    """
    Initialize the Shannon wavelet.

    Parameters
    ----------
    name : str, optional
        Name of the wavelet. Default is 'shannon_wavelet'.
    *args, **kwargs
        Additional parameters.
    """
    super().__init__(name=name, *args, **kwargs)

psi(tau)

Define the Shannon wavelet function.

Parameters:

Name Type Description Default
tau Tensor

Transformed input values.

required

Returns:

Type Description
Tensor

Wavelet values for the input.

Source code in tinybig/koala/signal_processing/wavelet.py
def psi(self, tau: torch.Tensor):
    """
    Define the Shannon wavelet function.

    Parameters
    ----------
    tau : torch.Tensor
        Transformed input values.

    Returns
    -------
    torch.Tensor
        Wavelet values for the input.
    """
    return (torch.sin(2*torch.pi*tau) - torch.sin(torch.pi*tau))/(torch.pi*tau)