+
    LV-j(  ã                   óh   € ^ RI t^ RIHt ^RIHtHtHt RR.t. ROt	R t
R t ! R R	4      tRR
 ltR# )é    N)Úarray_namespace)Ú_output_lenÚ_applyÚ	mode_enumÚupfirdnr   c                ó  € \        V 4      \        V 4      ) V,          ,           p\        P                  ! W P                  4      pWR\        V 4      % VP	                  RV4      P
                  RRRR13,          P                  4       pV# )a˜  Store coefficients in a transposed, flipped arrangement.

For example, suppose upRate is 3, and the
input number of coefficients is 10, represented as h[0], ..., h[9].

Then the internal buffer will look like this::

   h[9], h[6], h[3], h[0],   // flipped phase 0 coefs
   0,    h[7], h[4], h[1],   // flipped phase 1 coefs (zero-padded)
   0,    h[8], h[5], h[2],   // flipped phase 2 coefs (zero-padded)

N:NNNéÿÿÿÿ)ÚlenÚnpÚzerosÚdtypeÚreshapeÚTÚravel)ÚhÚupÚh_padlenÚh_fulls   &&  Úf/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/scipy/signal/_upfirdn.pyÚ_pad_hr   /   sl   € ô �1‹vœ#˜a›&˜ 2�Õ&€HÜ�XŠX�h§¡Ó(€FØˆ7ŒC�‹F€OØ�^‰^˜B Ó#×%Ñ% a©¨2¨ gÕ.×4Ñ4Ó6€FØ€Mó    c                 ó<   € V P                  4       p \        V 4      pV# )N)Úlowerr   )ÚmodeÚenums   & r   Ú_check_moder   C   s   € Ø�:‰:‹<€DÜ�T‹?€DØ€Kr   c                   ó4   a € ] tR t^It o RtR tRR ltRtV tR# )Ú_UpFIRDnzHelper for resampling.c                ón  € \         P                  ! V4      pVP                  ^8w  g   VP                  ^ 8X  d   \	        R4      h\         P
                  ! VP                  V\         P                  4      V n        \         P                  ! WP                  4      p\        V4      V n
        \        V4      V n        V P                  ^8  g   V P                  ^8  d   \	        R4      h\        WP                  4      V n        \         P                  ! V P                  4      V n        \        V4      V n        R# )é   z"h must be 1-D with non-zero lengthzBoth up and down must be >= 1N)r   ÚasarrayÚndimÚsizeÚ
ValueErrorÚresult_typer   Úfloat32Ú_output_typeÚintÚ_upÚ_downr   Ú_h_trans_flipÚascontiguousarrayr
   Ú_h_len_orig)Úselfr   Úx_dtyper   Údowns   &&&&&r   Ú__init__Ú_UpFIRDn.__init__L   sÎ   € Ü�JŠJ�q‹MˆØ�6‰6�QŒ;˜!Ÿ&™& Aœ+ÜÐAÓBÐBÜŸNšN¨1¯7©7°G¼R¿Z¹ZÓHˆÔÜ�JŠJ�q×+Ñ+Ó,ˆÜ�r“7ˆŒÜ˜“YˆŒ
Ø�8‰8�aŒ<˜4Ÿ:™:¨œ>ÜÐ<Ó=Ð=ä# A§x¡xÓ0ˆÔÜ×1Ò1°$×2DÑ2DÓEˆÔÜ˜q›6ˆÖr   c           
     ó   € \        V P                  VP                  V,          V P                  V P                  4      p\
        P                  ! VP                  \
        P                  R7      pWVV&   \
        P                  ! W`P                  RR7      pW!P                  ,          p\        V4      p\        \
        P                  ! WP                  4      V P                  VV P                  V P                  W#V4       V# )z@Apply the prepared filter to the specified axis of N-D signal x.)r   ÚC)r   Úorder)r   r-   Úshaper)   r*   r   r!   Úint64r   r'   r"   r   r   r+   )r.   ÚxÚaxisr   ÚcvalÚ
output_lenÚoutput_shapeÚouts   &&&&&   r   Úapply_filterÚ_UpFIRDn.apply_filter[   s´   € ä  ×!1Ñ!1°1·7±7¸4µ=Ø!%§¡¨4¯:©:ó7ˆ
ô —z’z !§'¡'´·±Ô:ˆØ'�TÑÜ�hŠh�|×+<Ñ+<ÀCÔHˆØ—f‘f�}ˆÜ˜4Ó ˆÜŒr�zŠz˜!×.Ñ.Ó/Ø×!Ñ! 3Ø�x‰x˜Ÿ™ T°ô	7ð ˆ
r   )r*   r-   r+   r'   r)   N)r	   Úconstantr   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r1   r>   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r   r   r   I   s   ø‡ € Ù ò"÷ò r   r   c                ó²   € \        W4      p\        P                  ! V4      p\        WP                  W#4      pVP                  VP                  WWV4      4      # )aG  Upsample, FIR filter, and downsample.

Parameters
----------
h : array_like
    1-D FIR (finite-impulse response) filter coefficients.
x : array_like
    Input signal array.
up : int, optional
    Upsampling rate. Default is 1.
down : int, optional
    Downsampling rate. Default is 1.
axis : int, optional
    The axis of the input data array along which to apply the
    linear filter. The filter is applied to each subarray along
    this axis. Default is -1.
mode : str, optional
    The signal extension mode to use. The set
    ``{"constant", "symmetric", "reflect", "edge", "wrap"}`` correspond to
    modes provided by `numpy.pad`. ``"smooth"`` implements a smooth
    extension by extending based on the slope of the last 2 points at each
    end of the array. ``"antireflect"`` and ``"antisymmetric"`` are
    anti-symmetric versions of ``"reflect"`` and ``"symmetric"``. The mode
    `"line"` extends the signal based on a linear trend defined by the
    first and last points along the ``axis``.

    .. versionadded:: 1.4.0
cval : float, optional
    The constant value to use when ``mode == "constant"``.

    .. versionadded:: 1.4.0

Returns
-------
y : ndarray
    The output signal array. Dimensions will be the same as `x` except
    for along `axis`, which will change size according to the `h`,
    `up`,  and `down` parameters.

Notes
-----
The algorithm is an implementation of the block diagram shown on page 129
of the Vaidyanathan text [1]_ (Figure 4.3-8d).

The direct approach of upsampling by factor of P with zero insertion,
FIR filtering of length ``N``, and downsampling by factor of Q is
O(N*Q) per output sample. The polyphase implementation used here is
O(N/P).

.. versionadded:: 0.18

References
----------
.. [1] P. P. Vaidyanathan, Multirate Systems and Filter Banks,
       Prentice Hall, 1993.

Examples
--------
Simple operations:

>>> import numpy as np
>>> from scipy.signal import upfirdn
>>> upfirdn([1, 1, 1], [1, 1, 1])   # FIR filter
array([ 1.,  2.,  3.,  2.,  1.])
>>> upfirdn([1], [1, 2, 3], 3)  # upsampling with zeros insertion
array([ 1.,  0.,  0.,  2.,  0.,  0.,  3.])
>>> upfirdn([1, 1, 1], [1, 2, 3], 3)  # upsampling with sample-and-hold
array([ 1.,  1.,  1.,  2.,  2.,  2.,  3.,  3.,  3.])
>>> upfirdn([.5, 1, .5], [1, 1, 1], 2)  # linear interpolation
array([ 0.5,  1. ,  1. ,  1. ,  1. ,  1. ,  0.5])
>>> upfirdn([1], np.arange(10), 1, 3)  # decimation by 3
array([ 0.,  3.,  6.,  9.])
>>> upfirdn([.5, 1, .5], np.arange(10), 2, 3)  # linear interp, rate 2/3
array([ 0. ,  1. ,  2.5,  4. ,  5.5,  7. ,  8.5])

Apply a single filter to multiple signals:

>>> x = np.reshape(np.arange(8), (4, 2))
>>> x
array([[0, 1],
       [2, 3],
       [4, 5],
       [6, 7]])

Apply along the last dimension of ``x``:

>>> h = [1, 1]
>>> upfirdn(h, x, 2)
array([[ 0.,  0.,  1.,  1.],
       [ 2.,  2.,  3.,  3.],
       [ 4.,  4.,  5.,  5.],
       [ 6.,  6.,  7.,  7.]])

Apply along the 0th dimension of ``x``:

>>> upfirdn(h, x, 2, axis=0)
array([[ 0.,  1.],
       [ 0.,  1.],
       [ 2.,  3.],
       [ 2.,  3.],
       [ 4.,  5.],
       [ 4.,  5.],
       [ 6.,  7.],
       [ 6.,  7.]])
)r   r   r!   r   r   r>   )	r   r8   r   r0   r9   r   r:   ÚxpÚufds	   &&&&&&&  r   r   r   l   sH   € ôT 
˜Ó	€Bä
�
Š
�1‹€AÜ
�1—g‘g˜rÓ
(€Cà�:‰:�c×&Ñ& q°Ó;Ó<Ð<r   )	r@   ÚwrapÚedgeÚsmoothÚ	symmetricÚreflectÚantisymmetricÚantireflectÚline)r    r    r	   r@   r   )Únumpyr   Úscipy._lib._array_apir   Ú_upfirdn_applyr   r   r   Ú__all__Ú_upfirdn_modesr   r   r   r   © r   r   Ú<module>rZ      s@   ðóD å 1ß :Ñ :à�mÐ
$€ò€òò(÷ ñ  öFo=r   