| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/scipy/signal/tests/__pycache__/ |
Upload File : |
�
d�c�0 � � � d dl Z d dlZd dlmZmZmZmZmZ d dl m
Z
d dlmZm
Z
d dlmZ d� Zd� Zd� Zd � Zd
� Zd� Zd� Zd
� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z dS )� N)�assert_allclose�assert_equal�assert_almost_equal�assert_array_equal�assert_array_almost_equal)�
convolve1d)�
savgol_coeffs�
savgol_filter)�_polyderc �F � t | |� � }t ||� � d S )N)r r )�p�m�expected�dps �H/usr/lib/python3/dist-packages/scipy/signal/tests/test_savitzky_golay.py�
check_polyderr
s% � � �!�Q���B��r�8�$�$�$�$�$� c
�f � dgddgfdgddgfg d�dg d�fg d�dddgfg d�ddgfg d�ddgfg d�g d�gdg d�g d�gfg d�g d�gdddgd dggfg d�g d�gddgd ggfg d�g d�gddgdggfg
} | D ]E\ }}}t t j |� � j |t j |� � j � � �Fd S )
N� r � )� � r � r r )r r � �
)r �np�array�T)�casesr
r r s r �test_polyderr s: � �
��a�!��
�
��a�!��
� ���A�y�y�y�!� ���A��1�v�� ���A��s�� ���A��s��
�)�)�Y�Y�Y� ��Y�Y�Y� � � �$:�;�
�)�)�Y�Y�Y� ��a��V�b�!�W�$5�6�
�)�)�Y�Y�Y� ��a�S�2�$�K�0�
�)�)�Y�Y�Y� ��a�S�1�#�J�/�
�E� � >� >���1�h��b�h�q�k�k�m�Q����(:�(:�(<�=�=�=�=�>� >r c �� � |�| dz }t j | � � }||k � t � � }t j t j |||� � |� � }|S )z�This is an alternative implementation of the SG coefficients.
It uses numpy.polyfit and numpy.polyval. The results should be
equivalent to those of savgol_coeffs(), but this implementation
is slower.
window_length should be odd.
Nr )r �arange�astype�int�polyval�polyfit)�
window_length� polyorder�pos�t�unit�hs r �
alt_sg_coeffsr- '