S变换matlab实现

news2025/1/14 9:48:52

S变换函数

function [st,t,f] = st(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate) 
% S变换
% Code by huasir @Beijing 2025.1.10
% Reference is "Localization of the Complex Spectrum: The S Transform" 
% from IEEE Transactions on Signal Processing, vol. 44., number 4, April 1996, pages 998-1001. 
%% 函数的输出和输出
% Input  
%   * timeseries:      待进行S变换的信号向量
%   * minfreq:         时频分布结果中的最小频率,对应频率轴的最小值(默认值为0)
%   * maxfreq:         时频分布结果中的最大频率,对应频率轴的最大值(默认值为奈奎斯特频率)
%   * samplingrate:    两个采样点之间的采样时间间隔(默认为1)
%   * freqsamplingrate:频率分辨率(默认为1)
% Output
%   * st:               Stockwell变换的结果,行对应频率,列对应时刻,
%   * t:                包含采样时刻的时间向量
%   * f:                频率向量
%% 以下参数可按需调整
%   * [verbose]:   如果为真,则打印函数运行中所有的提示信息
%   * [removeedge]:如果为真,则删除最小二乘拟合的抛物线,并在时间序列的边缘放置一个5%的hanning锥
%                   通常情况下,这是个不错的选择。
%   * [analytic_signal]: 如果时间序列是实数值,则取它的解析信号并进行S变换
%   * [factor]:          局部化高斯的宽度因子,例如,一个周期为10s的正弦信号具有宽度因子*10s的高斯窗口。
%                         通常使用的因子为1,有些情况下为了得到更好的频率分辨率,可以采用3。
%   *****All frequencies in (cycles/(time unit))!****** 
%   Copyright (c) by huasir
%   $Revision: 1.0 $  $Date: 2025/01/10  $ 
% 这是保存函数默认值的S变换封装器
TRUE = 1; 
FALSE = 0; 
%%% 默认参数  [有特殊需求的情况下进行更改] 
verbose = TRUE;           
removeedge= FALSE; 
analytic_signal =  FALSE; 
factor = 1; 
%%% 默认参数设置结果
%% 开始进行输入变量检查
% 首先确保输入的时间序列是有效值,否则,返回帮助信息 
if verbose disp(' '),end  % i like a line left blank 
 
if nargin == 0  % nargin为输入参数的个数,nargin=0,表示无输入
   if verbose disp('No parameters inputted.'),end 
   st_help 
   t=0;,st=-1;,f=0; 
   return 
end 
 
% 如果输入数据为行向量的话,将它调整为列向量
if size(timeseries,2) > size(timeseries,1) 
	timeseries=timeseries';	 
end 
 
% 确保输入数据为1维向量,而不是矩阵
if size(timeseries,2) > 1 
   error('Please enter a *vector* of data, not matrix') 
	return 
elseif (size(timeseries)==[1 1]) == 1 
	error('Please enter a *vector* of data, not a scalar') 
	return 
end 
 
% 输入变量不全的情况下采用默认值
 
if nargin == 1  %只有1个输入变量
   minfreq = 0; 
   maxfreq = fix(length(timeseries)/2); 
   samplingrate=1; 
   freqsamplingrate=1; 
elseif nargin==2 %2个输入变量
   maxfreq = fix(length(timeseries)/2); 
   samplingrate=1; 
   freqsamplingrate=1; 
   [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries); 
elseif nargin==3  
   samplingrate=1; 
   freqsamplingrate=1; 
   [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries); 
elseif nargin==4    
   freqsamplingrate=1; 
   [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries); 
elseif nargin == 5 
      [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries); 
else       
   if verbose disp('Error in input arguments: using defaults'),end 
   minfreq = 0; 
   maxfreq = fix(length(timeseries)/2); 
   samplingrate=1; 
   freqsamplingrate=1; 
end 
if verbose  
   disp(sprintf('Minfreq = %d',minfreq)) 
   disp(sprintf('Maxfreq = %d',maxfreq)) 
   disp(sprintf('Sampling Rate (time   domain) = %d',samplingrate)) 
   disp(sprintf('Sampling Rate (freq.  domain) = %d',freqsamplingrate)) 
   disp(sprintf('The length of the timeseries is %d points',length(timeseries))) 
 
   disp(' ') 
end 
%END OF INPUT VARIABLE CHECK 
 
% If you want to "hardwire" minfreq & maxfreq & samplingrate & freqsamplingrate do it here 
 
% calculate the sampled time and frequency values from the two sampling rates 
t = (0:length(timeseries)-1)*samplingrate; 
spe_nelements =ceil((maxfreq - minfreq+1)/freqsamplingrate)   ; 
f = (minfreq + [0:spe_nelements-1]*freqsamplingrate)/(samplingrate*length(timeseries)); 
if verbose disp(sprintf('The number of frequency voices is %d',spe_nelements)),end 
 
 
% The actual S Transform function is here: 
st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor);  
% this function is below, thus nicely encapsulated 
 
%WRITE switch statement on nargout 
% if 0 then plot amplitude spectrum 
if nargout==0  
   if verbose disp('Plotting pseudocolor image'),end 
   pcolor(t,f,abs(st)) 
end 
 
 
return 
 
 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
 
 
function st = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor);  
% Returns the Stockwell Transform, STOutput, of the time-series 
% Code by R.G. Stockwell. 
% Reference is "Localization of the Complex Spectrum: The S Transform" 
% from IEEE Transactions on Signal Processing, vol. 44., number 4, 
% April 1996, pages 998-1001. 
% 
%-------Inputs Returned------------------------------------------------ 
%         - are all taken care of in the wrapper function above 
% 
%-------Outputs Returned------------------------------------------------ 
% 
%	ST    -a complex matrix containing the Stockwell transform. 
%			 The rows of STOutput are the frequencies and the 
%			 columns are the time values 
% 
% 
%----------------------------------------------------------------------- 
 
% Compute the length of the data. 
n=length(timeseries); 
original = timeseries; 
if removeedge 
    if verbose disp('Removing trend with polynomial fit'),end 
 	 ind = [0:n-1]'; 
    r = polyfit(ind,timeseries,2); 
    fit = polyval(r,ind) ; 
	 timeseries = timeseries - fit; 
    if verbose disp('Removing edges with 5% hanning taper'),end 
    sh_len = floor(length(timeseries)/10); 
    wn = hanning(sh_len); 
    if(sh_len==0) 
       sh_len=length(timeseries); 
       wn = 1&[1:sh_len]; 
    end 
    % make sure wn is a column vector, because timeseries is 
   if size(wn,2) > size(wn,1) 
      wn=wn';	 
   end 
    
   timeseries(1:floor(sh_len/2),1) = timeseries(1:floor(sh_len/2),1).*wn(1:floor(sh_len/2),1); 
	timeseries(length(timeseries)-floor(sh_len/2):n,1) = timeseries(length(timeseries)-floor(sh_len/2):n,1).*wn(sh_len-floor(sh_len/2):sh_len,1); 
   
end 
 
% If vector is real, do the analytic signal  
 
if analytic_signal 
   if verbose disp('Calculating analytic signal (using Hilbert transform)'),end 
   % this version of the hilbert transform is different than hilbert.m 
   %  This is correct! 
   ts_spe = fft(real(timeseries)); 
   h = [1; 2*ones(fix((n-1)/2),1); ones(1-rem(n,2),1); zeros(fix((n-1)/2),1)]; 
   ts_spe(:) = ts_spe.*h(:); 
   timeseries = ifft(ts_spe); 
end   
 
% Compute FFT's 
tic;vector_fft=fft(timeseries);tim_est=toc; 
vector_fft=[vector_fft,vector_fft]; 
tim_est = tim_est*ceil((maxfreq - minfreq+1)/freqsamplingrate)   ; 
if verbose disp(sprintf('Estimated time is %f',tim_est)),end 
 
% Preallocate the STOutput matrix 
st=zeros(ceil((maxfreq - minfreq+1)/freqsamplingrate),n); 
% Compute the mean 
% Compute S-transform value for 1 ... ceil(n/2+1)-1 frequency points 
if verbose disp('Calculating S transform...'),end 
if minfreq == 0 
   st(1,:) = mean(timeseries)*(1&[1:1:n]); 
else 
  	st(1,:)=ifft(vector_fft(minfreq+1:minfreq+n).*g_window(n,minfreq,factor)); 
end 
 
%the actual calculation of the ST 
% Start loop to increment the frequency point 
for banana=freqsamplingrate:freqsamplingrate:(maxfreq-minfreq) 
   st(banana/freqsamplingrate+1,:)=ifft(vector_fft(minfreq+banana+1:minfreq+banana+n).*g_window(n,minfreq+banana,factor)); 
end   % a fruit loop!   aaaaa ha ha ha ha ha ha ha ha ha ha 
% End loop to increment the frequency point 
if verbose disp('Finished Calculation'),end 
 
%%% end strans function 
 
%------------------------------------------------------------------------ 
function gauss=g_window(length,freq,factor) 
 
% Function to compute the Gaussion window for  
% function Stransform. g_window is used by function 
% Stransform. Programmed by Eric Tittley 
% 
%-----Inputs Needed-------------------------- 
% 
%	length-the length of the Gaussian window 
% 
%	freq-the frequency at which to evaluate 
%		  the window. 
%	factor- the window-width factor 
% 
%-----Outputs Returned-------------------------- 
% 
%	gauss-The Gaussian window 
% 
 
vector(1,:)=[0:length-1]; 
vector(2,:)=[-length:-1]; 
vector=vector.^2;     
vector=vector*(-factor*2*pi^2/freq^2); 
% Compute the Gaussion window 
gauss=sum(exp(vector)); 
 
%----------------------------------------------------------------------- 
 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^% 
function [ minfreq,maxfreq,samplingrate,freqsamplingrate] =  check_input(minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,timeseries) 
% this checks numbers, and replaces them with defaults if invalid 
 
% if the parameters are passed as an array, put them into the appropriate variables 
s = size(minfreq); 
l = max(s); 
if l > 1   
   if verbose disp('Array of inputs accepted.'),end 
   temp=minfreq; 
   minfreq = temp(1);; 
   if l > 1  maxfreq = temp(2);,end; 
   if l > 2  samplingrate = temp(3);,end; 
   if l > 3  freqsamplingrate = temp(4);,end; 
   if l > 4   
      if verbose disp('Ignoring extra input parameters.'),end 
   end; 
 
end       
      
   if minfreq < 0 | minfreq > fix(length(timeseries)/2); 
      minfreq = 0; 
      if verbose disp('Minfreq < 0 or > Nyquist. Setting minfreq = 0.'),end 
   end 
   if maxfreq > length(timeseries)/2  | maxfreq < 0  
      maxfreq = fix(length(timeseries)/2); 
      if verbose disp(sprintf('Maxfreq < 0 or > Nyquist. Setting maxfreq = %d',maxfreq)),end 
   end 
      if minfreq > maxfreq  
      temporary = minfreq; 
      minfreq = maxfreq; 
      maxfreq = temporary; 
      clear temporary; 
      if verbose disp('Swapping maxfreq <=> minfreq.'),end 
   end 
   if samplingrate <0 
      samplingrate = abs(samplingrate); 
      if verbose disp('Samplingrate <0. Setting samplingrate to its absolute value.'),end 
   end 
   if freqsamplingrate < 0   % check 'what if freqsamplingrate > maxfreq - minfreq' case 
      freqsamplingrate = abs(freqsamplingrate); 
      if verbose disp('Frequency Samplingrate negative, taking absolute value'),end 
   end 
 
% bloody odd how you don't end a function 
 
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^% 
function st_help
disp(' ')
disp('st()  HELP COMMAND')
disp('st() returns  - 1 or an error message if it fails')
disp('USAGE::    [localspectra,timevector,freqvector] = st(timeseries)')
disp('NOTE::   The function st() sets default parameters then calls the function strans()')
disp(' ')
disp('You can call strans() directly and pass the following parameters')
disp(' **** Warning!  These inputs are not checked if strans() is called directly!! ****')
disp('USAGE::  localspectra = strans(timeseries,minfreq,maxfreq,samplingrate,freqsamplingrate,verbose,removeedge,analytic_signal,factor) ')

disp(' ')
disp('Default parameters (available in st.m)')
disp('VERBOSE          - prints out informational messages throughout the function.')
disp('REMOVEEDGE       - removes the edge with a 5% taper, and takes')
disp('FACTOR           -  the width factor of the localizing gaussian')
disp('                    ie, a sinusoid of period 10 seconds has a ')
disp('                    gaussian window of width factor*10 seconds.')
disp('                    I usually use factor=1, but sometimes factor = 3')
disp('                    to get better frequency resolution.')
disp(' ')
disp('Default input variables')
disp('MINFREQ           - the lowest frequency in the ST result(Default=0)')
disp('MAXFREQ           - the highest frequency in the ST result (Default=nyquist')
disp('SAMPLINGRATE      - the time interval between successive data points (Default = 1)')
disp('FREQSAMPLINGRATE  - the number of frequencies between samples in the ST results')
% end of st_help procedure

S逆变换函数

function [ts] = inverse_st(st) 
% Returns the inverse of the Stockwell Transform of the REAL_VALUED timeseries. 
% Reference is "Localization of the Complex Spectrum: The S Transform" 
% from IEEE Transactions on Signal Processing, vol. 44., number 4, April 1996, pages 998-1001. 
% 
%-------Inputs Needed------------------------------------------------ 
%   
%  S-Transform matrix created by the st.m function 
%-------Optional Inputs ------------------------------------------------ 
% none 
%-------Outputs Returned------------------------------------------------ 
% 
% ts     -a REAL-VALUED time series 
%--------Additional details----------------------- 
 
% sum over time to create the FFT spectrum for the positive frequencies 
stspe = sum(st,2); 
 
% get st matrix dimensions  
[nfreq,ntimes] = size(st); 
if rem(ntimes ,2) ~= 0 
    % odd number of points, so nyquist point is not aliased, so concatenate 
    % the reversed spectrum to create the negative frequencies 
    % drop the DC value 
    negspe = fliplr(stspe(2:nfreq)'); 
else 
     % even number of points 
     % therefore drop the first point (DC) and the last point (aliased nyqusit freq) 
     negspe = fliplr(stspe(2:nfreq-1)'); 
end 
 
% using symmetry of FFT spectrum of a real signal, recreate the negative frequencies from the positie frequencies 
 fullstspe = [conj(stspe')  negspe];     
 
% the time series is the inverse fft of this 
ts = ifft(fullstspe); 
% and take the real part, the imaginary part will be zero. 
ts = real(ts); 
 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2276414.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

51c自动驾驶~合集46

我自己的原文哦~ https://blog.51cto.com/whaosoft/13050104 #世界模型会是L3自动驾驶的唯一解吗 三维空间占有率&#xff08;3D Occupancy&#xff09;预测的目的是预测三维空间中的每个体素是否被占有&#xff0c;如果被占有&#xff0c;则对应的体素将被标记。3D Semant…

从CentOS到龙蜥:企业级Linux迁移实践记录(龙蜥开局)

引言&#xff1a; 在我们之前的文章中&#xff0c;我们详细探讨了从CentOS迁移到龙蜥操作系统的基本过程和考虑因素。今天&#xff0c;我们将继续这个系列&#xff0c;重点关注龙蜥系统的实际应用——特别是常用软件的安装和配置。 龙蜥操作系统&#xff08;OpenAnolis&#…

WMS仓库管理系统,Vue前端开发,Java后端技术源码(源码学习)

一、项目背景和建设目标 随着企业业务的不断扩展&#xff0c;仓库管理成为影响生产效率、成本控制及客户满意度的重要环节。为了提升仓库作业的透明度、准确性和效率&#xff0c;本方案旨在构建一套全面、高效、易用的仓库管理系统&#xff08;WMS&#xff09;。该系统将涵盖库…

Docker Search失败,但是Pull成功的解决方法(环境:腾讯云服务器CentOS7系统安装Docker)

Docker Search失败&#xff0c;但是Pull成功的解决方法&#xff08;环境&#xff1a;腾讯云服务器CentOS7系统安装Docker&#xff09; 背景解决思路 背景 在安装完成Docker后&#xff0c;成功启动Docker(Systemctl start Docker)&#xff0c;使用搜索镜像命令&#xff08;Dock…

ClickHouse vs StarRocks 选型对比

一、面向列存的 DBMS 新的选择 Hadoop 从诞生已经十三年了&#xff0c;Hadoop 的供应商争先恐后的为 Hadoop 贡献各种开源插件&#xff0c;发明各种的解决方案技术栈&#xff0c;一方面确实帮助很多用户解决了问题&#xff0c;但另一方面因为繁杂的技术栈与高昂的维护成本&…

慧集通(DataLinkX)iPaaS集成平台-业务建模之业务对象(二)

3.UI模板 当我们选择一条已经建好的业务对象点击功能按钮【UI模板】进入该业务对象的UI显示配置界面。 右边填写的是UI模板的编码以及对应名称&#xff1b;菜单界面配置以业务对象UI模板编码获取显示界面。 3.1【列表-按钮】 展示的对应业务对象界面的功能按钮配置&#xff1…

TCL小蓝翼新风空调亮相CES2025,斩获智慧新风技术创新大奖

1月7日-11日&#xff0c;被称为“科技界春晚”的CES 2025&#xff08;国际消费类电子产品展览会&#xff09;在美国拉斯维加斯举行。 本届CES&#xff0c;TCL小蓝翼新风空调更是惊艳亮相TCL展区&#xff0c;以领先的健康新风及AI技术&#xff0c;斩获CES2025 智慧新风技术创新…

【I/O编程】UNIX文件基础

IO编程的本质是通过 API 操作 文件。 什么是 IO I - Input 输入O - Output 输出 这里的输入和输出都是站在应用&#xff08;运行中的程序&#xff09;的角度。外部特指文件。 这里的文件是泛指&#xff0c;并不是只表示存在存盘中的常规文件。还有设备、套接字、管道、链接…

【计算机网络】深入浅出计算机网络

第一章 计算机网络在信息时代的作用 计算机网络已由一种通信基础设施发展成一种重要的信息服务基础设施 CNNIC 中国互联网网络信息中心 因特网概述 网络、互联网和因特网 网络&#xff08;Network&#xff09;由若干结点&#xff08;Node&#xff09;和连接这些结点的链路…

在IDEA上运行Java项目

新建一个项目&#xff0c;下面创建模块&#xff0c;然后在src下新建包名&#xff0c;最后见类&#xff08;class&#xff09; 设置主题 settings>apparence 设置字体 Editor> Font 设置注释 Editor>Color Scheme>Language Defaults>Comments 设置自动导包 …

ASO优化之应用程序本地化的类型和策略

应用程序本地化是进入全球移动电话用户市场的关键一步。但它到底是什么&#xff1f;应用程序本地化是指定制您的应用程序以适应多种语言、文化、语言和区域设置。这不仅仅是翻译&#xff0c;它考虑了地区法规、文化细微差别和当地偏好。本地化良好的应用程序可以引起用户的共鸣…

gcc编译过程中-L和-rpath的作用

前言 今天记录一下&#xff0c;在gcc编译过程中-L和-rpath的区别 -L是程序链接过程中指定链接动态库的路径&#xff0c;-rpath是程序运行过程中指定链接动态库的路径。&#xff08;官方话术&#xff09; 其实就是当gcc编译生成可执行文件的时候需要指定-L参数&#xff0c;才能找…

3D目标检测数据集——kitti数据集

KITTI官网网址&#xff1a;The KITTI Vision Benchmark Suite 下载数据集&#xff1a;The KITTI Vision Benchmark Suite KITTI数据集论文&#xff1a;CMSY9 github可视化代码&#xff1a;GitHub - kuixu/kitti_object_vis: KITTI Object Visualization (Birdview, Volumetric …

AI大模型赋能!移远通信打造具有“超能力”的AI智能玩具解决方案

随着无线通信、先进算法以及AI大模型等前沿技术的蓬勃发展&#xff0c;许多玩具已经从简单的互动设备进化为集教育、陪伴和娱乐功能于一身的AI智能玩具&#xff0c;在儿童群体中日渐风靡。不仅如此&#xff0c;因其能提供满满的情绪价值&#xff0c;在成年人和老年人市场中也展…

LED灯按键调光芯片、PWM调光IC、发光灯控制调光芯片

按键调光芯片&#xff0c;特别是LED灯使用PWM调光的芯片IC&#xff0c;是一种用于控制LED灯具亮度的集成电路&#xff0c;常用于台灯、壁灯、吊灯等照明设备中。这种芯片通过脉冲宽度调制&#xff08;PWM&#xff09;技术来调节LED的亮度&#xff0c;可以实现从最亮到最暗的平滑…

【专题】2025年节日营销趋势洞察报告汇总PDF洞察(附原数据表)

原文链接&#xff1a; https://tecdat.cn/?p38813 在当今复杂多变且竞争激烈的消费市场环境下&#xff0c;节日营销已成为企业获取市场份额、提升品牌影响力的关键战略时机。我们深知深入洞察节日营销趋势对于企业决策的重要性。 本报告汇总基于对 2024 年多个关键消费节点及…

what?ngify 比 axios 更好用,更强大?

文章目录 前言一、什么是ngify&#xff1f;二、npm安装三、发起请求3.1 获取 JSON 数据3.2 获取其他类型的数据3.3 改变服务器状态3.4 设置 URL 参数3.5 设置请求标头3.6 与服务器响应事件交互3.7 接收原始进度事件3.8 处理请求失败3.9 Http Observables 四、更换 HTTP 请求实现…

前端练习题

图片&#xff1a; 代码&#xff1a; <!DOCTYPE html> <html> <head><meta charset"UTF-8"><title>用户信息页面</title><style>body {font-family: Arial, sans-serif;margin: 20px;}.user-info {display: flex;align-it…

jupyter notebook练手项目:线性回归——学习时间与成绩的关系

线性回归——学习时间与学习成绩的关系 第1步&#xff1a;导入工具库 pandas——数据分析库&#xff0c;提供了数据结构&#xff08;如DataFrame和Series&#xff09;和数据操作方法&#xff0c;方便对数据集进行读取、清洗、转换等操作。 matplotlib——绘图库&#xff0c;p…